rust/tests/ui/parser/underscore-suffix-for-string.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
457 B
Rust
Raw Normal View History

macro_rules! sink {
($tt:tt) => {()}
}
2018-10-20 16:02:06 -05:00
fn main() {
2017-05-31 02:43:47 -05:00
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
}