Skip to content

Commit 337177a

Browse files
Remove ClosureKind predicate kind
1 parent 8534923 commit 337177a

File tree

25 files changed

+81
-198
lines changed

25 files changed

+81
-198
lines changed

compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
662662
// this closure yet; this is exactly why the other
663663
// code is looking for a self type of an unresolved
664664
// inference variable.
665-
| ty::PredicateKind::ClosureKind(..)
666665
| ty::PredicateKind::Ambiguous
667666
=> None,
668667
},

compiler/rustc_infer/src/traits/util.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -308,9 +308,6 @@ impl<'tcx, O: Elaboratable<'tcx>> Elaborator<'tcx, O> {
308308
ty::PredicateKind::Clause(ty::ClauseKind::Projection(..)) => {
309309
// Nothing to elaborate in a projection predicate.
310310
}
311-
ty::PredicateKind::ClosureKind(..) => {
312-
// Nothing to elaborate when waiting for a closure's kind to be inferred.
313-
}
314311
ty::PredicateKind::Clause(ty::ClauseKind::ConstEvaluatable(..)) => {
315312
// Currently, we do not elaborate const-evaluatable
316313
// predicates.

compiler/rustc_middle/src/ty/flags.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,9 +263,6 @@ impl FlagComputation {
263263
self.add_args(slice::from_ref(&arg));
264264
}
265265
ty::PredicateKind::ObjectSafe(_def_id) => {}
266-
ty::PredicateKind::ClosureKind(_def_id, args, _kind) => {
267-
self.add_args(args);
268-
}
269266
ty::PredicateKind::Clause(ty::ClauseKind::ConstEvaluatable(uv)) => {
270267
self.add_const(uv);
271268
}

compiler/rustc_middle/src/ty/mod.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,6 @@ impl<'tcx> Predicate<'tcx> {
550550
| PredicateKind::Clause(ClauseKind::ConstArgHasType(..))
551551
| PredicateKind::AliasRelate(..)
552552
| PredicateKind::ObjectSafe(_)
553-
| PredicateKind::ClosureKind(_, _, _)
554553
| PredicateKind::Subtype(_)
555554
| PredicateKind::Coerce(_)
556555
| PredicateKind::Clause(ClauseKind::ConstEvaluatable(_))
@@ -1278,7 +1277,6 @@ impl<'tcx> Predicate<'tcx> {
12781277
| PredicateKind::Clause(ClauseKind::RegionOutlives(..))
12791278
| PredicateKind::Clause(ClauseKind::WellFormed(..))
12801279
| PredicateKind::ObjectSafe(..)
1281-
| PredicateKind::ClosureKind(..)
12821280
| PredicateKind::Clause(ClauseKind::TypeOutlives(..))
12831281
| PredicateKind::Clause(ClauseKind::ConstEvaluatable(..))
12841282
| PredicateKind::ConstEquate(..)
@@ -1298,7 +1296,6 @@ impl<'tcx> Predicate<'tcx> {
12981296
| PredicateKind::Clause(ClauseKind::RegionOutlives(..))
12991297
| PredicateKind::Clause(ClauseKind::WellFormed(..))
13001298
| PredicateKind::ObjectSafe(..)
1301-
| PredicateKind::ClosureKind(..)
13021299
| PredicateKind::Clause(ClauseKind::TypeOutlives(..))
13031300
| PredicateKind::Clause(ClauseKind::ConstEvaluatable(..))
13041301
| PredicateKind::ConstEquate(..)
@@ -1319,7 +1316,6 @@ impl<'tcx> Predicate<'tcx> {
13191316
| PredicateKind::Clause(ClauseKind::RegionOutlives(..))
13201317
| PredicateKind::Clause(ClauseKind::WellFormed(..))
13211318
| PredicateKind::ObjectSafe(..)
1322-
| PredicateKind::ClosureKind(..)
13231319
| PredicateKind::Clause(ClauseKind::ConstEvaluatable(..))
13241320
| PredicateKind::ConstEquate(..)
13251321
| PredicateKind::Ambiguous => None,

compiler/rustc_middle/src/ty/print/pretty.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2781,11 +2781,6 @@ define_print! {
27812781
ty::PredicateKind::ObjectSafe(trait_def_id) => {
27822782
p!("the trait `", print_def_path(trait_def_id, &[]), "` is object-safe")
27832783
}
2784-
ty::PredicateKind::ClosureKind(closure_def_id, _closure_args, kind) => p!(
2785-
"the closure `",
2786-
print_value_path(closure_def_id, &[]),
2787-
write("` implements the trait `{}`", kind)
2788-
),
27892784
ty::PredicateKind::ConstEquate(c1, c2) => {
27902785
p!("the constant `", print(c1), "` equals `", print(c2), "`")
27912786
}

compiler/rustc_smir/src/rustc_smir/mod.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1667,13 +1667,6 @@ impl<'tcx> Stable<'tcx> for ty::PredicateKind<'tcx> {
16671667
PredicateKind::ObjectSafe(did) => {
16681668
stable_mir::ty::PredicateKind::ObjectSafe(tables.trait_def(*did))
16691669
}
1670-
PredicateKind::ClosureKind(did, generic_args, closure_kind) => {
1671-
stable_mir::ty::PredicateKind::ClosureKind(
1672-
tables.closure_def(*did),
1673-
generic_args.stable(tables),
1674-
closure_kind.stable(tables),
1675-
)
1676-
}
16771670
PredicateKind::Subtype(subtype_predicate) => {
16781671
stable_mir::ty::PredicateKind::SubType(subtype_predicate.stable(tables))
16791672
}

compiler/rustc_trait_selection/src/solve/eval_ctxt/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -406,8 +406,6 @@ impl<'a, 'tcx> EvalCtxt<'a, 'tcx> {
406406
ty::PredicateKind::Coerce(predicate) => {
407407
self.compute_coerce_goal(Goal { param_env, predicate })
408408
}
409-
ty::PredicateKind::ClosureKind(def_id, args, kind) => self
410-
.compute_closure_kind_goal(Goal { param_env, predicate: (def_id, args, kind) }),
411409
ty::PredicateKind::ObjectSafe(trait_def_id) => {
412410
self.compute_object_safe_goal(trait_def_id)
413411
}

compiler/rustc_trait_selection/src/solve/fulfill.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ impl<'tcx> TraitEngine<'tcx> for FulfillmentCtxt<'tcx> {
135135
}
136136
ty::PredicateKind::Clause(_)
137137
| ty::PredicateKind::ObjectSafe(_)
138-
| ty::PredicateKind::ClosureKind(_, _, _)
139138
| ty::PredicateKind::Ambiguous => {
140139
FulfillmentErrorCode::CodeSelectionError(
141140
SelectionError::Unimplemented,

compiler/rustc_trait_selection/src/traits/auto_trait.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -822,7 +822,6 @@ impl<'tcx> AutoTraitFinder<'tcx> {
822822
| ty::PredicateKind::Clause(ty::ClauseKind::ConstArgHasType(..))
823823
| ty::PredicateKind::AliasRelate(..)
824824
| ty::PredicateKind::ObjectSafe(..)
825-
| ty::PredicateKind::ClosureKind(..)
826825
| ty::PredicateKind::Subtype(..)
827826
// FIXME(generic_const_exprs): you can absolutely add this as a where clauses
828827
| ty::PredicateKind::Clause(ty::ClauseKind::ConstEvaluatable(..))

compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -786,11 +786,6 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
786786
report_object_safety_error(self.tcx, span, trait_def_id, violations)
787787
}
788788

789-
ty::PredicateKind::ClosureKind(closure_def_id, closure_args, kind) => {
790-
let found_kind = self.closure_kind(closure_args).unwrap();
791-
self.report_closure_error(&obligation, closure_def_id, found_kind, kind)
792-
}
793-
794789
ty::PredicateKind::Clause(ty::ClauseKind::WellFormed(ty)) => {
795790
let ty = self.resolve_vars_if_possible(ty);
796791
match self.tcx.sess.opts.unstable_opts.trait_solver {

0 commit comments

Comments
 (0)