]> git.lizzy.rs Git - rust.git/blob - tests/ui/parser/underscore-suffix-for-string.rs
Rollup merge of #106638 - RalfJung:realstd, r=thomcc
[rust.git] / tests / ui / parser / underscore-suffix-for-string.rs
1 macro_rules! sink {
2     ($tt:tt) => {()}
3 }
4
5 fn main() {
6     let _ = "Foo"_;
7     //~^ ERROR underscore literal suffix is not allowed
8
9     // This is ok, because `__` is a valid identifier and the macro consumes it
10     // before proper parsing happens.
11     let _ = sink!("Foo"__);
12
13     // This is not ok, even as an input to a macro, because the `_` suffix is
14     // never allowed.
15     sink!("Foo"_);
16     //~^ ERROR underscore literal suffix is not allowed
17 }