reference icon indicating copy to clipboard operation
reference copied to clipboard

linkage: Add a note about symbol visibility and unused sections to the paragraph about staticlibs

Open sdroege opened this issue 2 years ago • 4 comments

Fixes https://github.com/rust-lang/rust/issues/111593


CC @bjorn3

sdroege avatar May 17 '23 06:05 sdroege

@bjorn3 or @petrochenkov Does the information here look correct to you?

ehuss avatar May 22 '23 17:05 ehuss

Yes, but I'm not sure this belongs to the language reference? It's all about implementation details.

petrochenkov avatar May 22 '23 17:05 petrochenkov

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.

ehuss avatar May 22 '23 17:05 ehuss

I agree that the reference seems like the wrong place, but this specific chapter seems to be the best currently existing place for this :)

sdroege avatar May 23 '23 16:05 sdroege