File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ use std::mem;
3131use crate :: syntax:: ast;
3232use crate :: syntax:: source_map:: Span ;
3333use crate :: syntax_pos:: BytePos ;
34- use crate :: utils:: { sugg, sext} ;
34+ use crate :: utils:: { in_macro , sugg, sext} ;
3535use crate :: utils:: usage:: mutated_variables;
3636use crate :: consts:: { constant, Constant } ;
3737
@@ -1030,6 +1030,10 @@ fn check_for_loop_range<'a, 'tcx>(
10301030 body : & ' tcx Expr ,
10311031 expr : & ' tcx Expr ,
10321032) {
1033+ if in_macro ( expr. span ) {
1034+ return ;
1035+ }
1036+
10331037 if let Some ( higher:: Range {
10341038 start : Some ( start) ,
10351039 ref end,
Original file line number Diff line number Diff line change @@ -17,5 +17,10 @@ use proc_macro::{TokenStream, quote};
1717pub fn mini_macro ( _: TokenStream ) -> TokenStream {
1818 quote ! (
1919 #[ allow( unused) ] fn needless_take_by_value( s: String ) { println!( "{}" , s. len( ) ) ; }
20+ #[ allow( unused) ] fn needless_loop( items: & [ u8 ] ) {
21+ for i in 0 ..items. len( ) {
22+ println!( "{}" , items[ i] ) ;
23+ }
24+ }
2025 )
2126}
You can’t perform that action at this time.
0 commit comments