diff options
| author | Jack Huey <31162821+jackh726@users.noreply.github.com> | 2022-05-08 15:12:56 -0400 |
|---|---|---|
| committer | Jack Huey <31162821+jackh726@users.noreply.github.com> | 2022-05-13 18:27:18 -0400 |
| commit | c92248ab9f2045c5a85700b59176bc850caaa3ef (patch) | |
| tree | 13b6f51702152182d42c42fcab77a2ca7273f7f0 /compiler/rustc_const_eval/src/interpret | |
| parent | 319575ae8c3f6ea5db1c850c8f4c786c8cc203fe (diff) | |
| download | rust-c92248ab9f2045c5a85700b59176bc850caaa3ef.tar.gz rust-c92248ab9f2045c5a85700b59176bc850caaa3ef.zip | |
Add bound_type_of
Diffstat (limited to 'compiler/rustc_const_eval/src/interpret')
| -rw-r--r-- | compiler/rustc_const_eval/src/interpret/intrinsics/caller_location.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/intrinsics/caller_location.rs b/compiler/rustc_const_eval/src/interpret/intrinsics/caller_location.rs index 43133b03ad1..5ece19d7fb3 100644 --- a/compiler/rustc_const_eval/src/interpret/intrinsics/caller_location.rs +++ b/compiler/rustc_const_eval/src/interpret/intrinsics/caller_location.rs @@ -5,7 +5,6 @@ use rustc_hir::lang_items::LangItem; use rustc_middle::mir::TerminatorKind; use rustc_middle::ty::layout::LayoutOf; use rustc_middle::ty::subst::Subst; -use rustc_middle::ty::EarlyBinder; use rustc_span::{Span, Symbol}; use crate::interpret::{ @@ -94,10 +93,10 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { let col = if loc_details.column { Scalar::from_u32(col) } else { Scalar::from_u32(0) }; // Allocate memory for `CallerLocation` struct. - let loc_ty = EarlyBinder( - self.tcx.type_of(self.tcx.require_lang_item(LangItem::PanicLocation, None)), - ) - .subst(*self.tcx, self.tcx.mk_substs([self.tcx.lifetimes.re_erased.into()].iter())); + let loc_ty = self + .tcx + .bound_type_of(self.tcx.require_lang_item(LangItem::PanicLocation, None)) + .subst(*self.tcx, self.tcx.mk_substs([self.tcx.lifetimes.re_erased.into()].iter())); let loc_layout = self.layout_of(loc_ty).unwrap(); // This can fail if rustc runs out of memory right here. Trying to emit an error would be // pointless, since that would require allocating more memory than a Location. |
