Skip to content

Commit 826f29d

Browse files
oli-obkfee1-dead
authored andcommitted
Only add constness arg for const_trait traits
1 parent 17339ca commit 826f29d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/rustc_typeck/src/collect.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1759,7 +1759,7 @@ fn generics_of(tcx: TyCtxt<'_>, def_id: DefId) -> ty::Generics {
17591759
}
17601760
}
17611761

1762-
if has_self || parent_has_self {
1762+
if (has_self || parent_has_self) && tcx.has_attr(def_id, sym::const_trait) {
17631763
params.push(ty::GenericParamDef {
17641764
name: Symbol::intern("<constness>"),
17651765
index: type_start + i as u32,

0 commit comments

Comments
 (0)