File tree 1 file changed +13
-24
lines changed
compiler/rustc_parse/src/parser
1 file changed +13
-24
lines changed Original file line number Diff line number Diff line change @@ -646,7 +646,7 @@ impl<'a> Parser<'a> {
646
646
647
647
let impl_items = self . parse_item_list ( attrs, |p| p. parse_impl_item ( ForceCollect :: No ) ) ?;
648
648
649
- let item_kind = match ty_second {
649
+ let ( of_trait , self_ty ) = match ty_second {
650
650
Some ( ty_second) => {
651
651
// impl Trait for Type
652
652
if !has_for {
@@ -679,31 +679,20 @@ impl<'a> Parser<'a> {
679
679
} ;
680
680
let trait_ref = TraitRef { path, ref_id : ty_first. id } ;
681
681
682
- ItemKind :: Impl ( Box :: new ( Impl {
683
- safety,
684
- polarity,
685
- defaultness,
686
- constness,
687
- generics,
688
- of_trait : Some ( trait_ref) ,
689
- self_ty : ty_second,
690
- items : impl_items,
691
- } ) )
692
- }
693
- None => {
694
- // impl Type
695
- ItemKind :: Impl ( Box :: new ( Impl {
696
- safety,
697
- polarity,
698
- defaultness,
699
- constness,
700
- generics,
701
- of_trait : None ,
702
- self_ty : ty_first,
703
- items : impl_items,
704
- } ) )
682
+ ( Some ( trait_ref) , ty_second)
705
683
}
684
+ None => ( None , ty_first) , // impl Type
706
685
} ;
686
+ let item_kind = ItemKind :: Impl ( Box :: new ( Impl {
687
+ safety,
688
+ polarity,
689
+ defaultness,
690
+ constness,
691
+ generics,
692
+ of_trait,
693
+ self_ty,
694
+ items : impl_items,
695
+ } ) ) ;
707
696
708
697
Ok ( ( Ident :: empty ( ) , item_kind) )
709
698
}
You can’t perform that action at this time.
0 commit comments