Add quote!() example to reserved_prefix lint test.

This commit is contained in:
Mara Bos 2021-06-14 17:07:40 +00:00 committed by lrh2000
parent 0eeeebc990
commit c7f7c2efe0
3 changed files with 34 additions and 1 deletions

View file

@ -26,3 +26,13 @@ fn main() {
//~^ WARNING prefix `hey` is unknown [reserved_prefix]
//~| WARNING become a hard error
}
macro_rules! quote {
(# name = # kind # value) => {};
}
quote! {
#name = #kind #value
//~^ WARNING prefix `kind` is unknown [reserved_prefix]
//~| WARNING become a hard error
}

View file

@ -26,3 +26,13 @@ fn main() {
//~^ WARNING prefix `hey` is unknown [reserved_prefix]
//~| WARNING become a hard error
}
macro_rules! quote {
(# name = # kind # value) => {};
}
quote! {
#name = #kind#value
//~^ WARNING prefix `kind` is unknown [reserved_prefix]
//~| WARNING become a hard error
}

View file

@ -55,5 +55,18 @@ help: insert whitespace here to avoid this being parsed as a prefix in Rust 2021
LL | m3!(hey #hey);
| --
warning: 4 warnings emitted
warning: prefix `kind` is unknown
--> $DIR/reserved-prefixes-migration.rs:35:14
|
LL | #name = #kind#value
| ^^^^ unknown prefix
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2021 edition!
= note: for more information, see issue #84978 <https://github.com/rust-lang/rust/issues/84978>
help: insert whitespace here to avoid this being parsed as a prefix in Rust 2021
|
LL | #name = #kind #value
| --
warning: 5 warnings emitted