Move missing_item check inside condition
This commit is contained in:
parent
58a90de9ad
commit
9988821a04
1 changed files with 5 additions and 5 deletions
|
@ -1043,9 +1043,9 @@ pub(super) fn check_impl_items_against_trait<'tcx>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let Ok(ancestors) = trait_def.ancestors(tcx, impl_id.to_def_id()) {
|
||||||
// Check for missing items from trait
|
// Check for missing items from trait
|
||||||
let mut missing_items = Vec::new();
|
let mut missing_items = Vec::new();
|
||||||
if let Ok(ancestors) = trait_def.ancestors(tcx, impl_id.to_def_id()) {
|
|
||||||
for trait_item in tcx.associated_items(impl_trait_ref.def_id).in_definition_order() {
|
for trait_item in tcx.associated_items(impl_trait_ref.def_id).in_definition_order() {
|
||||||
let is_implemented = ancestors
|
let is_implemented = ancestors
|
||||||
.leaf_def(tcx, trait_item.ident, trait_item.kind)
|
.leaf_def(tcx, trait_item.ident, trait_item.kind)
|
||||||
|
@ -1058,12 +1058,12 @@ pub(super) fn check_impl_items_against_trait<'tcx>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if !missing_items.is_empty() {
|
if !missing_items.is_empty() {
|
||||||
missing_items_err(tcx, impl_span, &missing_items, full_impl_span);
|
missing_items_err(tcx, impl_span, &missing_items, full_impl_span);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Checks whether a type can be represented in memory. In particular, it
|
/// Checks whether a type can be represented in memory. In particular, it
|
||||||
/// identifies types that contain themselves without indirection through a
|
/// identifies types that contain themselves without indirection through a
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue