Speed up the inherent impl overlap check#68911
Speed up the inherent impl overlap check#68911bors merged 5 commits intorust-lang:masterfrom jonas-schievink:inherent-overlap
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. |
| // 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.
I think this pattern (or worse, looking things up by name) should be replaced with lang items.
There was a problem hiding this comment.
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).