File tree Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -5388,7 +5388,10 @@ impl<'a> Parser<'a> {
53885388 self . expect ( & token:: OpenDelim ( token:: Paren ) ) ?;
53895389
53905390 if let Ok ( Some ( _) ) = self . parse_self_arg ( ) {
5391- return Err ( self . fatal ( "unexpected `self` argument in bare function" ) )
5391+ let mut err = self . struct_span_err ( self . prev_span
5392+ , "unexpected `self` argument in bare function" ) ;
5393+ err. span_label ( self . prev_span , "invalid argument in bare function" ) ;
5394+ return Err ( err) ;
53925395 }
53935396
53945397 let sp = self . span ;
Original file line number Diff line number Diff line change 11fn a ( & self ) { }
22//~^ ERROR unexpected `self` argument in bare function
3+ //~| NOTE invalid argument in bare function
34
45fn main ( ) { }
Original file line number Diff line number Diff line change 11error: unexpected `self` argument in bare function
2- --> $DIR/bare-function-self.rs:12:11
2+ --> $DIR/bare-function-self.rs:1:7
33 |
44LL | fn a(&self) { }
5- | ^
5+ | ^^^^ invalid argument in bare function
66
77error: aborting due to previous error
88
You can’t perform that action at this time.
0 commit comments