-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Make lang items private #73500
Make lang items private #73500
Conversation
What do you think will be easier to do? Merge this PR first or merge #72559 first? EDIT: linked wrong PR |
I'll give it a proper read this afternoon but my gut feeling is probably this |
I'll review the other PR then and carry it over the finish line |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
☔ The latest upstream changes (presumably #73504) made this pull request unmergeable. Please resolve the merge conflicts. |
1 similar comment
☔ The latest upstream changes (presumably #73504) made this pull request unmergeable. Please resolve the merge conflicts. |
impl<CTX> HashStable<CTX> for LangItemRecord { | ||
fn hash_stable(&self, _: &mut CTX, hasher: &mut StableHasher) { | ||
::std::hash::Hash::hash(self, hasher); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this implementation correct? LangItemRecord
can contain a DefId
for which hash
is not stable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch.
@doctorn This is another ping from Triage. |
@doctorn hey :) closing this due to inactivity. If you wish when you have the time to do so, you can submit a new PR with these changes. Thank you for taking the time to contribute :) |
Implements rust-lang/compiler-team#301
Design is largely as discussed, but I also made an effort to remove
require_lang_item
. Instead,LangItemRecord
has methodsrequire
andrequire_with
which take a reference to aMissingLangItemHandler
(implemented byTyCtxt
). In my opinion this makes the interface a lot cleaner while also reducing the number of imports (it is no longer necessary to importlang_items
or specific items in order to require them).This change also made it possible to unify the
item
andmissing
fields of the lang items table. We no longer require the hack in the weak lang items pass for markingeh_personality
as missing as all lang items are now assumed missing until found. To make this work,alloc_error_handler
is explicitly whitelisted in crates which do not require an allocator.This is likely to conflict with a lot of open PRs as it touches a lot of code, but my biggest worry is #72559 (which will need to be re-implemented to use the new API although I can't imagine it will be too difficult).
Resolves #72240
r? @oli-obk
cc @ecstatic-morse + @Aaron1011