Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d4356b8

Browse files
committedFeb 28, 2024
Fallout from removing a_is_expected
1 parent 08fdb83 commit d4356b8

File tree

12 files changed

+44
-109
lines changed

12 files changed

+44
-109
lines changed
 

‎compiler/rustc_borrowck/src/type_check/relate_tys.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,7 @@ impl<'me, 'bccx, 'tcx> NllTypeRelating<'me, 'bccx, 'tcx> {
160160
),
161161
};
162162
let cause = ObligationCause::dummy_with_span(self.span());
163-
let obligations =
164-
infcx.handle_opaque_type(a, b, true, &cause, self.param_env())?.obligations;
163+
let obligations = infcx.handle_opaque_type(a, b, &cause, self.param_env())?.obligations;
165164
self.register_obligations(obligations);
166165
Ok(())
167166
}
@@ -330,10 +329,6 @@ impl<'bccx, 'tcx> TypeRelation<'tcx> for NllTypeRelating<'_, 'bccx, 'tcx> {
330329
"nll::subtype"
331330
}
332331

333-
fn a_is_expected(&self) -> bool {
334-
true
335-
}
336-
337332
#[instrument(skip(self, info), level = "trace", ret)]
338333
fn relate_with_variance<T: Relate<'tcx>>(
339334
&mut self,

‎compiler/rustc_infer/src/infer/error_reporting/mod.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2669,10 +2669,6 @@ impl<'tcx> TypeRelation<'tcx> for SameTypeModuloInfer<'_, 'tcx> {
26692669
"SameTypeModuloInfer"
26702670
}
26712671

2672-
fn a_is_expected(&self) -> bool {
2673-
true
2674-
}
2675-
26762672
fn relate_with_variance<T: relate::Relate<'tcx>>(
26772673
&mut self,
26782674
_variance: ty::Variance,

‎compiler/rustc_infer/src/infer/opaque_types.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,7 @@ impl<'tcx> InferCtxt<'tcx> {
7878
span,
7979
});
8080
obligations.extend(
81-
self.handle_opaque_type(ty, ty_var, true, &cause, param_env)
82-
.unwrap()
83-
.obligations,
81+
self.handle_opaque_type(ty, ty_var, &cause, param_env).unwrap().obligations,
8482
);
8583
ty_var
8684
}
@@ -94,14 +92,12 @@ impl<'tcx> InferCtxt<'tcx> {
9492
&self,
9593
a: Ty<'tcx>,
9694
b: Ty<'tcx>,
97-
a_is_expected: bool,
9895
cause: &ObligationCause<'tcx>,
9996
param_env: ty::ParamEnv<'tcx>,
10097
) -> InferResult<'tcx, ()> {
10198
if a.references_error() || b.references_error() {
10299
return Ok(InferOk { value: (), obligations: vec![] });
103100
}
104-
let (a, b) = if a_is_expected { (a, b) } else { (b, a) };
105101
let process = |a: Ty<'tcx>, b: Ty<'tcx>| match *a.kind() {
106102
ty::Alias(ty::Opaque, ty::AliasTy { def_id, args, .. }) if def_id.is_local() => {
107103
let def_id = def_id.expect_local();

‎compiler/rustc_infer/src/infer/outlives/test_type_match.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,6 @@ impl<'tcx> TypeRelation<'tcx> for MatchAgainstHigherRankedOutlives<'tcx> {
144144
self.tcx
145145
}
146146

147-
fn a_is_expected(&self) -> bool {
148-
true
149-
} // irrelevant
150-
151147
#[instrument(level = "trace", skip(self))]
152148
fn relate_with_variance<T: Relate<'tcx>>(
153149
&mut self,

‎compiler/rustc_infer/src/infer/relate/combine.rs

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ impl<'tcx> InferCtxt<'tcx> {
5757
where
5858
R: ObligationEmittingRelation<'tcx>,
5959
{
60-
let a_is_expected = relation.a_is_expected();
6160
debug_assert!(!a.has_escaping_bound_vars());
6261
debug_assert!(!b.has_escaping_bound_vars());
6362

@@ -68,20 +67,20 @@ impl<'tcx> InferCtxt<'tcx> {
6867
.borrow_mut()
6968
.int_unification_table()
7069
.unify_var_var(a_id, b_id)
71-
.map_err(|e| int_unification_error(a_is_expected, e))?;
70+
.map_err(|e| int_unification_error(true, e))?;
7271
Ok(a)
7372
}
7473
(&ty::Infer(ty::IntVar(v_id)), &ty::Int(v)) => {
75-
self.unify_integral_variable(a_is_expected, v_id, IntType(v))
74+
self.unify_integral_variable(true, v_id, IntType(v))
7675
}
7776
(&ty::Int(v), &ty::Infer(ty::IntVar(v_id))) => {
78-
self.unify_integral_variable(!a_is_expected, v_id, IntType(v))
77+
self.unify_integral_variable(!true, v_id, IntType(v))
7978
}
8079
(&ty::Infer(ty::IntVar(v_id)), &ty::Uint(v)) => {
81-
self.unify_integral_variable(a_is_expected, v_id, UintType(v))
80+
self.unify_integral_variable(true, v_id, UintType(v))
8281
}
8382
(&ty::Uint(v), &ty::Infer(ty::IntVar(v_id))) => {
84-
self.unify_integral_variable(!a_is_expected, v_id, UintType(v))
83+
self.unify_integral_variable(!true, v_id, UintType(v))
8584
}
8685

8786
// Relate floating-point variables to other types
@@ -90,14 +89,14 @@ impl<'tcx> InferCtxt<'tcx> {
9089
.borrow_mut()
9190
.float_unification_table()
9291
.unify_var_var(a_id, b_id)
93-
.map_err(|e| float_unification_error(a_is_expected, e))?;
92+
.map_err(|e| float_unification_error(true, e))?;
9493
Ok(a)
9594
}
9695
(&ty::Infer(ty::FloatVar(v_id)), &ty::Float(v)) => {
97-
self.unify_float_variable(a_is_expected, v_id, v)
96+
self.unify_float_variable(true, v_id, v)
9897
}
9998
(&ty::Float(v), &ty::Infer(ty::FloatVar(v_id))) => {
100-
self.unify_float_variable(!a_is_expected, v_id, v)
99+
self.unify_float_variable(!true, v_id, v)
101100
}
102101

103102
// We don't expect `TyVar` or `Fresh*` vars at this point with lazy norm.
@@ -130,7 +129,7 @@ impl<'tcx> InferCtxt<'tcx> {
130129

131130
// All other cases of inference are errors
132131
(&ty::Infer(_), _) | (_, &ty::Infer(_)) => {
133-
Err(TypeError::Sorts(ty::relate::expected_found(relation, a, b)))
132+
Err(TypeError::Sorts(ty::relate::expected_found(a, b)))
134133
}
135134

136135
// During coherence, opaque types should be treated as *possibly*
@@ -228,12 +227,12 @@ impl<'tcx> InferCtxt<'tcx> {
228227
}
229228

230229
(ty::ConstKind::Infer(InferConst::Var(vid)), _) => {
231-
self.instantiate_const_var(relation, relation.a_is_expected(), vid, b)?;
230+
self.instantiate_const_var(relation, true, vid, b)?;
232231
Ok(b)
233232
}
234233

235234
(_, ty::ConstKind::Infer(InferConst::Var(vid))) => {
236-
self.instantiate_const_var(relation, !relation.a_is_expected(), vid, a)?;
235+
self.instantiate_const_var(relation, false, vid, a)?;
237236
Ok(a)
238237
}
239238

@@ -250,8 +249,6 @@ impl<'tcx> InferCtxt<'tcx> {
250249
{
251250
match relation.structurally_relate_aliases() {
252251
StructurallyRelateAliases::No => {
253-
let (a, b) = if relation.a_is_expected() { (a, b) } else { (b, a) };
254-
255252
relation.register_predicates([if self.next_trait_solver() {
256253
ty::PredicateKind::AliasRelate(
257254
a.into(),

‎compiler/rustc_infer/src/infer/relate/generalize.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ impl<'tcx> InferCtxt<'tcx> {
130130
// instantiate_ty_var(?b, A) # expected and variance flipped
131131
// A rel A'
132132
// ```
133-
if target_is_expected == relation.a_is_expected() {
133+
if target_is_expected {
134134
relation.relate(generalized_ty, source_ty)?;
135135
} else {
136136
debug!("flip relation");
@@ -206,7 +206,7 @@ impl<'tcx> InferCtxt<'tcx> {
206206

207207
// HACK: make sure that we `a_is_expected` continues to be
208208
// correct when relating the generalized type with the source.
209-
if target_is_expected == relation.a_is_expected() {
209+
if target_is_expected {
210210
relation.relate_with_variance(
211211
ty::Variance::Invariant,
212212
ty::VarianceDiagInfo::default(),
@@ -398,10 +398,6 @@ impl<'tcx> TypeRelation<'tcx> for Generalizer<'_, 'tcx> {
398398
"Generalizer"
399399
}
400400

401-
fn a_is_expected(&self) -> bool {
402-
true
403-
}
404-
405401
fn relate_item_args(
406402
&mut self,
407403
item_def_id: DefId,

‎compiler/rustc_infer/src/infer/relate/glb.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@ impl<'tcx> TypeRelation<'tcx> for Glb<'_, '_, 'tcx> {
3030
self.fields.tcx()
3131
}
3232

33-
fn a_is_expected(&self) -> bool {
34-
true
35-
}
36-
3733
fn relate_with_variance<T: Relate<'tcx>>(
3834
&mut self,
3935
variance: ty::Variance,

‎compiler/rustc_infer/src/infer/relate/lattice.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,7 @@ where
116116
&& !this.infcx().next_trait_solver() =>
117117
{
118118
this.register_obligations(
119-
infcx
120-
.handle_opaque_type(a, b, this.a_is_expected(), this.cause(), this.param_env())?
121-
.obligations,
119+
infcx.handle_opaque_type(a, b, this.cause(), this.param_env())?.obligations,
122120
);
123121
Ok(a)
124122
}

‎compiler/rustc_infer/src/infer/relate/lub.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@ impl<'tcx> TypeRelation<'tcx> for Lub<'_, '_, 'tcx> {
3030
self.fields.tcx()
3131
}
3232

33-
fn a_is_expected(&self) -> bool {
34-
true
35-
}
36-
3733
fn relate_with_variance<T: Relate<'tcx>>(
3834
&mut self,
3935
variance: ty::Variance,

‎compiler/rustc_infer/src/infer/relate/type_relating.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@ impl<'tcx> TypeRelation<'tcx> for TypeRelating<'_, '_, 'tcx> {
3535
self.fields.infcx.tcx
3636
}
3737

38-
fn a_is_expected(&self) -> bool {
39-
true
40-
}
41-
4238
fn relate_with_variance<T: Relate<'tcx>>(
4339
&mut self,
4440
variance: ty::Variance,
@@ -139,7 +135,7 @@ impl<'tcx> TypeRelation<'tcx> for TypeRelating<'_, '_, 'tcx> {
139135
{
140136
self.fields.obligations.extend(
141137
infcx
142-
.handle_opaque_type(a, b, true, &self.fields.trace.cause, self.param_env())?
138+
.handle_opaque_type(a, b, &self.fields.trace.cause, self.param_env())?
143139
.obligations,
144140
);
145141
}

‎compiler/rustc_middle/src/ty/_match.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ impl<'tcx> TypeRelation<'tcx> for MatchAgainstFreshVars<'tcx> {
3737
self.tcx
3838
}
3939

40-
fn a_is_expected(&self) -> bool {
41-
true
42-
} // irrelevant
43-
4440
fn relate_with_variance<T: Relate<'tcx>>(
4541
&mut self,
4642
_: ty::Variance,
@@ -75,7 +71,7 @@ impl<'tcx> TypeRelation<'tcx> for MatchAgainstFreshVars<'tcx> {
7571
) => Ok(a),
7672

7773
(&ty::Infer(_), _) | (_, &ty::Infer(_)) => {
78-
Err(TypeError::Sorts(relate::expected_found(self, a, b)))
74+
Err(TypeError::Sorts(relate::expected_found(a, b)))
7975
}
8076

8177
(&ty::Error(guar), _) | (_, &ty::Error(guar)) => Ok(Ty::new_error(self.tcx(), guar)),
@@ -100,7 +96,7 @@ impl<'tcx> TypeRelation<'tcx> for MatchAgainstFreshVars<'tcx> {
10096
}
10197

10298
(ty::ConstKind::Infer(_), _) | (_, ty::ConstKind::Infer(_)) => {
103-
return Err(TypeError::ConstMismatch(relate::expected_found(self, a, b)));
99+
return Err(TypeError::ConstMismatch(relate::expected_found(a, b)));
104100
}
105101

106102
_ => {}

‎compiler/rustc_middle/src/ty/relate.rs

Lines changed: 25 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@ pub trait TypeRelation<'tcx>: Sized {
2626
/// Returns a static string we can use for printouts.
2727
fn tag(&self) -> &'static str;
2828

29-
/// Returns `true` if the value `a` is the "expected" type in the
30-
/// relation. Just affects error messages.
31-
fn a_is_expected(&self) -> bool;
32-
3329
/// Generic relation routine suitable for most anything.
3430
fn relate<T: Relate<'tcx>>(&mut self, a: T, b: T) -> RelateResult<'tcx, T> {
3531
Relate::relate(self, a, b)
@@ -171,11 +167,7 @@ impl<'tcx> Relate<'tcx> for ty::FnSig<'tcx> {
171167
let tcx = relation.tcx();
172168

173169
if a.c_variadic != b.c_variadic {
174-
return Err(TypeError::VariadicMismatch(expected_found(
175-
relation,
176-
a.c_variadic,
177-
b.c_variadic,
178-
)));
170+
return Err(TypeError::VariadicMismatch(expected_found(a.c_variadic, b.c_variadic)));
179171
}
180172
let unsafety = relation.relate(a.unsafety, b.unsafety)?;
181173
let abi = relation.relate(a.abi, b.abi)?;
@@ -220,39 +212,31 @@ impl<'tcx> Relate<'tcx> for ty::FnSig<'tcx> {
220212

221213
impl<'tcx> Relate<'tcx> for ty::BoundConstness {
222214
fn relate<R: TypeRelation<'tcx>>(
223-
relation: &mut R,
215+
_relation: &mut R,
224216
a: ty::BoundConstness,
225217
b: ty::BoundConstness,
226218
) -> RelateResult<'tcx, ty::BoundConstness> {
227-
if a != b {
228-
Err(TypeError::ConstnessMismatch(expected_found(relation, a, b)))
229-
} else {
230-
Ok(a)
231-
}
219+
if a != b { Err(TypeError::ConstnessMismatch(expected_found(a, b))) } else { Ok(a) }
232220
}
233221
}
234222

235223
impl<'tcx> Relate<'tcx> for hir::Unsafety {
236224
fn relate<R: TypeRelation<'tcx>>(
237-
relation: &mut R,
225+
_relation: &mut R,
238226
a: hir::Unsafety,
239227
b: hir::Unsafety,
240228
) -> RelateResult<'tcx, hir::Unsafety> {
241-
if a != b {
242-
Err(TypeError::UnsafetyMismatch(expected_found(relation, a, b)))
243-
} else {
244-
Ok(a)
245-
}
229+
if a != b { Err(TypeError::UnsafetyMismatch(expected_found(a, b))) } else { Ok(a) }
246230
}
247231
}
248232

249233
impl<'tcx> Relate<'tcx> for abi::Abi {
250234
fn relate<R: TypeRelation<'tcx>>(
251-
relation: &mut R,
235+
_relation: &mut R,
252236
a: abi::Abi,
253237
b: abi::Abi,
254238
) -> RelateResult<'tcx, abi::Abi> {
255-
if a == b { Ok(a) } else { Err(TypeError::AbiMismatch(expected_found(relation, a, b))) }
239+
if a == b { Ok(a) } else { Err(TypeError::AbiMismatch(expected_found(a, b))) }
256240
}
257241
}
258242

@@ -263,7 +247,7 @@ impl<'tcx> Relate<'tcx> for ty::AliasTy<'tcx> {
263247
b: ty::AliasTy<'tcx>,
264248
) -> RelateResult<'tcx, ty::AliasTy<'tcx>> {
265249
if a.def_id != b.def_id {
266-
Err(TypeError::ProjectionMismatched(expected_found(relation, a.def_id, b.def_id)))
250+
Err(TypeError::ProjectionMismatched(expected_found(a.def_id, b.def_id)))
267251
} else {
268252
let args = match relation.tcx().def_kind(a.def_id) {
269253
DefKind::OpaqueTy => relate_args_with_variances(
@@ -291,7 +275,7 @@ impl<'tcx> Relate<'tcx> for ty::ExistentialProjection<'tcx> {
291275
b: ty::ExistentialProjection<'tcx>,
292276
) -> RelateResult<'tcx, ty::ExistentialProjection<'tcx>> {
293277
if a.def_id != b.def_id {
294-
Err(TypeError::ProjectionMismatched(expected_found(relation, a.def_id, b.def_id)))
278+
Err(TypeError::ProjectionMismatched(expected_found(a.def_id, b.def_id)))
295279
} else {
296280
let term = relation.relate_with_variance(
297281
ty::Invariant,
@@ -318,7 +302,7 @@ impl<'tcx> Relate<'tcx> for ty::TraitRef<'tcx> {
318302
) -> RelateResult<'tcx, ty::TraitRef<'tcx>> {
319303
// Different traits cannot be related.
320304
if a.def_id != b.def_id {
321-
Err(TypeError::Traits(expected_found(relation, a.def_id, b.def_id)))
305+
Err(TypeError::Traits(expected_found(a.def_id, b.def_id)))
322306
} else {
323307
let args = relate_args_invariantly(relation, a.args, b.args)?;
324308
Ok(ty::TraitRef::new(relation.tcx(), a.def_id, args))
@@ -334,7 +318,7 @@ impl<'tcx> Relate<'tcx> for ty::ExistentialTraitRef<'tcx> {
334318
) -> RelateResult<'tcx, ty::ExistentialTraitRef<'tcx>> {
335319
// Different traits cannot be related.
336320
if a.def_id != b.def_id {
337-
Err(TypeError::Traits(expected_found(relation, a.def_id, b.def_id)))
321+
Err(TypeError::Traits(expected_found(a.def_id, b.def_id)))
338322
} else {
339323
let args = relate_args_invariantly(relation, a.args, b.args)?;
340324
Ok(ty::ExistentialTraitRef { def_id: a.def_id, args })
@@ -510,9 +494,9 @@ pub fn structurally_relate_tys<'tcx, R: TypeRelation<'tcx>>(
510494
let sz_b = sz_b.try_to_target_usize(tcx);
511495

512496
match (sz_a, sz_b) {
513-
(Some(sz_a_val), Some(sz_b_val)) if sz_a_val != sz_b_val => Err(
514-
TypeError::FixedArraySize(expected_found(relation, sz_a_val, sz_b_val)),
515-
),
497+
(Some(sz_a_val), Some(sz_b_val)) if sz_a_val != sz_b_val => {
498+
Err(TypeError::FixedArraySize(expected_found(sz_a_val, sz_b_val)))
499+
}
516500
_ => Err(err),
517501
}
518502
}
@@ -531,9 +515,9 @@ pub fn structurally_relate_tys<'tcx, R: TypeRelation<'tcx>>(
531515
iter::zip(as_, bs).map(|(a, b)| relation.relate(a, b)),
532516
)?)
533517
} else if !(as_.is_empty() || bs.is_empty()) {
534-
Err(TypeError::TupleSize(expected_found(relation, as_.len(), bs.len())))
518+
Err(TypeError::TupleSize(expected_found(as_.len(), bs.len())))
535519
} else {
536-
Err(TypeError::Sorts(expected_found(relation, a, b)))
520+
Err(TypeError::Sorts(expected_found(a, b)))
537521
}
538522
}
539523

@@ -554,7 +538,7 @@ pub fn structurally_relate_tys<'tcx, R: TypeRelation<'tcx>>(
554538
Ok(Ty::new_alias(tcx, a_kind, alias_ty))
555539
}
556540

557-
_ => Err(TypeError::Sorts(expected_found(relation, a, b))),
541+
_ => Err(TypeError::Sorts(expected_found(a, b))),
558542
}
559543
}
560544

@@ -652,13 +636,13 @@ pub fn structurally_relate_consts<'tcx, R: TypeRelation<'tcx>>(
652636
let related_args = tcx.mk_const_list(&related_args);
653637
Expr::FunctionCall(func, related_args)
654638
}
655-
_ => return Err(TypeError::ConstMismatch(expected_found(r, a, b))),
639+
_ => return Err(TypeError::ConstMismatch(expected_found(a, b))),
656640
};
657641
return Ok(ty::Const::new_expr(tcx, expr, a.ty()));
658642
}
659643
_ => false,
660644
};
661-
if is_match { Ok(a) } else { Err(TypeError::ConstMismatch(expected_found(relation, a, b))) }
645+
if is_match { Ok(a) } else { Err(TypeError::ConstMismatch(expected_found(a, b))) }
662646
}
663647

664648
impl<'tcx> Relate<'tcx> for &'tcx ty::List<ty::PolyExistentialPredicate<'tcx>> {
@@ -680,7 +664,7 @@ impl<'tcx> Relate<'tcx> for &'tcx ty::List<ty::PolyExistentialPredicate<'tcx>> {
680664
b_v.sort_by(|a, b| a.skip_binder().stable_cmp(tcx, &b.skip_binder()));
681665
b_v.dedup();
682666
if a_v.len() != b_v.len() {
683-
return Err(TypeError::ExistentialMismatch(expected_found(relation, a, b)));
667+
return Err(TypeError::ExistentialMismatch(expected_found(a, b)));
684668
}
685669

686670
let v = iter::zip(a_v, b_v).map(|(ep_a, ep_b)| {
@@ -692,7 +676,7 @@ impl<'tcx> Relate<'tcx> for &'tcx ty::List<ty::PolyExistentialPredicate<'tcx>> {
692676
relation.relate(ep_a.rebind(a), ep_b.rebind(b))?.skip_binder(),
693677
))),
694678
(AutoTrait(a), AutoTrait(b)) if a == b => Ok(ep_a.rebind(AutoTrait(a))),
695-
_ => Err(TypeError::ExistentialMismatch(expected_found(relation, a, b))),
679+
_ => Err(TypeError::ExistentialMismatch(expected_found(a, b))),
696680
}
697681
});
698682
tcx.mk_poly_existential_predicates_from_iter(v)
@@ -792,15 +776,11 @@ impl<'tcx> Relate<'tcx> for GenericArg<'tcx> {
792776

793777
impl<'tcx> Relate<'tcx> for ty::ImplPolarity {
794778
fn relate<R: TypeRelation<'tcx>>(
795-
relation: &mut R,
779+
_relation: &mut R,
796780
a: ty::ImplPolarity,
797781
b: ty::ImplPolarity,
798782
) -> RelateResult<'tcx, ty::ImplPolarity> {
799-
if a != b {
800-
Err(TypeError::PolarityMismatch(expected_found(relation, a, b)))
801-
} else {
802-
Ok(a)
803-
}
783+
if a != b { Err(TypeError::PolarityMismatch(expected_found(a, b))) } else { Ok(a) }
804784
}
805785
}
806786

@@ -834,9 +814,6 @@ impl<'tcx> Relate<'tcx> for Term<'tcx> {
834814
///////////////////////////////////////////////////////////////////////////
835815
// Error handling
836816

837-
pub fn expected_found<'tcx, R, T>(relation: &mut R, a: T, b: T) -> ExpectedFound<T>
838-
where
839-
R: TypeRelation<'tcx>,
840-
{
841-
ExpectedFound::new(relation.a_is_expected(), a, b)
817+
pub fn expected_found<T>(a: T, b: T) -> ExpectedFound<T> {
818+
ExpectedFound::new(true, a, b)
842819
}

0 commit comments

Comments
 (0)
Please sign in to comment.