Applied suggestions
This commit is contained in:
parent
2db927d8d8
commit
3660a4e972
2 changed files with 12 additions and 16 deletions
|
@ -349,6 +349,12 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
|
||||||
),
|
),
|
||||||
|
|
||||||
gated!(cmse_nonsecure_entry, AssumedUsed, template!(Word), experimental!(cmse_nonsecure_entry)),
|
gated!(cmse_nonsecure_entry, AssumedUsed, template!(Word), experimental!(cmse_nonsecure_entry)),
|
||||||
|
// RFC 2632
|
||||||
|
gated!(
|
||||||
|
default_method_body_is_const, AssumedUsed, template!(Word), const_trait_impl,
|
||||||
|
"`default_method_body_is_const` is a temporary placeholder for declaring default bodies \
|
||||||
|
as `const`, which may be removed or renamed in the future."
|
||||||
|
),
|
||||||
|
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
// Internal attributes: Stability, deprecation, and unsafe:
|
// Internal attributes: Stability, deprecation, and unsafe:
|
||||||
|
@ -470,11 +476,6 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
|
||||||
|
|
||||||
rustc_attr!(rustc_promotable, AssumedUsed, template!(Word), IMPL_DETAIL),
|
rustc_attr!(rustc_promotable, AssumedUsed, template!(Word), IMPL_DETAIL),
|
||||||
rustc_attr!(rustc_legacy_const_generics, AssumedUsed, template!(List: "N"), INTERNAL_UNSTABLE),
|
rustc_attr!(rustc_legacy_const_generics, AssumedUsed, template!(List: "N"), INTERNAL_UNSTABLE),
|
||||||
gated!(
|
|
||||||
default_method_body_is_const, AssumedUsed, template!(Word), const_trait_impl,
|
|
||||||
"the `#[default_method_body_is_const]` attribute marks a default method of a trait \
|
|
||||||
as const, so it does not need to be duplicated by a const impl."
|
|
||||||
),
|
|
||||||
|
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
// Internal attributes, Layout related:
|
// Internal attributes, Layout related:
|
||||||
|
|
|
@ -93,17 +93,12 @@ impl<'tcx> hir::itemlikevisit::ItemLikeVisitor<'tcx> for CheckConstTraitVisitor<
|
||||||
kind: ty::AssocKind::Fn, ident, defaultness, ..
|
kind: ty::AssocKind::Fn, ident, defaultness, ..
|
||||||
} = self.tcx.associated_item(*did)
|
} = self.tcx.associated_item(*did)
|
||||||
{
|
{
|
||||||
match (
|
// we can ignore functions that do not have default bodies:
|
||||||
self.tcx.has_attr(*did, sym::default_method_body_is_const),
|
// if those are unimplemented it will be catched by typeck.
|
||||||
defaultness.has_value(),
|
if defaultness.has_value()
|
||||||
) {
|
&& !self.tcx.has_attr(*did, sym::default_method_body_is_const)
|
||||||
(false, true) => {
|
{
|
||||||
to_implement.insert(ident);
|
to_implement.insert(ident);
|
||||||
}
|
|
||||||
// ignore functions that do not have default bodies
|
|
||||||
// if those are unimplemented it will be catched by
|
|
||||||
// typeck.
|
|
||||||
_ => {}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue