Skip to content

Cross-crate semicolon_in_expressions_from_macros lint errors on nightly #156084

@tronical

Description

@tronical

Code

The semicolon_in_expressions_from_macros lint error seems to trigger across crate boundaries now:

mkdir -p repro/outer/src repro/user/src
cat > repro/Cargo.toml <<'EOF'
[workspace]
members = ["outer", "user"]
resolver = "2"
EOF
cat > repro/outer/Cargo.toml <<'EOF'
[package]
name = "outer_crate"
version = "0.0.1"
edition = "2021"
EOF
cat > repro/outer/src/lib.rs <<'EOF'
#[macro_export]
macro_rules! outer {
    ($inner:ident) => { $inner![1, 2, 3]; };
}
EOF
cat > repro/user/Cargo.toml <<'EOF'
[package]
name = "user_crate"
version = "0.0.1"
edition = "2021"
[dependencies]
outer_crate = { path = "../outer" }
EOF
cat > repro/user/src/main.rs <<'EOF'
macro_rules! inner {
    [$($x:expr),*] => { [$($x),*] };
}
fn main() {
    let _v: Vec<i32> = outer_crate::outer!(inner).into_iter().collect();
}
EOF

cd repro
cargo +stable build   # succeeds, no warnings
cargo +nightly build  # hard error

I expected to see this happen: A warning at most :)

Instead, this happened: I see semicolon_in_expressions_from_macros error.

Version it worked on

It most recently worked on: rustc 1.95.0 (5980761 2026-04-14)

Version with regression

rustc --version --verbose:

rustc 1.97.0-nightly (67bcaa9c4 2026-05-01) 

Backtrace

Backtrace

<backtrace>

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions