mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
Auto merge of #16048 - Veykril:concat-bytes-fix, r=Veykril
fix: Fix concat_bytes! expansion emitting an identifier Fixes https://github.com/rust-lang/rust-analyzer/issues/16046 (note that this has always been broken)
This commit is contained in:
commit
86cccc76e3
12 changed files with 107 additions and 49 deletions
|
@ -468,12 +468,12 @@ macro_rules! concat_bytes {}
|
|||
|
||||
fn main() { concat_bytes!(b'A', b"BC", [68, b'E', 70]); }
|
||||
"##,
|
||||
expect![[r##"
|
||||
expect![[r#"
|
||||
#[rustc_builtin_macro]
|
||||
macro_rules! concat_bytes {}
|
||||
|
||||
fn main() { [b'A', 66, 67, 68, b'E', 70]; }
|
||||
"##]],
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -1004,3 +1004,29 @@ fn main() {
|
|||
"##]],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn eager_concat_bytes_panic() {
|
||||
check(
|
||||
r#"
|
||||
#[rustc_builtin_macro]
|
||||
#[macro_export]
|
||||
macro_rules! concat_bytes {}
|
||||
|
||||
fn main() {
|
||||
let x = concat_bytes!(2);
|
||||
}
|
||||
|
||||
"#,
|
||||
expect![[r#"
|
||||
#[rustc_builtin_macro]
|
||||
#[macro_export]
|
||||
macro_rules! concat_bytes {}
|
||||
|
||||
fn main() {
|
||||
let x = /* error: unexpected token in input */[];
|
||||
}
|
||||
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue