Skip to content

Commit f1db3be

Browse files
committed
fix tidy
1 parent f019b6c commit f1db3be

File tree

2 files changed

+13
-17
lines changed

2 files changed

+13
-17
lines changed

compiler/rustc_typeck/src/check/wfcheck.rs

+10-16
Original file line numberDiff line numberDiff line change
@@ -1193,11 +1193,7 @@ fn check_item_type(tcx: TyCtxt<'_>, item_id: LocalDefId, ty_span: Span, allow_fo
11931193
}
11941194
}
11951195

1196-
wfcx.register_wf_obligation(
1197-
ty_span,
1198-
Some(WellFormedLoc::Ty(item_id)),
1199-
item_ty.into(),
1200-
);
1196+
wfcx.register_wf_obligation(ty_span, Some(WellFormedLoc::Ty(item_id)), item_ty.into());
12011197
if forbid_unsized {
12021198
wfcx.register_bound(
12031199
traits::ObligationCause::new(ty_span, wfcx.body_id, traits::WellFormed(None)),
@@ -1306,11 +1302,7 @@ fn check_where_clauses<'tcx>(wfcx: &WfCheckingCtxt<'_, 'tcx>, span: Span, def_id
13061302
// parameter includes another (e.g., `<T, U = T>`). In those cases, we can't
13071303
// be sure if it will error or not as user might always specify the other.
13081304
if !ty.needs_subst() {
1309-
wfcx.register_wf_obligation(
1310-
tcx.def_span(param.def_id),
1311-
None,
1312-
ty.into(),
1313-
);
1305+
wfcx.register_wf_obligation(tcx.def_span(param.def_id), None, ty.into());
13141306
}
13151307
}
13161308
}
@@ -1454,7 +1446,13 @@ fn check_where_clauses<'tcx>(wfcx: &WfCheckingCtxt<'_, 'tcx>, span: Span, def_id
14541446
assert_eq!(predicates.predicates.len(), predicates.spans.len());
14551447
let wf_obligations =
14561448
iter::zip(&predicates.predicates, &predicates.spans).flat_map(|(&p, &sp)| {
1457-
traits::wf::predicate_obligations(infcx, wfcx.param_env.without_const(), wfcx.body_id, p, sp)
1449+
traits::wf::predicate_obligations(
1450+
infcx,
1451+
wfcx.param_env.without_const(),
1452+
wfcx.body_id,
1453+
p,
1454+
sp,
1455+
)
14581456
});
14591457

14601458
let obligations: Vec<_> = wf_obligations.chain(default_obligations).collect();
@@ -1509,11 +1507,7 @@ fn check_fn_or_method<'tcx>(
15091507
);
15101508
}
15111509

1512-
wfcx.register_wf_obligation(
1513-
hir_decl.output.span(),
1514-
None,
1515-
sig.output().into(),
1516-
);
1510+
wfcx.register_wf_obligation(hir_decl.output.span(), None, sig.output().into());
15171511

15181512
check_where_clauses(wfcx, span, def_id);
15191513
}

src/test/ui/rfc-2632-const-trait-impl/issue-100222.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ impl Index for () { type Output = (); }
1919
impl const IndexMut for <() as Index>::Output {
2020
const C: <Self as Index>::Output = ();
2121
type Assoc = <Self as Index>::Output;
22-
fn foo(&mut self, x: <Self as Index>::Output) -> <Self as Index>::Output where <Self as Index>::Output: {}
22+
fn foo(&mut self, x: <Self as Index>::Output) -> <Self as Index>::Output
23+
where <Self as Index>::Output:,
24+
{}
2325
}
2426

2527
const C: <() as Index>::Output = ();

0 commit comments

Comments
 (0)