@@ -1510,34 +1510,31 @@ impl<'a> Parser<'a> {
15101510 } else {
15111511 ( None , self . parse_path ( PathStyle :: Expr ) ?)
15121512 } ;
1513- let lo = path. span ;
15141513
15151514 // `!`, as an operator, is prefix, so we know this isn't that.
1516- let ( hi , kind) = if self . eat ( & token:: Not ) {
1515+ let ( span , kind) = if self . eat ( & token:: Not ) {
15171516 // MACRO INVOCATION expression
15181517 if qself. is_some ( ) {
15191518 self . struct_span_err ( path. span , "macros cannot use qualified paths" ) . emit ( ) ;
15201519 }
1520+ let lo = path. span ;
15211521 let mac = MacCall {
15221522 path,
15231523 args : self . parse_mac_args ( ) ?,
15241524 prior_type_ascription : self . last_type_ascription ,
15251525 } ;
1526- ( self . prev_token . span , ExprKind :: MacCall ( mac) )
1527- } else if self . check ( & token:: OpenDelim ( Delimiter :: Brace ) ) {
1528- if let Some ( expr) = self . maybe_parse_struct_expr ( qself. as_ref ( ) , & path, & attrs) {
1526+ ( lo . to ( self . prev_token . span ) , ExprKind :: MacCall ( mac) )
1527+ } else if self . check ( & token:: OpenDelim ( Delimiter :: Brace ) ) &&
1528+ let Some ( expr) = self . maybe_parse_struct_expr ( qself. as_ref ( ) , & path, & attrs) {
15291529 if qself. is_some ( ) {
15301530 self . sess . gated_spans . gate ( sym:: more_qualified_paths, path. span ) ;
15311531 }
15321532 return expr;
1533- } else {
1534- ( path. span , ExprKind :: Path ( qself, path) )
1535- }
15361533 } else {
15371534 ( path. span , ExprKind :: Path ( qself, path) )
15381535 } ;
15391536
1540- let expr = self . mk_expr ( lo . to ( hi ) , kind, attrs) ;
1537+ let expr = self . mk_expr ( span , kind, attrs) ;
15411538 self . maybe_recover_from_bad_qpath ( expr)
15421539 }
15431540
0 commit comments