Skip to content

Commit cb8bde3

Browse files
committed
const impls have constness
1 parent d2322b2 commit cb8bde3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/rustc_typeck/src/collect.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1624,7 +1624,7 @@ fn generics_of(tcx: TyCtxt<'_>, def_id: DefId) -> ty::Generics {
16241624
};
16251625

16261626
let has_self = opt_self.is_some();
1627-
let has_constness = tcx.has_attr(def_id, sym::const_trait);
1627+
let has_constness = tcx.has_attr(def_id, sym::const_trait) || (tcx.def_kind(def_id) == DefKind::Impl && tcx.impl_constness(def_id) == hir::Constness::Const);
16281628
let mut parent_has_self = false;
16291629
let mut parent_has_constness = false;
16301630
let mut own_start = has_self as u32;

0 commit comments

Comments
 (0)