about summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-03-10 19:59:21 +0100
committerGitHub <noreply@github.com>2023-03-10 19:59:21 +0100
commitf74bb35dad1474cdc8bef411ab95cb04fb6a7bdd (patch)
tree0e941feb957caa0bef21566b92e8df9ba717074c /compiler/rustc_codegen_ssa/src
parent42ca383278b81d5e6ced2ada924302a538776375 (diff)
parentad2bcb5c0e7603092011b6a5ca6328ae6c3fa2c0 (diff)
downloadrust-f74bb35dad1474cdc8bef411ab95cb04fb6a7bdd.tar.gz
rust-f74bb35dad1474cdc8bef411ab95cb04fb6a7bdd.zip
Rollup merge of #108983 - LeSeulArtichaut:108646-target-feature-default-impl, r=cjgillot
Forbid `#[target_feature]` on safe default implementations

Fixes #108646.
Diffstat (limited to 'compiler/rustc_codegen_ssa/src')
-rw-r--r--compiler/rustc_codegen_ssa/src/target_features.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_ssa/src/target_features.rs b/compiler/rustc_codegen_ssa/src/target_features.rs
index 576e90ae66b..679dc0866f2 100644
--- a/compiler/rustc_codegen_ssa/src/target_features.rs
+++ b/compiler/rustc_codegen_ssa/src/target_features.rs
@@ -442,7 +442,7 @@ fn asm_target_features(tcx: TyCtxt<'_>, did: DefId) -> &FxIndexSet<Symbol> {
 pub fn check_target_feature_trait_unsafe(tcx: TyCtxt<'_>, id: LocalDefId, attr_span: Span) {
     if let DefKind::AssocFn = tcx.def_kind(id) {
         let parent_id = tcx.local_parent(id);
-        if let DefKind::Impl { of_trait: true } = tcx.def_kind(parent_id) {
+        if let DefKind::Trait | DefKind::Impl { of_trait: true } = tcx.def_kind(parent_id) {
             tcx.sess
                 .struct_span_err(
                     attr_span,