Skip to content

Commit 93298ee

Browse files
Remove ClosureKind predicate kind
1 parent 0ff8610 commit 93298ee

File tree

26 files changed

+76
-191
lines changed

26 files changed

+76
-191
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
@@ -548,7 +548,6 @@ impl<'tcx> Predicate<'tcx> {
548548
| PredicateKind::Clause(ClauseKind::ConstArgHasType(..))
549549
| PredicateKind::AliasRelate(..)
550550
| PredicateKind::ObjectSafe(_)
551-
| PredicateKind::ClosureKind(_, _, _)
552551
| PredicateKind::Subtype(_)
553552
| PredicateKind::Coerce(_)
554553
| PredicateKind::Clause(ClauseKind::ConstEvaluatable(_))
@@ -1276,7 +1275,6 @@ impl<'tcx> Predicate<'tcx> {
12761275
| PredicateKind::Clause(ClauseKind::RegionOutlives(..))
12771276
| PredicateKind::Clause(ClauseKind::WellFormed(..))
12781277
| PredicateKind::ObjectSafe(..)
1279-
| PredicateKind::ClosureKind(..)
12801278
| PredicateKind::Clause(ClauseKind::TypeOutlives(..))
12811279
| PredicateKind::Clause(ClauseKind::ConstEvaluatable(..))
12821280
| PredicateKind::ConstEquate(..)
@@ -1296,7 +1294,6 @@ impl<'tcx> Predicate<'tcx> {
12961294
| PredicateKind::Clause(ClauseKind::RegionOutlives(..))
12971295
| PredicateKind::Clause(ClauseKind::WellFormed(..))
12981296
| PredicateKind::ObjectSafe(..)
1299-
| PredicateKind::ClosureKind(..)
13001297
| PredicateKind::Clause(ClauseKind::TypeOutlives(..))
13011298
| PredicateKind::Clause(ClauseKind::ConstEvaluatable(..))
13021299
| PredicateKind::ConstEquate(..)
@@ -1317,7 +1314,6 @@ impl<'tcx> Predicate<'tcx> {
13171314
| PredicateKind::Clause(ClauseKind::RegionOutlives(..))
13181315
| PredicateKind::Clause(ClauseKind::WellFormed(..))
13191316
| PredicateKind::ObjectSafe(..)
1320-
| PredicateKind::ClosureKind(..)
13211317
| PredicateKind::Clause(ClauseKind::ConstEvaluatable(..))
13221318
| PredicateKind::ConstEquate(..)
13231319
| 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
@@ -1699,13 +1699,6 @@ impl<'tcx> Stable<'tcx> for ty::PredicateKind<'tcx> {
16991699
PredicateKind::ObjectSafe(did) => {
17001700
stable_mir::ty::PredicateKind::ObjectSafe(tables.trait_def(*did))
17011701
}
1702-
PredicateKind::ClosureKind(did, generic_args, closure_kind) => {
1703-
stable_mir::ty::PredicateKind::ClosureKind(
1704-
tables.closure_def(*did),
1705-
generic_args.stable(tables),
1706-
closure_kind.stable(tables),
1707-
)
1708-
}
17091702
PredicateKind::Subtype(subtype_predicate) => {
17101703
stable_mir::ty::PredicateKind::SubType(subtype_predicate.stable(tables))
17111704
}

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)