summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa/src
diff options
context:
space:
mode:
authorinquisitivecrystal <22333129+inquisitivecrystal@users.noreply.github.com>2022-12-15 23:32:52 -0800
committerinquisitivecrystal <22333129+inquisitivecrystal@users.noreply.github.com>2022-12-15 23:55:42 -0800
commit47b642677715caa8e5699ecb397e34125f3256e8 (patch)
tree6da0362197df0afd46c64b6fdbd2120e51b8deaa /compiler/rustc_codegen_ssa/src
parentfc3bcf17702d21525f17b741553a8f9a545e1801 (diff)
downloadrust-47b642677715caa8e5699ecb397e34125f3256e8.tar.gz
rust-47b642677715caa8e5699ecb397e34125f3256e8.zip
Check `fn_sig` in more situations per review
Diffstat (limited to 'compiler/rustc_codegen_ssa/src')
-rw-r--r--compiler/rustc_codegen_ssa/src/codegen_attrs.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_ssa/src/codegen_attrs.rs b/compiler/rustc_codegen_ssa/src/codegen_attrs.rs
index f5af9b2026c..b0fa7745667 100644
--- a/compiler/rustc_codegen_ssa/src/codegen_attrs.rs
+++ b/compiler/rustc_codegen_ssa/src/codegen_attrs.rs
@@ -68,7 +68,7 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: DefId) -> CodegenFnAttrs {
     // report a delayed bug, just in case `check_attr` isn't doing its job.
     let validate_fn_only_attr = |attr_sp| -> bool {
         let def_kind = tcx.def_kind(did);
-        if let DefKind::Fn | DefKind::AssocFn = def_kind {
+        if let DefKind::Fn | DefKind::AssocFn | DefKind::Variant | DefKind::Ctor(..) = def_kind {
             true
         } else {
             tcx.sess.delay_span_bug(attr_sp, "this attribute can only be applied to functions");