Skip to content

Commit 0c73b41

Browse files
remove TypeWellFormedFromEnv
1 parent c6fcbaa commit 0c73b41

File tree

23 files changed

+18
-73
lines changed

23 files changed

+18
-73
lines changed

compiler/rustc_hir_analysis/src/astconv/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -983,8 +983,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
983983
ty::ClauseKind::RegionOutlives(_)
984984
| ty::ClauseKind::ConstArgHasType(..)
985985
| ty::ClauseKind::WellFormed(_)
986-
| ty::ClauseKind::ConstEvaluatable(_)
987-
| ty::ClauseKind::TypeWellFormedFromEnv(_) => {
986+
| ty::ClauseKind::ConstEvaluatable(_) => {
988987
bug!()
989988
}
990989
}

compiler/rustc_hir_analysis/src/impl_wf_check/min_specialization.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,6 @@ fn trait_predicate_kind<'tcx>(
551551
| ty::PredicateKind::ClosureKind(..)
552552
| ty::PredicateKind::Clause(ty::ClauseKind::ConstEvaluatable(..))
553553
| ty::PredicateKind::ConstEquate(..)
554-
| ty::PredicateKind::Ambiguous
555-
| ty::PredicateKind::Clause(ty::ClauseKind::TypeWellFormedFromEnv(..)) => None,
554+
| ty::PredicateKind::Ambiguous => None,
556555
}
557556
}

compiler/rustc_hir_analysis/src/outlives/explicit.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@ impl<'tcx> ExplicitPredicatesMap<'tcx> {
5353
| ty::ClauseKind::Projection(_)
5454
| ty::ClauseKind::ConstArgHasType(_, _)
5555
| ty::ClauseKind::WellFormed(_)
56-
| ty::ClauseKind::ConstEvaluatable(_)
57-
| ty::ClauseKind::TypeWellFormedFromEnv(_) => {}
56+
| ty::ClauseKind::ConstEvaluatable(_) => {}
5857
}
5958
}
6059

compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
685685
// inference variable.
686686
| ty::PredicateKind::ClosureKind(..)
687687
| ty::PredicateKind::Ambiguous
688-
| ty::PredicateKind::Clause(ty::ClauseKind::TypeWellFormedFromEnv(..)) => None,
688+
=> None,
689689
},
690690
)
691691
}

compiler/rustc_hir_typeck/src/method/probe.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -847,8 +847,7 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
847847
| ty::ClauseKind::Projection(_)
848848
| ty::ClauseKind::ConstArgHasType(_, _)
849849
| ty::ClauseKind::WellFormed(_)
850-
| ty::ClauseKind::ConstEvaluatable(_)
851-
| ty::ClauseKind::TypeWellFormedFromEnv(_) => None,
850+
| ty::ClauseKind::ConstEvaluatable(_) => None,
852851
}
853852
});
854853

compiler/rustc_infer/src/infer/outlives/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ pub fn explicit_outlives_bounds<'tcx>(
3131
| ty::ClauseKind::Projection(_)
3232
| ty::ClauseKind::ConstArgHasType(_, _)
3333
| ty::ClauseKind::WellFormed(_)
34-
| ty::ClauseKind::ConstEvaluatable(_)
35-
| ty::ClauseKind::TypeWellFormedFromEnv(_) => None,
34+
| ty::ClauseKind::ConstEvaluatable(_) => None,
3635
})
3736
}
3837

compiler/rustc_infer/src/traits/util.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -370,9 +370,6 @@ impl<'tcx, O: Elaboratable<'tcx>> Elaborator<'tcx, O> {
370370
}),
371371
);
372372
}
373-
ty::PredicateKind::Clause(ty::ClauseKind::TypeWellFormedFromEnv(..)) => {
374-
// Nothing to elaborate
375-
}
376373
ty::PredicateKind::Ambiguous => {}
377374
ty::PredicateKind::AliasRelate(..) => {
378375
// No

compiler/rustc_lint/src/builtin.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1606,8 +1606,7 @@ impl<'tcx> LateLintPass<'tcx> for TrivialConstraints {
16061606
// Ignore bounds that a user can't type
16071607
| ClauseKind::WellFormed(..)
16081608
// FIXME(generic_const_exprs): `ConstEvaluatable` can be written
1609-
| ClauseKind::ConstEvaluatable(..)
1610-
| ClauseKind::TypeWellFormedFromEnv(_) => continue,
1609+
| ClauseKind::ConstEvaluatable(..) => continue,
16111610
};
16121611
if predicate.is_global() {
16131612
cx.emit_spanned_lint(

compiler/rustc_middle/src/ty/flags.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,6 @@ impl FlagComputation {
287287
self.add_const(expected);
288288
self.add_const(found);
289289
}
290-
ty::PredicateKind::Clause(ty::ClauseKind::TypeWellFormedFromEnv(ty)) => {
291-
self.add_ty(ty);
292-
}
293290
ty::PredicateKind::Ambiguous => {}
294291
ty::PredicateKind::AliasRelate(t1, t2, _) => {
295292
self.add_term(t1);

compiler/rustc_middle/src/ty/mod.rs

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -554,8 +554,7 @@ impl<'tcx> Predicate<'tcx> {
554554
| PredicateKind::Coerce(_)
555555
| PredicateKind::Clause(ClauseKind::ConstEvaluatable(_))
556556
| PredicateKind::ConstEquate(_, _)
557-
| PredicateKind::Ambiguous
558-
| PredicateKind::Clause(ClauseKind::TypeWellFormedFromEnv(_)) => true,
557+
| PredicateKind::Ambiguous => true,
559558
}
560559
}
561560
}
@@ -661,11 +660,6 @@ pub enum ClauseKind<'tcx> {
661660

662661
/// Constant initializer must evaluate successfully.
663662
ConstEvaluatable(ty::Const<'tcx>),
664-
665-
/// Represents a type found in the environment that we can use for implied bounds.
666-
///
667-
/// Only used for Chalk.
668-
TypeWellFormedFromEnv(Ty<'tcx>),
669663
}
670664

671665
#[derive(Clone, Copy, PartialEq, Eq, Hash, TyEncodable, TyDecodable)]
@@ -1424,8 +1418,7 @@ impl<'tcx> Predicate<'tcx> {
14241418
| PredicateKind::Clause(ClauseKind::TypeOutlives(..))
14251419
| PredicateKind::Clause(ClauseKind::ConstEvaluatable(..))
14261420
| PredicateKind::ConstEquate(..)
1427-
| PredicateKind::Ambiguous
1428-
| PredicateKind::Clause(ClauseKind::TypeWellFormedFromEnv(..)) => None,
1421+
| PredicateKind::Ambiguous => None,
14291422
}
14301423
}
14311424

@@ -1445,8 +1438,7 @@ impl<'tcx> Predicate<'tcx> {
14451438
| PredicateKind::Clause(ClauseKind::TypeOutlives(..))
14461439
| PredicateKind::Clause(ClauseKind::ConstEvaluatable(..))
14471440
| PredicateKind::ConstEquate(..)
1448-
| PredicateKind::Ambiguous
1449-
| PredicateKind::Clause(ClauseKind::TypeWellFormedFromEnv(..)) => None,
1441+
| PredicateKind::Ambiguous => None,
14501442
}
14511443
}
14521444

@@ -1466,8 +1458,7 @@ impl<'tcx> Predicate<'tcx> {
14661458
| PredicateKind::ClosureKind(..)
14671459
| PredicateKind::Clause(ClauseKind::ConstEvaluatable(..))
14681460
| PredicateKind::ConstEquate(..)
1469-
| PredicateKind::Ambiguous
1470-
| PredicateKind::Clause(ClauseKind::TypeWellFormedFromEnv(..)) => None,
1461+
| PredicateKind::Ambiguous => None,
14711462
}
14721463
}
14731464

0 commit comments

Comments
 (0)