mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-04 19:29:07 +00:00
Remove some unused arguments and update a comment
This commit is contained in:
parent
dc36b38526
commit
3d4b9b8b8b
@ -61,8 +61,10 @@ bitflags! {
|
|||||||
| TypeFlags::HAS_CT_INFER.bits
|
| TypeFlags::HAS_CT_INFER.bits
|
||||||
| TypeFlags::HAS_TY_PLACEHOLDER.bits
|
| TypeFlags::HAS_TY_PLACEHOLDER.bits
|
||||||
| TypeFlags::HAS_CT_PLACEHOLDER.bits
|
| TypeFlags::HAS_CT_PLACEHOLDER.bits
|
||||||
// Opaque types may get resolved in the current scope and must
|
// The `evaluate_obligation` query does not return further
|
||||||
// thus not be transported to other queries if it can be avoided.
|
// obligations. If it evaluates an obligation with an opaque
|
||||||
|
// type, that opaque type may get compared to another type,
|
||||||
|
// constraining it. We would lose this information.
|
||||||
// FIXME: differentiate between crate-local opaque types
|
// FIXME: differentiate between crate-local opaque types
|
||||||
// and opaque types from other crates, as only opaque types
|
// and opaque types from other crates, as only opaque types
|
||||||
// from the local crate can possibly be a local name
|
// from the local crate can possibly be a local name
|
||||||
|
@ -98,8 +98,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||||||
let arm_ty = self.check_expr_with_expectation(&arm.body, expected);
|
let arm_ty = self.check_expr_with_expectation(&arm.body, expected);
|
||||||
all_arms_diverge &= self.diverges.get();
|
all_arms_diverge &= self.diverges.get();
|
||||||
|
|
||||||
let opt_suggest_box_span =
|
let opt_suggest_box_span = self.opt_suggest_box_span(arm_ty, orig_expected);
|
||||||
self.opt_suggest_box_span(arm.body.span, arm_ty, orig_expected);
|
|
||||||
|
|
||||||
let (arm_span, semi_span) =
|
let (arm_span, semi_span) =
|
||||||
self.get_appropriate_arm_semicolon_removal_span(&arms, i, prior_arm_ty, arm_ty);
|
self.get_appropriate_arm_semicolon_removal_span(&arms, i, prior_arm_ty, arm_ty);
|
||||||
@ -504,12 +503,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||||||
// provide a structured suggestion in that case.
|
// provide a structured suggestion in that case.
|
||||||
pub(crate) fn opt_suggest_box_span(
|
pub(crate) fn opt_suggest_box_span(
|
||||||
&self,
|
&self,
|
||||||
_span: Span,
|
|
||||||
outer_ty: &'tcx TyS<'tcx>,
|
outer_ty: &'tcx TyS<'tcx>,
|
||||||
orig_expected: Expectation<'tcx>,
|
orig_expected: Expectation<'tcx>,
|
||||||
) -> Option<Span> {
|
) -> Option<Span> {
|
||||||
match (orig_expected, self.ret_coercion_impl_trait.map(|ty| (self.body_id.owner, ty))) {
|
match (orig_expected, self.ret_coercion_impl_trait.map(|ty| (self.body_id.owner, ty))) {
|
||||||
(Expectation::ExpectHasType(expected), Some((_id, _ty)))
|
(Expectation::ExpectHasType(expected), Some(_))
|
||||||
if self.in_tail_expr && self.can_coerce(outer_ty, expected) =>
|
if self.in_tail_expr && self.can_coerce(outer_ty, expected) =>
|
||||||
{
|
{
|
||||||
let obligations = self.fulfillment_cx.borrow().pending_obligations();
|
let obligations = self.fulfillment_cx.borrow().pending_obligations();
|
||||||
|
@ -948,8 +948,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||||||
};
|
};
|
||||||
let else_diverges = self.diverges.get();
|
let else_diverges = self.diverges.get();
|
||||||
|
|
||||||
let opt_suggest_box_span =
|
let opt_suggest_box_span = self.opt_suggest_box_span(else_ty, orig_expected);
|
||||||
self.opt_suggest_box_span(else_expr.span, else_ty, orig_expected);
|
|
||||||
let if_cause =
|
let if_cause =
|
||||||
self.if_cause(sp, then_expr, else_expr, then_ty, else_ty, opt_suggest_box_span);
|
self.if_cause(sp, then_expr, else_expr, then_ty, else_ty, opt_suggest_box_span);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user