File tree 4 files changed +71
-55
lines changed
4 files changed +71
-55
lines changed Original file line number Diff line number Diff line change @@ -407,7 +407,7 @@ fn check_final_expr<'tcx>(
407
407
}
408
408
}
409
409
410
- if ret_span. from_expansion ( ) {
410
+ if ret_span. from_expansion ( ) || is_from_proc_macro ( cx , expr ) {
411
411
return ;
412
412
}
413
413
Original file line number Diff line number Diff line change
1
+ //@aux-build:proc_macros.rs
1
2
#![feature(yeet_expr)]
2
3
#![allow(unused)]
3
4
#![allow(
9
10
)]
10
11
#![warn(clippy::needless_return)]
11
12
13
+ extern crate proc_macros;
14
+ use proc_macros::with_span;
15
+
12
16
use std::cell::RefCell;
13
17
14
18
macro_rules! the_answer {
@@ -359,4 +363,8 @@ fn issue12907() -> String {
359
363
"".split("").next().unwrap().to_string()
360
364
}
361
365
366
+ fn issue13458() {
367
+ with_span!(span return);
368
+ }
369
+
362
370
fn main() {}
Original file line number Diff line number Diff line change
1
+ //@aux-build:proc_macros.rs
1
2
#![ feature( yeet_expr) ]
2
3
#![ allow( unused) ]
3
4
#![ allow(
9
10
) ]
10
11
#![ warn( clippy:: needless_return) ]
11
12
13
+ extern crate proc_macros;
14
+ use proc_macros:: with_span;
15
+
12
16
use std:: cell:: RefCell ;
13
17
14
18
macro_rules! the_answer {
@@ -369,4 +373,8 @@ fn issue12907() -> String {
369
373
return "" . split ( "" ) . next ( ) . unwrap ( ) . to_string ( ) ;
370
374
}
371
375
376
+ fn issue13458 ( ) {
377
+ with_span ! ( span return ) ;
378
+ }
379
+
372
380
fn main ( ) { }
You can’t perform that action at this time.
0 commit comments