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

Simplify symbol version mangling #10208

Closed
brson opened this issue Oct 31, 2013 · 4 comments
Closed

Simplify symbol version mangling #10208

brson opened this issue Oct 31, 2013 · 4 comments
Labels
A-linkage Area: linking into static, shared libraries and binaries P-low Low priority

Comments

@brson
Copy link
Contributor

brson commented Oct 31, 2013

In the spirit of stripping down and simplifying our broken versioning scheme (#10188, #10207), this is a suggestion to remove a bunch of complexity from our name mangling.

The description of how we mangle symbols is mostly correct. The most important thing this mangling gets us is that it allows multiple, different crates to define the functions by throwing in some hashes, and that's worth preserving. The other versioning benefits are theoretical and don't work.

Where the current mangling includes a hash of the crate metadata and the type signature and also a version tag, instead we can just add a unique hash that either represents the crate metadata as currently defined or the strict version hash as suggested in #10207.

cc #2166

@brson
Copy link
Contributor Author

brson commented Oct 31, 2013

Nominating

@alexcrichton
Copy link
Member

It's probably also worth mentioning that the other main reason for having this hash was to throw the type signature into the hash. Then in theory if you change the symbol's type you would prevent linking against the new crate with crates linked against the old version. That being said, our "in-place update" system is so broken as is (see #10207), that this is the least of our concerns.

I personally like the idea of this becoming the strict version hash instead of the crate metadata hash because if symbol names become truly not determined by node ids then we could very realistically run into this problem by accident. By using the SVH (which is extremely sensitive to crate changes), then we're still guaranteeing that you can't link against old versions of libraries.

@pnkfelix
Copy link
Member

pnkfelix commented Nov 7, 2013

P-low, not necessary for 1.0. The theory is that we can probably fix this without anything breaking (apart from binary incompatibilities, but we're unlikely to guarantee that.)

@steveklabnik
Copy link
Member

I'm pulling a massive triage effort to get us ready for 1.0. As part of this, I'm moving stuff that's wishlist-like to the RFCs repo, as that's where major new things should get discussed/prioritized.

This issue has been moved to the RFCs repo: rust-lang/rfcs#689

flip1995 pushed a commit to flip1995/rust that referenced this issue Jul 2, 2023
…rednet

New lint [`manual_try_fold`]

Closes rust-lang#10208

---

changelog: New lint [`manual_try_fold`]
[rust-lang#11012](rust-lang/rust-clippy#11012)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linkage Area: linking into static, shared libraries and binaries P-low Low priority
Projects
None yet
Development

No branches or pull requests

4 participants