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.
2 parents a0bcff0 + 3cf4a67 commit ed3966fCopy full SHA for ed3966f
frontend/exporter/src/constant_utils/uneval.rs
@@ -111,8 +111,8 @@ pub fn translate_constant_reference<'tcx>(
111
.try_normalize_erasing_regions(typing_env, ty)
112
.unwrap_or(ty);
113
let kind = if let Some(assoc) = s.base().tcx.opt_associated_item(ucv.def) {
114
- if assoc.trait_item_def_id.is_some() {
115
- // This must be a trait declaration constant
+ if assoc.trait_item_def_id.is_some() || assoc.container == ty::AssocItemContainer::Trait {
+ // This is an associated constant in a trait.
116
let name = assoc.name.to_string();
117
let impl_expr = self_clause_for_item(s, ucv.def, ucv.args).unwrap();
118
ConstantExprKind::TraitConst { impl_expr, name }
0 commit comments