Closed
Description
macro_rules! m {
($a:tt $b:tt) => {
$b $a;
}
}
fn main() {
m!(S struct);
}
This is a regression in 1.18.0-beta but unclear whether it affects anything in practice. We encountered this in #rust-libs discussing #40939.
$ rustc +stable --version
rustc 1.17.0 (56124baa9 2017-04-24)
$ cargo +stable build
Compiling testing v0.1.0
warning: struct is never used: `S`
--> src/main.rs:8:10
|
8 | m!(S struct);
| -----^------- in this macro invocation
|
= note: #[warn(dead_code)] on by default
Finished dev [unoptimized + debuginfo] target(s) in 0.34 secs
$ rustc +beta --version
rustc 1.18.0-beta.2 (f4e8e81c3 2017-05-11)
$ cargo +beta build
Compiling testing v0.1.0
warning: struct is never used: `S`
--> src/main.rs:8:10
|
3 | | $b $a;
| |______________^
...
8 | m!(S struct);
| _____-----^-------
| | |
| | in this macro invocation
|
= note: #[warn(dead_code)] on by default
Finished dev [unoptimized + debuginfo] target(s) in 0.45 secs
Metadata
Metadata
Assignees
Labels
Area: Messages for errors, warnings, and lintsCall for participation: Help is requested to fix this issue.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Low priorityRelevant to the compiler team, which will review and decide on the PR/issue.Performance or correctness regression from one stable version to another.