This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +71
-0
lines changed Expand file tree Collapse file tree 3 files changed +71
-0
lines changed Original file line number Diff line number Diff line change 1+ //@ run-rustfix
2+ //@ check-pass
3+ //@ compile-flags: --edition=2021
4+ #![allow(incomplete_features)]
5+ #![feature(expr_fragment_specifier_2024)]
6+ #![warn(edition_2024_expr_fragment_specifier)]
7+
8+ macro_rules! m {
9+ ($e:expr_2021) => { //~ WARN: the `expr` fragment specifier will accept more expressions in the 2024 edition.
10+ //~^ WARN: this changes meaning in Rust 2024
11+ $e
12+ };
13+ ($($i:expr_2021)*) => { }; //~ WARN: the `expr` fragment specifier will accept more expressions in the 2024 edition.
14+ //~^ WARN: this changes meaning in Rust 2024
15+ }
16+
17+ fn main() {
18+ m!(());
19+ }
Original file line number Diff line number Diff line change 1+ //@ run-rustfix
2+ //@ check-pass
3+ //@ compile-flags: --edition=2021
4+ #![ allow( incomplete_features) ]
5+ #![ feature( expr_fragment_specifier_2024) ]
6+ #![ warn( edition_2024_expr_fragment_specifier) ]
7+
8+ macro_rules! m {
9+ ( $e: expr) => { //~ WARN: the `expr` fragment specifier will accept more expressions in the 2024 edition.
10+ //~^ WARN: this changes meaning in Rust 2024
11+ $e
12+ } ;
13+ ( $( $i: expr) * ) => { } ; //~ WARN: the `expr` fragment specifier will accept more expressions in the 2024 edition.
14+ //~^ WARN: this changes meaning in Rust 2024
15+ }
16+
17+ fn main ( ) {
18+ m ! ( ( ) ) ;
19+ }
Original file line number Diff line number Diff line change 1+ warning: the `expr` fragment specifier will accept more expressions in the 2024 edition.
2+ --> $DIR/expr_2021_cargo_fix_edition.rs:9:9
3+ |
4+ LL | ($e:expr) => {
5+ | ^^^^
6+ |
7+ = warning: this changes meaning in Rust 2024
8+ = note: for more information, see Migration Guide <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/macro-fragment-specifiers.html>
9+ note: the lint level is defined here
10+ --> $DIR/expr_2021_cargo_fix_edition.rs:6:9
11+ |
12+ LL | #![warn(edition_2024_expr_fragment_specifier)]
13+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
14+ help: to keep the existing behavior, use the `expr_2021` fragment specifier.
15+ |
16+ LL | ($e:expr_2021) => {
17+ | ~~~~~~~~~
18+
19+ warning: the `expr` fragment specifier will accept more expressions in the 2024 edition.
20+ --> $DIR/expr_2021_cargo_fix_edition.rs:13:11
21+ |
22+ LL | ($($i:expr)*) => { };
23+ | ^^^^
24+ |
25+ = warning: this changes meaning in Rust 2024
26+ = note: for more information, see Migration Guide <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/macro-fragment-specifiers.html>
27+ help: to keep the existing behavior, use the `expr_2021` fragment specifier.
28+ |
29+ LL | ($($i:expr_2021)*) => { };
30+ | ~~~~~~~~~
31+
32+ warning: 2 warnings emitted
33+
You can’t perform that action at this time.
0 commit comments