File tree 4 files changed +52
-1
lines changed
4 files changed +52
-1
lines changed Original file line number Diff line number Diff line change @@ -270,11 +270,12 @@ impl<'a> ReachableContext<'a> {
270
270
271
271
// Statics with insignificant addresses are not reachable
272
272
// because they're inlined specially into all other crates.
273
- ast:: ItemStatic ( .. ) => {
273
+ ast:: ItemStatic ( _ , _ , init ) => {
274
274
if attr:: contains_name ( item. attrs . as_slice ( ) ,
275
275
"address_insignificant" ) {
276
276
self . reachable_symbols . remove ( & search_item) ;
277
277
}
278
+ visit:: walk_expr ( self , init, ( ) ) ;
278
279
}
279
280
280
281
// These are normal, nothing reachable about these
Original file line number Diff line number Diff line change
1
+ // Copyright 2012-2014 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
+ pub struct Foo {
12
+ pub foo : extern fn ( )
13
+ }
14
+
15
+ extern fn the_foo ( ) { }
16
+
17
+ pub static FOO : Foo = Foo {
18
+ foo : the_foo
19
+ } ;
Original file line number Diff line number Diff line change
1
+ // Copyright 2012-2014 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
+ extern crate crate1 = "issue-13620-1" ;
12
+
13
+ pub static FOO2 : crate1:: Foo = crate1:: FOO ;
Original file line number Diff line number Diff line change
1
+ // Copyright 2012-2014 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
+ // aux-build:issue-13620-1.rs
12
+ // aux-build:issue-13620-2.rs
13
+
14
+ extern crate crate2 = "issue-13620-2" ;
15
+
16
+ fn main ( ) {
17
+ ( crate2:: FOO2 . foo ) ( ) ;
18
+ }
You can’t perform that action at this time.
0 commit comments