Skip to content

Commit e992ede

Browse files
Remove lift_to_global
1 parent 1a6cab9 commit e992ede

File tree

6 files changed

+5
-10
lines changed

6 files changed

+5
-10
lines changed

src/librustc/mir/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1504,7 +1504,7 @@ impl<'tcx> TerminatorKind<'tcx> {
15041504
Goto { .. } => vec!["".into()],
15051505
SwitchInt { ref values, switch_ty, .. } => ty::tls::with(|tcx| {
15061506
let param_env = ty::ParamEnv::empty();
1507-
let switch_ty = tcx.lift_to_global(&switch_ty).unwrap();
1507+
let switch_ty = tcx.lift(&switch_ty).unwrap();
15081508
let size = tcx.layout_of(param_env.and(switch_ty)).unwrap().size;
15091509
values
15101510
.iter()

src/librustc/ty/context.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,11 +1148,6 @@ impl<'tcx> TyCtxt<'tcx> {
11481148
value.lift_to_tcx(self)
11491149
}
11501150

1151-
/// Like lift, but only tries in the global tcx.
1152-
pub fn lift_to_global<T: ?Sized + Lift<'tcx>>(self, value: &T) -> Option<T::Lifted> {
1153-
value.lift_to_tcx(self)
1154-
}
1155-
11561151
/// Creates a type context and call the closure with a `TyCtxt` reference
11571152
/// to the context. The closure enforces that the type context and any interned
11581153
/// value (types, substs, etc.) can only be used while `ty::tls` has a valid

src/librustc/ty/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ impl<'tcx> ty::TyS<'tcx> {
193193
ty::Adt(def, _) => format!("{} `{}`", def.descr(), tcx.def_path_str(def.did)).into(),
194194
ty::Foreign(def_id) => format!("extern type `{}`", tcx.def_path_str(def_id)).into(),
195195
ty::Array(_, n) => {
196-
let n = tcx.lift_to_global(&n).unwrap();
196+
let n = tcx.lift(&n).unwrap();
197197
match n.try_eval_usize(tcx, ty::ParamEnv::empty()) {
198198
Some(n) => {
199199
format!("array of {} element{}", n, pluralise!(n)).into()

src/librustc/ty/print/pretty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,7 @@ pub trait PrettyPrinter<'tcx>:
917917
let min = 1u128 << (bit_size - 1);
918918
let max = min - 1;
919919

920-
let ty = self.tcx().lift_to_global(&ct.ty).unwrap();
920+
let ty = self.tcx().lift(&ct.ty).unwrap();
921921
let size = self.tcx().layout_of(ty::ParamEnv::empty().and(ty))
922922
.unwrap()
923923
.size;

src/librustc_mir/borrow_check/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ impl<'cx, 'tcx> DataflowResultsConsumer<'cx, 'tcx> for MirBorrowckCtxt<'cx, 'tcx
632632
// "Lift" into the tcx -- once regions are erased, this type should be in the
633633
// global arenas; this "lift" operation basically just asserts that is true, but
634634
// that is useful later.
635-
tcx.lift_to_global(&drop_place_ty).unwrap();
635+
tcx.lift(&drop_place_ty).unwrap();
636636

637637
debug!("visit_terminator_drop \
638638
loc: {:?} term: {:?} drop_place: {:?} drop_place_ty: {:?} span: {:?}",

src/librustc_traits/chalk_context/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ impl context::UnificationOps<ChalkArenas<'tcx>, ChalkArenas<'tcx>>
474474
&self,
475475
value: DelayedLiteral<ChalkArenas<'tcx>>,
476476
) -> DelayedLiteral<ChalkArenas<'tcx>> {
477-
match self.infcx.tcx.lift_to_global(&value) {
477+
match self.infcx.tcx.lift(&value) {
478478
Some(literal) => literal,
479479
None => bug!("cannot lift {:?}", value),
480480
}

0 commit comments

Comments
 (0)