File tree Expand file tree Collapse file tree 3 files changed +60
-0
lines changed Expand file tree Collapse file tree 3 files changed +60
-0
lines changed Original file line number Diff line number Diff line change @@ -293,6 +293,13 @@ pub fn create_global_var_metadata(cx: &CrateContext,
293
293
return ;
294
294
}
295
295
296
+ // Don't create debuginfo for globals inlined from other crates. The other crate should already
297
+ // contain debuginfo for it. More importantly, the global might not even exist in un-inlined
298
+ // form anywhere which would lead to a linker errors.
299
+ if cx. external_srcs . borrow ( ) . contains_key ( & node_id) {
300
+ return ;
301
+ }
302
+
296
303
let var_item = cx. tcx . map . get ( node_id) ;
297
304
298
305
let ( ident, span) = match var_item {
Original file line number Diff line number Diff line change
1
+ // Copyright 2013-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
+ #![ crate_type = "lib" ]
12
+ // compile-flags:-g
13
+
14
+ pub use private:: P ;
15
+
16
+ pub struct S {
17
+ p : P ,
18
+ }
19
+
20
+ mod private {
21
+ pub struct P {
22
+ p : i32 ,
23
+ }
24
+ pub static THREE : P = P { p : 3 } ;
25
+ }
26
+
27
+ pub static A : S = S { p : private:: THREE } ;
Original file line number Diff line number Diff line change
1
+ // Copyright 2013-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
+ // ignore-android: FIXME(#10381)
12
+
13
+ // aux-build:issue13213aux.rs
14
+ extern crate issue13213aux;
15
+
16
+ // compile-flags:-g
17
+
18
+ // This tests make sure that we get no linker error when using a completely inlined static. Some
19
+ // statics that are marked with AvailableExternallyLinkage in the importing crate, may actually not
20
+ // be available because they have been optimized out from the exporting crate.
21
+ fn main ( ) {
22
+ let b: issue13213aux:: S = issue13213aux:: A ;
23
+ zzz ( ) ;
24
+ }
25
+
26
+ fn zzz ( ) { ( ) }
You can’t perform that action at this time.
0 commit comments