We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d2322b2 commit cb8bde3Copy full SHA for cb8bde3
compiler/rustc_typeck/src/collect.rs
@@ -1624,7 +1624,7 @@ fn generics_of(tcx: TyCtxt<'_>, def_id: DefId) -> ty::Generics {
1624
};
1625
1626
let has_self = opt_self.is_some();
1627
- let has_constness = tcx.has_attr(def_id, sym::const_trait);
+ 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);
1628
let mut parent_has_self = false;
1629
let mut parent_has_constness = false;
1630
let mut own_start = has_self as u32;
0 commit comments