mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-30 21:16:27 +03:00
Only resolve in new solver
This commit is contained in:
@@ -1007,15 +1007,17 @@ pub fn try_coerce(
|
||||
&self,
|
||||
expr: &hir::Expr<'_>,
|
||||
expr_ty: Ty<'tcx>,
|
||||
target: Ty<'tcx>,
|
||||
mut target: Ty<'tcx>,
|
||||
allow_two_phase: AllowTwoPhase,
|
||||
cause: Option<ObligationCause<'tcx>>,
|
||||
) -> RelateResult<'tcx, Ty<'tcx>> {
|
||||
let source = self.try_structurally_resolve_type(expr.span, expr_ty);
|
||||
let target = self.try_structurally_resolve_type(
|
||||
cause.as_ref().map_or(expr.span, |cause| cause.span),
|
||||
target,
|
||||
);
|
||||
if self.next_trait_solver() {
|
||||
target = self.try_structurally_resolve_type(
|
||||
cause.as_ref().map_or(expr.span, |cause| cause.span),
|
||||
target,
|
||||
);
|
||||
}
|
||||
debug!("coercion::try({:?}: {:?} -> {:?})", expr, source, target);
|
||||
|
||||
let cause =
|
||||
|
||||
Reference in New Issue
Block a user