mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 05:33:27 +00:00
Remove error when fields use autoderef
This commit is contained in:
parent
77374a9527
commit
d9993cb133
1 changed files with 6 additions and 8 deletions
|
@ -101,16 +101,14 @@ pub fn check_fn(
|
|||
}
|
||||
|
||||
let Some(used_field) = used_field else {
|
||||
if cfg!(debug_assertions) {
|
||||
panic!("Struct doesn't contain the correct field");
|
||||
} else {
|
||||
// Don't ICE when possible
|
||||
return;
|
||||
}
|
||||
};
|
||||
// FIXME: This can be reached if the field access uses autoderef.
|
||||
// `dec.all_fields()` should be replaced by something that uses autoderef.
|
||||
return;
|
||||
};
|
||||
|
||||
let Some(correct_field) = correct_field else {
|
||||
return;
|
||||
};
|
||||
};
|
||||
|
||||
if cx.tcx.type_of(used_field.did) == cx.tcx.type_of(correct_field.did) {
|
||||
let left_span = block_expr.span.until(used_ident.span);
|
||||
|
|
Loading…
Reference in a new issue