Skip to content

Commit 3d4b9b8

Browse files
committed
Remove some unused arguments and update a comment
1 parent dc36b38 commit 3d4b9b8

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

compiler/rustc_type_ir/src/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,10 @@ bitflags! {
6161
| TypeFlags::HAS_CT_INFER.bits
6262
| TypeFlags::HAS_TY_PLACEHOLDER.bits
6363
| TypeFlags::HAS_CT_PLACEHOLDER.bits
64-
// Opaque types may get resolved in the current scope and must
65-
// thus not be transported to other queries if it can be avoided.
64+
// The `evaluate_obligation` query does not return further
65+
// obligations. If it evaluates an obligation with an opaque
66+
// type, that opaque type may get compared to another type,
67+
// constraining it. We would lose this information.
6668
// FIXME: differentiate between crate-local opaque types
6769
// and opaque types from other crates, as only opaque types
6870
// from the local crate can possibly be a local name

compiler/rustc_typeck/src/check/_match.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
9898
let arm_ty = self.check_expr_with_expectation(&arm.body, expected);
9999
all_arms_diverge &= self.diverges.get();
100100

101-
let opt_suggest_box_span =
102-
self.opt_suggest_box_span(arm.body.span, arm_ty, orig_expected);
101+
let opt_suggest_box_span = self.opt_suggest_box_span(arm_ty, orig_expected);
103102

104103
let (arm_span, semi_span) =
105104
self.get_appropriate_arm_semicolon_removal_span(&arms, i, prior_arm_ty, arm_ty);
@@ -504,12 +503,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
504503
// provide a structured suggestion in that case.
505504
pub(crate) fn opt_suggest_box_span(
506505
&self,
507-
_span: Span,
508506
outer_ty: &'tcx TyS<'tcx>,
509507
orig_expected: Expectation<'tcx>,
510508
) -> Option<Span> {
511509
match (orig_expected, self.ret_coercion_impl_trait.map(|ty| (self.body_id.owner, ty))) {
512-
(Expectation::ExpectHasType(expected), Some((_id, _ty)))
510+
(Expectation::ExpectHasType(expected), Some(_))
513511
if self.in_tail_expr && self.can_coerce(outer_ty, expected) =>
514512
{
515513
let obligations = self.fulfillment_cx.borrow().pending_obligations();

compiler/rustc_typeck/src/check/expr.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -948,8 +948,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
948948
};
949949
let else_diverges = self.diverges.get();
950950

951-
let opt_suggest_box_span =
952-
self.opt_suggest_box_span(else_expr.span, else_ty, orig_expected);
951+
let opt_suggest_box_span = self.opt_suggest_box_span(else_ty, orig_expected);
953952
let if_cause =
954953
self.if_cause(sp, then_expr, else_expr, then_ty, else_ty, opt_suggest_box_span);
955954

0 commit comments

Comments
 (0)