Skip to content

Commit 2c67d33

Browse files
committed
Oops: use the correct DefId
1 parent 09f3985 commit 2c67d33

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

frontend/exporter/src/constant_utils.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ pub trait ConstantExt<'tcx>: Sized + std::fmt::Debug {
384384
trait_refs: vec![],
385385
}
386386
};
387-
let ty = s.base().tcx.type_of(s.owner_id());
387+
let ty = s.base().tcx.type_of(ucv.def);
388388
let cv = kind.decorate(ty.sinto(s), span.sinto(s));
389389
TranslateUnevalRes::GlobalName(cv)
390390
}
@@ -414,10 +414,9 @@ impl<'tcx, S: UnderOwnerState<'tcx>> SInto<S, ConstantExpr> for ty::Const<'tcx>
414414
let span = self.default_span(s.base().tcx);
415415
match self.kind() {
416416
ty::ConstKind::Param(p) => {
417-
let kind = ConstantExprKind::ConstRef { id: p.sinto(s) };
418-
let tcx = s.base().tcx;
419-
let param_env = tcx.param_env(s.owner_id());
417+
let param_env = s.base().tcx.param_env(s.owner_id());
420418
let ty = p.find_ty_from_env(param_env);
419+
let kind = ConstantExprKind::ConstRef { id: p.sinto(s) };
421420
kind.decorate(ty.sinto(s), span.sinto(s))
422421
}
423422
ty::ConstKind::Infer(..) => fatal!(s[span], "ty::ConstKind::Infer node? {:#?}", self),

0 commit comments

Comments
 (0)