-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Speed up the inherent impl overlap check #68911
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
@bors try @rust-timer queue |
Awaiting bors try build completion |
Speed up the inherent impl overlap check This gives a ~7% improvement in compile times for the stm32f0(x2) crate. Also addresses @eddyb's comment in #68837 (comment).
☀️ Try build successful - checks-azure |
Queued a5b4dc5 with parent 442ae7f, future comparison URL. |
@@ -666,7 +666,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { | |||
|
|||
// The `Future` trait has only one associted item, `Output`, | |||
// so check that this is what we see. | |||
let output_assoc_item = self.tcx.associated_items(future_trait).nth(0).unwrap().def_id; | |||
let output_assoc_item = self.tcx.associated_items(future_trait)[0].def_id; |
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 think this pattern (or worse, looking things up by name) should be replaced with lang items.
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.
Yeah, definintely. This was a huge pain when working on generators, since the declaration order of the assoc. types is significant. Not something I'll try to fit in this PR though.
Looks like this made |
☔ The latest upstream changes (presumably #65232) made this pull request unmergeable. Please resolve the merge conflicts. |
r=me after rebase |
This reduces the number of `associated_item` queries done here.
Quickly skip impls that do not define any items with the same name
@bors r=petrochenkov |
📌 Commit 58a9284 has been approved by |
…=petrochenkov Speed up the inherent impl overlap check This gives a ~7% improvement in compile times for the stm32f0(x2) crate. Also addresses @eddyb's comment in rust-lang#68837 (comment).
…=petrochenkov Speed up the inherent impl overlap check This gives a ~7% improvement in compile times for the stm32f0(x2) crate. Also addresses @eddyb's comment in rust-lang#68837 (comment).
…=petrochenkov Speed up the inherent impl overlap check This gives a ~7% improvement in compile times for the stm32f0(x2) crate. Also addresses @eddyb's comment in rust-lang#68837 (comment).
Rollup of 5 pull requests Successful merges: - #68738 (Derive Clone + Eq for std::string::FromUtf8Error) - #68742 (implement AsMut<str> for String) - #68881 (rustc_codegen_llvm: always set AlwaysPreserve on all debuginfo variables) - #68911 (Speed up the inherent impl overlap check) - #68913 (Pretty-print generic params and where clauses on associated types) Failed merges: r? @ghost
Rustup to rust-lang/rust#68911 changelog: none
This gives a ~7% improvement in compile times for the stm32f0(x2) crate.
Also addresses @eddyb's comment in #68837 (comment).