Skip to content

Commit abe2a68

Browse files
committed
Remove more unused Lift impls.
1 parent af7d3e5 commit abe2a68

File tree

12 files changed

+37
-128
lines changed

12 files changed

+37
-128
lines changed

compiler/rustc_infer/src/infer/free_regions.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//! and use that to decide when one free region outlives another, and so forth.
55
66
use rustc_data_structures::transitive_relation::TransitiveRelation;
7-
use rustc_middle::ty::{Lift, Region, TyCtxt};
7+
use rustc_middle::ty::{Region, TyCtxt};
88

99
/// Combines a `FreeRegionMap` and a `TyCtxt`.
1010
///
@@ -101,10 +101,3 @@ impl<'tcx> FreeRegionMap<'tcx> {
101101
result
102102
}
103103
}
104-
105-
impl<'a, 'tcx> Lift<'tcx> for FreeRegionMap<'a> {
106-
type Lifted = FreeRegionMap<'tcx>;
107-
fn lift_to_tcx(self, tcx: TyCtxt<'tcx>) -> Option<FreeRegionMap<'tcx>> {
108-
self.relation.maybe_map(|fr| tcx.lift(fr)).map(|relation| FreeRegionMap { relation })
109-
}
110-
}

compiler/rustc_middle/src/infer/canonical.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ impl<'tcx, V> Canonical<'tcx, V> {
432432
pub type QueryOutlivesConstraint<'tcx> =
433433
(ty::OutlivesPredicate<GenericArg<'tcx>, Region<'tcx>>, ConstraintCategory<'tcx>);
434434

435-
TrivialTypeTraversalAndLiftImpls! {
435+
TrivialTypeTraversalImpls! {
436436
crate::infer::canonical::Certainty,
437437
crate::infer::canonical::CanonicalTyVarKind,
438438
}

compiler/rustc_middle/src/mir/basic_blocks.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ impl<'tcx> graph::WithPredecessors for BasicBlocks<'tcx> {
178178
}
179179
}
180180

181-
TrivialTypeTraversalAndLiftImpls! { Cache }
181+
TrivialTypeTraversalImpls! { Cache }
182182

183183
impl<S: Encoder> Encodable<S> for Cache {
184184
#[inline]

compiler/rustc_middle/src/mir/interpret/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ impl Into<ErrorGuaranteed> for ReportedErrorInfo {
6767
}
6868
}
6969

70-
TrivialTypeTraversalAndLiftImpls! { ErrorHandled }
70+
TrivialTypeTraversalImpls! { ErrorHandled }
7171

7272
pub type EvalToAllocationRawResult<'tcx> = Result<ConstAlloc<'tcx>, ErrorHandled>;
7373
pub type EvalToConstValueResult<'tcx> = Result<ConstValue<'tcx>, ErrorHandled>;

compiler/rustc_middle/src/mir/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@ pub enum BindingForm<'tcx> {
744744
RefForGuard,
745745
}
746746

747-
TrivialTypeTraversalAndLiftImpls! { BindingForm<'tcx> }
747+
TrivialTypeTraversalImpls! { BindingForm<'tcx> }
748748

749749
mod binding_form_impl {
750750
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};

compiler/rustc_middle/src/mir/type_foldable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use rustc_ast::InlineAsmTemplatePiece;
55
use super::*;
66
use crate::ty;
77

8-
TrivialTypeTraversalAndLiftImpls! {
8+
TrivialTypeTraversalImpls! {
99
BlockTailInfo,
1010
MirPhase,
1111
SourceInfo,

compiler/rustc_middle/src/traits/mod.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use crate::infer::canonical::Canonical;
1313
use crate::mir::ConstraintCategory;
1414
use crate::ty::abstract_const::NotConstEvaluatable;
1515
use crate::ty::GenericArgsRef;
16-
use crate::ty::{self, AdtKind, Ty, TyCtxt};
16+
use crate::ty::{self, AdtKind, Ty};
1717

1818
use rustc_data_structures::sync::Lrc;
1919
use rustc_errors::{Applicability, Diagnostic};
@@ -524,13 +524,6 @@ pub enum StatementAsExpression {
524524
NeedsBoxing,
525525
}
526526

527-
impl<'tcx> ty::Lift<'tcx> for StatementAsExpression {
528-
type Lifted = StatementAsExpression;
529-
fn lift_to_tcx(self, _tcx: TyCtxt<'tcx>) -> Option<StatementAsExpression> {
530-
Some(self)
531-
}
532-
}
533-
534527
#[derive(Clone, Debug, PartialEq, Eq, HashStable, TyEncodable, TyDecodable)]
535528
#[derive(TypeVisitable, TypeFoldable)]
536529
pub struct MatchExpressionArmCause<'tcx> {
@@ -736,7 +729,7 @@ pub enum BuiltinImplSource {
736729
TupleUnsizing,
737730
}
738731

739-
TrivialTypeTraversalAndLiftImpls! { BuiltinImplSource }
732+
TrivialTypeTraversalImpls! { BuiltinImplSource }
740733

741734
#[derive(Clone, Debug, PartialEq, Eq, Hash, HashStable, PartialOrd, Ord)]
742735
pub enum ObjectSafetyViolation {

compiler/rustc_middle/src/traits/select.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ impl From<ErrorGuaranteed> for OverflowError {
305305
}
306306
}
307307

308-
TrivialTypeTraversalAndLiftImpls! { OverflowError }
308+
TrivialTypeTraversalImpls! { OverflowError }
309309

310310
impl<'tcx> From<OverflowError> for SelectionError<'tcx> {
311311
fn from(overflow_error: OverflowError) -> SelectionError<'tcx> {

compiler/rustc_middle/src/ty/abstract_const.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ impl From<ErrorGuaranteed> for NotConstEvaluatable {
2727
}
2828
}
2929

30-
TrivialTypeTraversalAndLiftImpls! { NotConstEvaluatable }
30+
TrivialTypeTraversalImpls! { NotConstEvaluatable }
3131

3232
pub type BoundAbstractConst<'tcx> = Result<Option<EarlyBinder<ty::Const<'tcx>>>, ErrorGuaranteed>;
3333

compiler/rustc_middle/src/ty/binding.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ pub enum BindingMode {
66
BindByValue(Mutability),
77
}
88

9-
TrivialTypeTraversalAndLiftImpls! { BindingMode }
9+
TrivialTypeTraversalImpls! { BindingMode }
1010

1111
impl BindingMode {
1212
pub fn convert(BindingAnnotation(by_ref, mutbl): BindingAnnotation) -> BindingMode {

0 commit comments

Comments
 (0)