mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-07 04:38:46 +00:00
22 lines
628 B
Rust
22 lines
628 B
Rust
// A single lifetime is not parsed as a type.
|
|
// `ty` matcher in particular doesn't accept a single lifetime
|
|
|
|
//@ revisions: e2015 e2021
|
|
//@[e2015] edition: 2015
|
|
//@[e2021] edition: 2021
|
|
|
|
macro_rules! m {
|
|
($t: ty) => {
|
|
let _: $t;
|
|
};
|
|
}
|
|
|
|
fn main() {
|
|
//[e2021]~vv ERROR expected type, found lifetime
|
|
//[e2021]~v ERROR expected type, found lifetime
|
|
m!('static);
|
|
//[e2015]~^ ERROR lifetimes must be followed by `+` to form a trait object type
|
|
//[e2015]~| ERROR lifetimes must be followed by `+` to form a trait object type
|
|
//[e2015]~| ERROR at least one trait is required for an object type
|
|
}
|