Add quote!() example to reserved_prefix lint test.
This commit is contained in:
parent
0eeeebc990
commit
c7f7c2efe0
3 changed files with 34 additions and 1 deletions
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue