reference
reference copied to clipboard
linkage: Add a note about symbol visibility and unused sections to the paragraph about staticlibs
Fixes https://github.com/rust-lang/rust/issues/111593
CC @bjorn3
@bjorn3 or @petrochenkov Does the information here look correct to you?
Yes, but I'm not sure this belongs to the language reference? It's all about implementation details.
Yes, but I'm not sure this belongs to the language reference?
Yea, there is a gray area where it is unclear how much regarding crate types and linkage are implementation-specific, and what should be considered part of the language. We haven't really nailed down how to draw those lines (#599 discusses this a bit). I seem to recall thinking that most of this chapter should be moved to the rustc guide (at least the compiler-specific parts), but I'm not sure exactly how to make that separation. We also don't have a home for guide-style material like this.
I would love to see a section of the rustc guide (or an entire book!) on linking with Rust. This seems like the kind of content that would live there.
I think for now, without a clear home for this, leaving it here would be fine. It can be moved to a better home in the future.
I agree that the reference seems like the wrong place, but this specific chapter seems to be the best currently existing place for this :)