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> {
5388
5388
self . expect ( & token:: OpenDelim ( token:: Paren ) ) ?;
5389
5389
5390
5390
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) ;
5392
5395
}
5393
5396
5394
5397
let sp = self . span ;
Original file line number Diff line number Diff line change 1
1
fn a ( & self ) { }
2
2
//~^ ERROR unexpected `self` argument in bare function
3
+ //~| NOTE invalid argument in bare function
3
4
4
5
fn main ( ) { }
Original file line number Diff line number Diff line change 1
1
error: unexpected `self` argument in bare function
2
- --> $DIR/bare-function-self.rs:12:11
2
+ --> $DIR/bare-function-self.rs:1:7
3
3
|
4
4
LL | fn a(&self) { }
5
- | ^
5
+ | ^^^^ invalid argument in bare function
6
6
7
7
error: aborting due to previous error
8
8
You can’t perform that action at this time.
0 commit comments