Skip to content

Commit 47b6426

Browse files
Check fn_sig in more situations per review
1 parent fc3bcf1 commit 47b6426

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/rustc_codegen_ssa/src/codegen_attrs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: DefId) -> CodegenFnAttrs {
6868
// report a delayed bug, just in case `check_attr` isn't doing its job.
6969
let validate_fn_only_attr = |attr_sp| -> bool {
7070
let def_kind = tcx.def_kind(did);
71-
if let DefKind::Fn | DefKind::AssocFn = def_kind {
71+
if let DefKind::Fn | DefKind::AssocFn | DefKind::Variant | DefKind::Ctor(..) = def_kind {
7272
true
7373
} else {
7474
tcx.sess.delay_span_bug(attr_sp, "this attribute can only be applied to functions");

0 commit comments

Comments
 (0)