Skip to content

Commit 6f8bb9d

Browse files
Remove redundant calls to resolve_vars_with_obligations
1 parent 553bfe2 commit 6f8bb9d

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
lines changed

compiler/rustc_hir_typeck/src/coercion.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1037,6 +1037,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
10371037
/// Returns false if the coercion creates any obligations that result in
10381038
/// errors.
10391039
pub fn can_coerce(&self, expr_ty: Ty<'tcx>, target: Ty<'tcx>) -> bool {
1040+
// FIXME(-Ztrait-solver=next): We need to structurally resolve both types here.
10401041
let source = self.resolve_vars_with_obligations(expr_ty);
10411042
debug!("coercion::can_with_predicates({:?} -> {:?})", source, target);
10421043

compiler/rustc_hir_typeck/src/demand.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
260260
));
261261
let expr = expr.peel_drop_temps();
262262
let cause = self.misc(expr.span);
263-
let expr_ty = self.resolve_vars_with_obligations(checked_ty);
263+
let expr_ty = self.resolve_vars_if_possible(checked_ty);
264264
let mut err = self.err_ctxt().report_mismatched_types(&cause, expected, expr_ty, e);
265265

266266
let is_insufficiently_polymorphic =

compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
950950
if !expected.is_unit() {
951951
return;
952952
}
953-
let found = self.resolve_vars_with_obligations(found);
953+
let found = self.resolve_vars_if_possible(found);
954954

955955
let in_loop = self.is_loop(id)
956956
|| self

compiler/rustc_hir_typeck/src/method/suggest.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2994,7 +2994,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
29942994
// This occurs for UFCS desugaring of `T::method`, where there is no
29952995
// receiver expression for the method call, and thus no autoderef.
29962996
if let SelfSource::QPath(_) = source {
2997-
return is_local(self.resolve_vars_with_obligations(rcvr_ty));
2997+
return is_local(rcvr_ty);
29982998
}
29992999

30003000
self.autoderef(span, rcvr_ty).any(|(ty, _)| is_local(ty))

0 commit comments

Comments
 (0)