about summary refs log tree commit diff
path: root/tests/ui/lifetimes/raw/raw-lt-invalid-raw-id.rs
blob: 882fad925f371a3732783bea32e53387de6f4a22 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//@ edition: 2021

// Reject raw lifetimes with identifier parts that wouldn't be valid raw identifiers.

macro_rules! w {
    ($tt:tt) => {};
}

w!('r#_);
//~^ ERROR `_` cannot be a raw lifetime
w!('r#self);
//~^ ERROR `self` cannot be a raw lifetime
w!('r#super);
//~^ ERROR `super` cannot be a raw lifetime
w!('r#Self);
//~^ ERROR `Self` cannot be a raw lifetime
w!('r#crate);
//~^ ERROR `crate` cannot be a raw lifetime

fn main() {}