Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

static variable + debuginfo causes link error #13258

Closed
klutzy opened this issue Apr 2, 2014 · 2 comments
Closed

static variable + debuginfo causes link error #13258

klutzy opened this issue Apr 2, 2014 · 2 comments
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.)

Comments

@klutzy
Copy link
Contributor

klutzy commented Apr 2, 2014

a.rs:

#![crate_type = "lib"]

pub use private::P;

pub struct S {
    p: P,
}

mod private { // `pub mod` solves problem
    pub struct P {
        p: i32,
    }
    pub static THREE: P = P { p: 3 };
}

pub static A: S = S { p: private::THREE };

b.rs:

extern crate a;

fn main() {
    let B: a::S = a::A;
}

Building b.rs with --debuginfo=1 causes link error:

note: b.o:(.debug_info+0xb3): undefined reference to `private::THREE::ha5edf056fc0d59b6oaa::v0.0'

I have no idea if this is sub-bug of #11685 or not: is it illegal to use private::THREE in pub static A?

@jdm
Copy link
Contributor

jdm commented Apr 2, 2014

This is almost certainly #13213.

@jdm jdm added the A-debuginfo label Apr 2, 2014
@alexcrichton
Copy link
Member

Closing as a dupe of #13213, but moving the example over there because it's self contained.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.)
Projects
None yet
Development

No branches or pull requests

3 participants