rust/tests/ui/macros/break-last-token-twice.rs
Nicholas Nethercote 73cc575177 Fix break_last_token.
It currently doesn't handle the three-char tokens `>>=` and `<<=`
correctly. These can be broken twice, resulting in three individual
tokens. This is a latent bug that currently doesn't cause any problems,
but does cause problems for #124141, because that PR increases the usage
of lazy token streams.
2024-09-23 09:14:30 +10:00

17 lines
338 B
Rust

//@ check-pass
macro_rules! m {
(static $name:ident: $t:ty = $e:expr) => {
let $name: $t = $e;
}
}
fn main() {
m! {
// Tricky: the trailing `>>=` token here is broken twice:
// - into `>` and `>=`
// - then the `>=` is broken into `>` and `=`
static _x: Vec<Vec<u32>>= vec![]
}
}