Skip to content

Commit d6f7d42

Browse files
michaelwoeristeralexcrichton
authored andcommitted
---
yaml --- r: 110910 b: refs/heads/snap-stage3 c: 5099b8c h: refs/heads/master v: v3
1 parent 9f0e3a7 commit d6f7d42

File tree

4 files changed

+61
-1
lines changed

4 files changed

+61
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 296e60be6b027a52de58251848037a92f23a0878
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: c26d25466d93cefea6cf81ec3f0e64200a7150be
4+
refs/heads/snap-stage3: 5099b8c863150675450631347436b7d220f4efd3
55
refs/heads/try: 38201d7c6bf0c32b0e5bdc8ecd63976ebc1b3a4c
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/librustc/middle/trans/debuginfo.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,13 @@ pub fn create_global_var_metadata(cx: &CrateContext,
293293
return;
294294
}
295295

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+
296303
let var_item = cx.tcx.map.get(node_id);
297304

298305
let (ident, span) = match var_item {
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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 };
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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() {()}

0 commit comments

Comments
 (0)