[Step 2] Implement "small substs optimization" for substs of length 1 #59312
[Step 2] Implement "small substs optimization" for substs of length 1 #59312csmoe wants to merge 5 commits intorust-lang:masterfrom
Conversation
|
r? @oli-obk (rust_highfive has picked a reviewer for you, use r? to override) |
src/librustc/ty/subst.rs
Outdated
There was a problem hiding this comment.
intern_substs should directly return a SubstsRef
There was a problem hiding this comment.
@oli-obk
As _intern_substs comes from slice_interners!, which returns a List, then should I implement a specific one for SubstsRef?
There was a problem hiding this comment.
You should be able to just modify that method, too. I don't think it's used elsewhere.
|
☔ The latest upstream changes (presumably #59382) made this pull request unmergeable. Please resolve the merge conflicts. |
|
Ping from triage, @csmoe, you have some rebasing + review comments to address. |
5943ac9 to
8a62a32
Compare
641a29a to
e52b4c7
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Change-Id: Idc024631af3ecbe352fb0d18c9184ab7f2d55a19
|
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 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 |
| }).count(); | ||
|
|
||
| &substs[own_params] | ||
| SubstsRef::from_slice(self.tcx(), &substs[own_params]) |
There was a problem hiding this comment.
why does this take TyCtxt as an argument? Is there a method that will just pass through the reference if it already has the appropriate lifetime?
| closure_kind_ty: self.substs.type_at(parent_len), | ||
| closure_sig_ty: self.substs.type_at(parent_len + 1), | ||
| upvar_kinds: &self.substs[parent_len + 2..], | ||
| upvar_kinds: SubstsRef::from_slice(tcx, &self.substs[parent_len + 2..]), |
There was a problem hiding this comment.
same here, tcx isn't really necessary, the lifetimes should already fit
|
☔ The latest upstream changes (presumably #59008) made this pull request unmergeable. Please resolve the merge conflicts. |
|
Triage ping @csmoe, there's merge conflicts waiting to be resolved, and also a few review comments |
|
Triage pinging again @csmoe |
Replace ClosureSubsts with SubstsRef Addresses rust-lang#42340 part 3 rust-lang#59312 might benefit from this clean up. r? @nikomatsakis
Address #58310