Remove an unnecessary kw::Empty
check.
Replace it with an assert for now, just in case it is reachable.
This commit is contained in:
parent
763db5dcd9
commit
fe04460f6f
1 changed files with 8 additions and 9 deletions
|
@ -825,15 +825,14 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
|
||||
let trait_missing_method =
|
||||
matches!(error, method::MethodError::NoMatch(_)) && ty.normalized.is_trait();
|
||||
if item_name.name != kw::Empty {
|
||||
self.report_method_error(
|
||||
hir_id,
|
||||
ty.normalized,
|
||||
error,
|
||||
Expectation::NoExpectation,
|
||||
trait_missing_method && span.edition().at_least_rust_2021(), // emits missing method for trait only after edition 2021
|
||||
);
|
||||
}
|
||||
assert_ne!(item_name.name, kw::Empty);
|
||||
self.report_method_error(
|
||||
hir_id,
|
||||
ty.normalized,
|
||||
error,
|
||||
Expectation::NoExpectation,
|
||||
trait_missing_method && span.edition().at_least_rust_2021(), // emits missing method for trait only after edition 2021
|
||||
);
|
||||
|
||||
result
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue