-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Implement associated lang items #72559
Conversation
r? @eddyb (rust_highfive has picked a reviewer for you, use r? to override) |
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 |
f9cf262
to
084a71f
Compare
@@ -21,26 +22,6 @@ use rustc_session::parse::feature_err; | |||
use rustc_span::symbol::sym; | |||
use rustc_span::Span; | |||
|
|||
fn target_from_impl_item<'tcx>(tcx: TyCtxt<'tcx>, impl_item: &hir::ImplItem<'_>) -> Target { |
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.
This is in the same crate, so you could just make it public instead of moving it.
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.
I thought it was better to be able to consistently use Target::from_[type]
@bors try @rust-timer queue |
Awaiting bors try build completion |
⌛ Trying commit 084a71ffacd64b18fcc094774e3070863e094346 with merge 4c413091cb0a8f9601d37e506e4fcfae154504cc... |
☀️ Try build successful - checks-azure |
Queued 4c413091cb0a8f9601d37e506e4fcfae154504cc with parent ee6c0da, future comparison URL. |
Finished benchmarking try commit 4c413091cb0a8f9601d37e506e4fcfae154504cc, comparison URL. |
1df2014
to
230394d
Compare
@eddyb: I've moved |
@eddyb: Are there any other changes that you'd like me to make? |
☔ The latest upstream changes (presumably #72080) made this pull request unmergeable. Please resolve the merge conflicts. |
230394d
to
f3bda53
Compare
r? @oli-obk |
☔ The latest upstream changes (presumably #73528) made this pull request unmergeable. Please resolve the merge conflicts. |
f3bda53
to
a8dff53
Compare
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 |
Fixes rust-lang#70718 This commit allows making associated items (e.g. associated functions and types) into lang items via the `#[lang]` attribute. This allows such items to be accessed directly, rather than by iterating over the parent item's associated items. I've added `FnOnce::Output` as a lang item, and updated one old usage to use the new lang item. The remaining uses can be updated separately.
a8dff53
to
a13d467
Compare
@oli-obk: I've moved |
@bors r+ |
📌 Commit a13d467 has been approved by |
@bors retry |
☀️ Test successful - checks-azure |
Tested on commit rust-lang/rust@229e5b2. Direct link to PR: <rust-lang/rust#72559> 💔 rls on linux: test-pass → test-fail (cc @Xanewok).
Fixes #70718
This commit allows making associated items (e.g. associated functions
and types) into lang items via the
#[lang]
attribute. This allows suchitems to be accessed directly, rather than by iterating over the parent
item's associated items.
I've added
FnOnce::Output
as a lang item, and updated one old usage touse the new lang item. The remaining uses can be updated separately.