]> git.proxmox.com Git - rustc.git/blob - src/test/ui/rust-2021/reserved-prefixes-migration.rs
New upstream version 1.55.0+dfsg1
[rustc.git] / src / test / ui / rust-2021 / reserved-prefixes-migration.rs
1 // check-pass
2 // run-rustfix
3 // compile-flags: -Z unstable-options --edition 2018
4
5 #![warn(rust_2021_prefixes_incompatible_syntax)]
6
7 macro_rules! m2 {
8 ($a:tt $b:tt) => {};
9 }
10
11 macro_rules! m3 {
12 ($a:tt $b:tt $c:tt) => {};
13 }
14
15 fn main() {
16 m2!(z"hey");
17 //~^ WARNING prefix `z` is unknown [rust_2021_prefixes_incompatible_syntax]
18 //~| WARNING hard error in Rust 2021
19 m2!(prefix"hey");
20 //~^ WARNING prefix `prefix` is unknown [rust_2021_prefixes_incompatible_syntax]
21 //~| WARNING hard error in Rust 2021
22 m3!(hey#123);
23 //~^ WARNING prefix `hey` is unknown [rust_2021_prefixes_incompatible_syntax]
24 //~| WARNING hard error in Rust 2021
25 m3!(hey#hey);
26 //~^ WARNING prefix `hey` is unknown [rust_2021_prefixes_incompatible_syntax]
27 //~| WARNING hard error in Rust 2021
28 }
29
30 macro_rules! quote {
31 (# name = # kind # value) => {};
32 }
33
34 quote! {
35 #name = #kind#value
36 //~^ WARNING prefix `kind` is unknown [rust_2021_prefixes_incompatible_syntax]
37 //~| WARNING hard error in Rust 2021
38 }