Skip to content

Commit 232c1f3

Browse files
Format code
1 parent ec50190 commit 232c1f3

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

src/librustc_typeck/check/wfcheck.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -435,23 +435,18 @@ fn check_trait(tcx: TyCtxt<'_>, item: &hir::Item<'_>) {
435435
///
436436
/// Assuming the defaults are used, check that all predicates (bounds on the
437437
/// assoc type and where clauses on the trait) hold.
438-
fn check_associated_type_defaults(
439-
fcx: &FnCtxt<'_, '_>,
440-
trait_def_id: DefId,
441-
) {
438+
fn check_associated_type_defaults(fcx: &FnCtxt<'_, '_>, trait_def_id: DefId) {
442439
let tcx = fcx.tcx;
443440
let substs = InternalSubsts::identity_for_item(tcx, trait_def_id);
444441

445442
// For all assoc. types with defaults, build a map from
446443
// `<Self as Trait<...>>::Assoc` to the default type.
447-
let map = tcx.associated_items(trait_def_id)
444+
let map = tcx
445+
.associated_items(trait_def_id)
448446
.filter_map(|item| {
449447
if item.kind == ty::AssocKind::Type && item.defaultness.has_value() {
450448
// `<Self as Trait<...>>::Assoc`
451-
let proj = ty::ProjectionTy {
452-
substs,
453-
item_def_id: item.def_id,
454-
};
449+
let proj = ty::ProjectionTy { substs, item_def_id: item.def_id };
455450
let default_ty = tcx.type_of(item.def_id);
456451
debug!("assoc. type default mapping: {} -> {}", proj, default_ty);
457452
Some((proj, default_ty))

0 commit comments

Comments
 (0)