File tree Expand file tree Collapse file tree 4 files changed +71
-55
lines changed Expand file tree Collapse file tree 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>(
407407 }
408408 }
409409
410- if ret_span. from_expansion ( ) {
410+ if ret_span. from_expansion ( ) || is_from_proc_macro ( cx , expr ) {
411411 return ;
412412 }
413413
Original file line number Diff line number Diff line change 1+ //@aux-build:proc_macros.rs
12#![feature(yeet_expr)]
23#![allow(unused)]
34#![allow(
910)]
1011#![warn(clippy::needless_return)]
1112
13+ extern crate proc_macros;
14+ use proc_macros::with_span;
15+
1216use std::cell::RefCell;
1317
1418macro_rules! the_answer {
@@ -359,4 +363,8 @@ fn issue12907() -> String {
359363 "".split("").next().unwrap().to_string()
360364}
361365
366+ fn issue13458() {
367+ with_span!(span return);
368+ }
369+
362370fn main() {}
Original file line number Diff line number Diff line change 1+ //@aux-build:proc_macros.rs
12#![ feature( yeet_expr) ]
23#![ allow( unused) ]
34#![ allow(
910) ]
1011#![ warn( clippy:: needless_return) ]
1112
13+ extern crate proc_macros;
14+ use proc_macros:: with_span;
15+
1216use std:: cell:: RefCell ;
1317
1418macro_rules! the_answer {
@@ -369,4 +373,8 @@ fn issue12907() -> String {
369373 return "" . split ( "" ) . next ( ) . unwrap ( ) . to_string ( ) ;
370374}
371375
376+ fn issue13458 ( ) {
377+ with_span ! ( span return ) ;
378+ }
379+
372380fn main ( ) { }
You can’t perform that action at this time.
0 commit comments