Remove a now-useless field
This commit is contained in:
parent
3d4b9b8b8b
commit
c564898110
@ -4,7 +4,7 @@ use rustc_errors::{Applicability, DiagnosticBuilder};
|
||||
use rustc_hir::{self as hir, ExprKind};
|
||||
use rustc_infer::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind};
|
||||
use rustc_infer::traits::Obligation;
|
||||
use rustc_middle::ty::{self, ToPredicate, Ty, TyS};
|
||||
use rustc_middle::ty::{self, ToPredicate, Ty, TyS, TypeFoldable};
|
||||
use rustc_span::{MultiSpan, Span};
|
||||
use rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt;
|
||||
use rustc_trait_selection::traits::{
|
||||
@ -506,9 +506,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
||||
outer_ty: &'tcx TyS<'tcx>,
|
||||
orig_expected: Expectation<'tcx>,
|
||||
) -> Option<Span> {
|
||||
match (orig_expected, self.ret_coercion_impl_trait.map(|ty| (self.body_id.owner, ty))) {
|
||||
(Expectation::ExpectHasType(expected), Some(_))
|
||||
if self.in_tail_expr && self.can_coerce(outer_ty, expected) =>
|
||||
match orig_expected {
|
||||
Expectation::ExpectHasType(expected)
|
||||
if self.in_tail_expr
|
||||
&& self.ret_coercion.as_ref()?.borrow().merged_ty().has_opaque_types()
|
||||
&& self.can_coerce(outer_ty, expected) =>
|
||||
{
|
||||
let obligations = self.fulfillment_cx.borrow().pending_obligations();
|
||||
let mut suggest_box = !obligations.is_empty();
|
||||
|
@ -95,11 +95,6 @@ pub(super) fn check_fn<'a, 'tcx>(
|
||||
|
||||
fcx.ret_coercion = Some(RefCell::new(CoerceMany::new(declared_ret_ty)));
|
||||
fcx.ret_type_span = Some(decl.output.span());
|
||||
if let ty::Opaque(..) = declared_ret_ty.kind() {
|
||||
// FIXME(oli-obk): remove this and have diagnostics check the signature's return type directly
|
||||
// as we don't reveal here anymore.
|
||||
fcx.ret_coercion_impl_trait = Some(declared_ret_ty);
|
||||
}
|
||||
|
||||
let span = body.value.span;
|
||||
|
||||
|
@ -57,8 +57,6 @@ pub struct FnCtxt<'a, 'tcx> {
|
||||
/// any).
|
||||
pub(super) ret_coercion: Option<RefCell<DynamicCoerceMany<'tcx>>>,
|
||||
|
||||
pub(super) ret_coercion_impl_trait: Option<Ty<'tcx>>,
|
||||
|
||||
pub(super) ret_type_span: Option<Span>,
|
||||
|
||||
/// Used exclusively to reduce cost of advanced evaluation used for
|
||||
@ -130,7 +128,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
||||
param_env,
|
||||
err_count_on_creation: inh.tcx.sess.err_count(),
|
||||
ret_coercion: None,
|
||||
ret_coercion_impl_trait: None,
|
||||
ret_type_span: None,
|
||||
in_tail_expr: false,
|
||||
ret_coercion_span: Cell::new(None),
|
||||
|
Loading…
x
Reference in New Issue
Block a user