Applied suggestions
This commit is contained in:
parent
2db927d8d8
commit
3660a4e972
2 changed files with 12 additions and 16 deletions
|
@ -93,17 +93,12 @@ impl<'tcx> hir::itemlikevisit::ItemLikeVisitor<'tcx> for CheckConstTraitVisitor<
|
|||
kind: ty::AssocKind::Fn, ident, defaultness, ..
|
||||
} = self.tcx.associated_item(*did)
|
||||
{
|
||||
match (
|
||||
self.tcx.has_attr(*did, sym::default_method_body_is_const),
|
||||
defaultness.has_value(),
|
||||
) {
|
||||
(false, true) => {
|
||||
to_implement.insert(ident);
|
||||
}
|
||||
// ignore functions that do not have default bodies
|
||||
// if those are unimplemented it will be catched by
|
||||
// typeck.
|
||||
_ => {}
|
||||
// we can ignore functions that do not have default bodies:
|
||||
// if those are unimplemented it will be catched by typeck.
|
||||
if defaultness.has_value()
|
||||
&& !self.tcx.has_attr(*did, sym::default_method_body_is_const)
|
||||
{
|
||||
to_implement.insert(ident);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue