We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
no_such_field
1 parent 4505f03 commit 1374bc8Copy full SHA for 1374bc8
crates/ide-diagnostics/src/handlers/no_such_field.rs
@@ -128,6 +128,36 @@ fn missing_record_expr_field_fixes(
128
mod tests {
129
use crate::tests::{check_diagnostics, check_fix, check_no_fix};
130
131
+ #[test]
132
+ fn dont_work_for_field_with_disabled_cfg() {
133
+ check_diagnostics(
134
+ r#"
135
+struct Test {
136
+ #[cfg(feature = "hello")]
137
+ test: u32,
138
+ other: u32
139
+}
140
+
141
+fn main() {
142
+ let a = Test {
143
144
+ test: 1,
145
+ other: 1
146
+ };
147
148
+ let Test {
149
150
+ test,
151
+ mut other,
152
+ ..
153
+ } = a;
154
155
+ other += 1;
156
157
+"#,
158
+ );
159
+ }
160
161
#[test]
162
fn no_such_field_diagnostics() {
163
check_diagnostics(
0 commit comments