---
title: "insta: a compiler warning in a Rust macro | VulCode"
description: "A fix in insta in Rust: the two-argument assert_binary_snapshot! macro no longer ends in a semicolon, so at the end of a block it triggers no warning."
url: "https://vulcode.com/en/opensource/contributions/insta"
lang: "en"
---

[All contributions](https://vulcode.com/en/opensource/contributions)

mitsuhiko/insta

# insta

A snapshot testing library for Rust: it stores a test's output in a file and compares later runs against it.

[See the repository](https://github.com/mitsuhiko/insta) [All contributions](https://vulcode.com/en/opensource/contributions)

- **Language**: Rust
- **GitHub stars**: 2,988
- **Merged changes**: 1
- **Project site**: [insta.rs](https://insta.rs)

## What we changed

The two-argument form of the assert_binary_snapshot! macro no longer ends in a semicolon, so using it at the end of a block no longer triggers a compiler warning.

### What this work shows

- Rust declarative macros (macro_rules!)

- Rust compiler lints

- Testing on nightly and a pinned toolchain

What was broken

### The macro warned at the end of a block

An earlier change removed the trailing semicolons from the serialisation macro bodies but missed the two-argument arm of assert_binary_snapshot!. Used at the end of a block, the macro triggered the semicolon_in_expressions_from_non_local_macros warning on newer toolchains.

How we fixed it

### No semicolon in the macro or the test

We removed the semicolon from that macro arm and from the call in test_binary.rs, so the test uses the macro as an expression. Without the fix the test fails on nightly, while the pinned 1.95 toolchain does not fire the lint here.

[#946](https://github.com/mitsuhiko/insta/pull/946)

## Merged change

1 10 October 2026

- [01 #946Merged 10 October 2026 Remove trailing semicolon from assert_binary_snapshot! macro body](https://github.com/mitsuhiko/insta/pull/946)

## What it taught us

A fix to one arm of a macro easily misses the others. A test that uses every arm the way a user does catches it at once, as long as we also run it on a newer compiler than the one the project pins.

[More about this technology: Rust](https://vulcode.com/en/technologies/rust)

## Other projects we write code for

- [**Zed** Rust · 95,562 stars A fast code editor in Rust from the creators of Atom and Tree-sitter, with live multiplayer editing.](https://vulcode.com/en/opensource/contributions/zed)

- [**uv** Rust · 92,647 stars An extremely fast Python package and project manager written in Rust. It creates projects, installs dependencies and manages virtual environments.](https://vulcode.com/en/opensource/contributions/uv)

- [**ripgrep** Rust · 70,186 stars A command line tool that recursively searches directories for a regex pattern while respecting your .gitignore. Written in Rust.](https://vulcode.com/en/opensource/contributions/ripgrep)

- [**Alacritty** Rust · 66,271 stars A cross-platform terminal emulator rendered with OpenGL, written in Rust and configured with a TOML file.](https://vulcode.com/en/opensource/contributions/alacritty)

- [**Gleam** Rust · 22,083 stars A friendly programming language for building type-safe, scalable systems. Its compiler is written in Rust.](https://vulcode.com/en/opensource/contributions/gleam)

- [**Sonic** Rust · 21,387 stars A lightweight full-text search backend in Rust, an alternative to Elasticsearch that runs in a few megabytes of RAM.](https://vulcode.com/en/opensource/contributions/sonic)

## Describe your project.

A free quote comes back within an hour during working hours.

### Rather skip the form?

Ask in the chat or write to us directly.

Open the chat

- **Email**: [hello@vulcode.com](mailto:hello@vulcode.com)
- **Phone**: [+48 576 043 920](tel:+48576043920)
- **Discord**: [discord.gg/vulcode](https://discord.gg/vulcode)
