summaryrefslogtreecommitdiffstats
path: root/tests/ui/parser/underscore-suffix-for-string.rs
blob: bd260752e04d61297208c3a850c86ecc1f003c81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
macro_rules! sink {
    ($tt:tt) => {()}
}

fn main() {
    let _ = "Foo"_;
    //~^ ERROR underscore literal suffix is not allowed

    // This is ok, because `__` is a valid identifier and the macro consumes it
    // before proper parsing happens.
    let _ = sink!("Foo"__);

    // This is not ok, even as an input to a macro, because the `_` suffix is
    // never allowed.
    sink!("Foo"_);
    //~^ ERROR underscore literal suffix is not allowed
}