2022-11-03 12:02:33 +11:00
|
|
|
macro_rules! sink {
|
|
|
|
($tt:tt) => {()}
|
|
|
|
}
|
2018-10-21 00:02:06 +03:00
|
|
|
|
2017-05-14 21:37:50 +09:00
|
|
|
fn main() {
|
2017-05-31 16:43:47 +09:00
|
|
|
let _ = "Foo"_;
|
2022-11-03 12:02:33 +11:00
|
|
|
//~^ 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
|
2017-05-14 21:37:50 +09:00
|
|
|
}
|