This commit is contained in:
Aleksey Kladov 2021-06-13 20:20:58 +03:00
parent 949a6ec469
commit 24262f9ff6
3 changed files with 34 additions and 44 deletions

View file

@ -93,6 +93,39 @@ fn baz(s: S) {
);
}
#[test]
fn range_mapping_out_of_macros() {
// FIXME: this is very wrong, but somewhat tricky to fix.
check_fix(
r#"
fn some() {}
fn items() {}
fn here() {}
macro_rules! id { ($($tt:tt)*) => { $($tt)*}; }
fn main() {
let _x = id![Foo { a: $042 }];
}
pub struct Foo { pub a: i32, pub b: i32 }
"#,
r#"
fn some(, b: () ) {}
fn items() {}
fn here() {}
macro_rules! id { ($($tt:tt)*) => { $($tt)*}; }
fn main() {
let _x = id![Foo { a: 42 }];
}
pub struct Foo { pub a: i32, pub b: i32 }
"#,
);
}
#[test]
fn test_fill_struct_fields_empty() {
check_fix(