File tree 1 file changed +3
-11
lines changed
compiler/rustc_parse/src/parser
1 file changed +3
-11
lines changed Original file line number Diff line number Diff line change @@ -602,21 +602,13 @@ impl<'a> Parser<'a> {
602
602
let polarity = self . parse_polarity ( ) ;
603
603
604
604
// Parse both types and traits as a type, then reinterpret if necessary.
605
- let err_path = |span| ast:: Path :: from_ident ( Ident :: new ( kw:: Empty , span) ) ;
606
605
let ty_first = if self . token . is_keyword ( kw:: For ) && self . look_ahead ( 1 , |t| t != & token:: Lt )
607
606
{
608
607
let span = self . prev_token . span . between ( self . token . span ) ;
609
- self . dcx ( ) . emit_err ( errors:: MissingTraitInTraitImpl {
608
+ return Err ( self . dcx ( ) . create_err ( errors:: MissingTraitInTraitImpl {
610
609
span,
611
610
for_span : span. to ( self . token . span ) ,
612
- } ) ;
613
-
614
- P ( Ty {
615
- kind : TyKind :: Path ( None , err_path ( span) ) ,
616
- span,
617
- id : DUMMY_NODE_ID ,
618
- tokens : None ,
619
- } )
611
+ } ) ) ;
620
612
} else {
621
613
self . parse_ty_with_generics_recovery ( & generics) ?
622
614
} ;
@@ -671,7 +663,7 @@ impl<'a> Parser<'a> {
671
663
span : ty_first. span ,
672
664
} ) ;
673
665
}
674
- err_path ( ty_first. span )
666
+ ast :: Path :: from_ident ( Ident :: new ( kw :: Empty , ty_first. span ) )
675
667
}
676
668
} ;
677
669
let trait_ref = TraitRef { path, ref_id : ty_first. id } ;
You can’t perform that action at this time.
0 commit comments