We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
fn_sig
1 parent fc3bcf1 commit 47b6426Copy full SHA for 47b6426
compiler/rustc_codegen_ssa/src/codegen_attrs.rs
@@ -68,7 +68,7 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: DefId) -> CodegenFnAttrs {
68
// report a delayed bug, just in case `check_attr` isn't doing its job.
69
let validate_fn_only_attr = |attr_sp| -> bool {
70
let def_kind = tcx.def_kind(did);
71
- if let DefKind::Fn | DefKind::AssocFn = def_kind {
+ if let DefKind::Fn | DefKind::AssocFn | DefKind::Variant | DefKind::Ctor(..) = def_kind {
72
true
73
} else {
74
tcx.sess.delay_span_bug(attr_sp, "this attribute can only be applied to functions");
0 commit comments