File tree 2 files changed +18
-1
lines changed
2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -136,8 +136,10 @@ fn fold_block(
136
136
) -> ast:: blk_ {
137
137
let filtered_stmts =
138
138
b. stmts . filter_mapped ( |a| filter_stmt ( cx, * a) ) ;
139
+ let filtered_view_items =
140
+ b. view_items . filter_mapped ( |a| filter_view_item ( cx, * a) ) ;
139
141
ast:: blk_ {
140
- view_items : /*bad*/ copy b . view_items ,
142
+ view_items : vec :: map ( filtered_view_items , |x| fld . fold_view_item ( * x ) ) ,
141
143
stmts : vec:: map ( filtered_stmts, |x| fld. fold_stmt ( * x) ) ,
142
144
expr : b. expr . map ( |x| fld. fold_expr ( * x) ) ,
143
145
id : b. id ,
Original file line number Diff line number Diff line change
1
+ // Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2
+ // file at the top-level directory of this distribution and at
3
+ // http://rust-lang.org/COPYRIGHT.
4
+ //
5
+ // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6
+ // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7
+ // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8
+ // option. This file may not be copied, modified, or distributed
9
+ // except according to those terms.
10
+
11
+ fn main ( ) {
12
+ // Make sure that this view item is filtered out because otherwise it would
13
+ // trigger a compilation error
14
+ #[ cfg( not_present) ] use foo = bar;
15
+ }
You can’t perform that action at this time.
0 commit comments