mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-30 03:57:37 +00:00

Notes about tests: - tests/ui/parser/macro/trait-object-macro-matcher.rs: the syntax error is duplicated, because it occurs now when parsing the decl macro input, and also when parsing the expanded decl macro. But this won't show up for normal users due to error de-duplication. - tests/ui/associated-consts/issue-93835.rs: similar, plus there are some additional errors about this very broken code. - The changes to metavariable descriptions in #132629 are now visible in error message for several tests.
16 lines
408 B
Rust
16 lines
408 B
Rust
// A single lifetime is not parsed as a type.
|
|
// `ty` matcher in particular doesn't accept a single lifetime
|
|
|
|
macro_rules! m {
|
|
($t: ty) => {
|
|
let _: $t;
|
|
};
|
|
}
|
|
|
|
fn main() {
|
|
m!('static);
|
|
//~^ ERROR lifetime in trait object type must be followed by `+`
|
|
//~| ERROR lifetime in trait object type must be followed by `+`
|
|
//~| ERROR at least one trait is required for an object type
|
|
}
|