diff options
author | Aleksey Kladov <[email protected]> | 2021-06-13 18:20:58 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2021-06-13 18:20:58 +0100 |
commit | 24262f9ff6ae9ea326fa35d238704d18e99d52a1 (patch) | |
tree | 4072b940cd1081c404dabe6026b14b4ca0141c2d /crates/ide/src/diagnostics/missing_fields.rs | |
parent | 949a6ec469507db5e79578da94e17cb63cb54d19 (diff) |
minor
Diffstat (limited to 'crates/ide/src/diagnostics/missing_fields.rs')
-rw-r--r-- | crates/ide/src/diagnostics/missing_fields.rs | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/crates/ide/src/diagnostics/missing_fields.rs b/crates/ide/src/diagnostics/missing_fields.rs index 95cd64956..c4b6a3679 100644 --- a/crates/ide/src/diagnostics/missing_fields.rs +++ b/crates/ide/src/diagnostics/missing_fields.rs | |||
@@ -94,6 +94,39 @@ fn baz(s: S) { | |||
94 | } | 94 | } |
95 | 95 | ||
96 | #[test] | 96 | #[test] |
97 | fn range_mapping_out_of_macros() { | ||
98 | // FIXME: this is very wrong, but somewhat tricky to fix. | ||
99 | check_fix( | ||
100 | r#" | ||
101 | fn some() {} | ||
102 | fn items() {} | ||
103 | fn here() {} | ||
104 | |||
105 | macro_rules! id { ($($tt:tt)*) => { $($tt)*}; } | ||
106 | |||
107 | fn main() { | ||
108 | let _x = id![Foo { a: $042 }]; | ||
109 | } | ||
110 | |||
111 | pub struct Foo { pub a: i32, pub b: i32 } | ||
112 | "#, | ||
113 | r#" | ||
114 | fn some(, b: () ) {} | ||
115 | fn items() {} | ||
116 | fn here() {} | ||
117 | |||
118 | macro_rules! id { ($($tt:tt)*) => { $($tt)*}; } | ||
119 | |||
120 | fn main() { | ||
121 | let _x = id![Foo { a: 42 }]; | ||
122 | } | ||
123 | |||
124 | pub struct Foo { pub a: i32, pub b: i32 } | ||
125 | "#, | ||
126 | ); | ||
127 | } | ||
128 | |||
129 | #[test] | ||
97 | fn test_fill_struct_fields_empty() { | 130 | fn test_fill_struct_fields_empty() { |
98 | check_fix( | 131 | check_fix( |
99 | r#" | 132 | r#" |