Remove error when fields use autoderef

This commit is contained in:
Sosthène Guédon 2022-11-20 12:20:16 +01:00
parent 77374a9527
commit d9993cb133

View file

@ -101,13 +101,11 @@ pub fn check_fn(
} }
let Some(used_field) = used_field else { let Some(used_field) = used_field else {
if cfg!(debug_assertions) { // FIXME: This can be reached if the field access uses autoderef.
panic!("Struct doesn't contain the correct field"); // `dec.all_fields()` should be replaced by something that uses autoderef.
} else {
// Don't ICE when possible
return; return;
}
}; };
let Some(correct_field) = correct_field else { let Some(correct_field) = correct_field else {
return; return;
}; };