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.
1 parent 77374a9 commit d9993cbCopy full SHA for d9993cb
clippy_lints/src/functions/misnamed_getters.rs
@@ -101,16 +101,14 @@ pub fn check_fn(
101
}
102
103
let Some(used_field) = used_field else {
104
- if cfg!(debug_assertions) {
105
- panic!("Struct doesn't contain the correct field");
106
- } else {
107
- // Don't ICE when possible
108
- return;
109
- }
110
- };
+ // FIXME: This can be reached if the field access uses autoderef.
+ // `dec.all_fields()` should be replaced by something that uses autoderef.
+ return;
+ };
+
111
let Some(correct_field) = correct_field else {
112
return;
113
114
115
if cx.tcx.type_of(used_field.did) == cx.tcx.type_of(correct_field.did) {
116
let left_span = block_expr.span.until(used_ident.span);
0 commit comments