File tree 1 file changed +4
-9
lines changed
src/librustc_typeck/check
1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -435,23 +435,18 @@ fn check_trait(tcx: TyCtxt<'_>, item: &hir::Item<'_>) {
435
435
///
436
436
/// Assuming the defaults are used, check that all predicates (bounds on the
437
437
/// 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 ) {
442
439
let tcx = fcx. tcx ;
443
440
let substs = InternalSubsts :: identity_for_item ( tcx, trait_def_id) ;
444
441
445
442
// For all assoc. types with defaults, build a map from
446
443
// `<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)
448
446
. filter_map ( |item| {
449
447
if item. kind == ty:: AssocKind :: Type && item. defaultness . has_value ( ) {
450
448
// `<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 } ;
455
450
let default_ty = tcx. type_of ( item. def_id ) ;
456
451
debug ! ( "assoc. type default mapping: {} -> {}" , proj, default_ty) ;
457
452
Some ( ( proj, default_ty) )
You can’t perform that action at this time.
0 commit comments