about summary refs log tree commit diff
path: root/tests/ui/parser/macro/trait-object-macro-matcher.rs
blob: ba61752fe40245f5d4f17795f1bc9c797987e1f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// 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
}