Conversation
|
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 |
|
At least the linker errors are reproducible |
src/librustc/ty/mod.rs
Outdated
There was a problem hiding this comment.
PartialEq and Hash don't agree. Is it possible that we ever have two slices with the same address but different lengths?
There was a problem hiding this comment.
That's not possible as the length is stored at that address.
There was a problem hiding this comment.
The Hash implementation should just hash the pointer then. Should be faster too.
There was a problem hiding this comment.
The HashStable impl in impls_ty.rs should also just use the pointer as the cache key.
src/librustc/ty/mod.rs
Outdated
There was a problem hiding this comment.
I'm wondering if this can trigger some kind of undefined behavior? Maybe mem::transmute(EMPTY_SLICE) would be better.
There was a problem hiding this comment.
I can get rid of the optimization for the empty slice and see if that helps...
There was a problem hiding this comment.
Removing it does make things work.
|
☔ The latest upstream changes (presumably #50332) made this pull request unmergeable. Please resolve the merge conflicts. |
|
Ping from triage @Zoxc! It's been a while since we heard from you, will you have time to work on this again soon? |
|
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 |
|
@bors try |
Make &Slice a thin pointer Split out from #50395 r? @michaelwoerister
|
☀️ Test successful - status-travis |
|
@Mark-Simulacrum I'd like a perf run here |
|
This will be interesting |
src/librustc/ty/mod.rs
Outdated
There was a problem hiding this comment.
If you write this as:
#[repr(C)]
pub struct Slice<T> {
pub len: usize,
data: [T; 0],
_opaque: OpaqueSliceContents,
}Then you can read/write the len, and get a pointer to the start of the data by .data.as_ptr(), both of which work in safe code.
|
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 |
src/librustc/ty/mod.rs
Outdated
There was a problem hiding this comment.
Since this is only used to compute the size to allocate, could you inline it into from_arena?
|
☔ The latest upstream changes (presumably #50930) made this pull request unmergeable. Please resolve the merge conflicts. |
|
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 |
|
@eddyb's suggestions have been applied. |
|
📌 Commit fb4e3b6 has been approved by |
Make &Slice a thin pointer Split out from #50395 r? @michaelwoerister
|
☀️ Test successful - status-appveyor, status-travis |
|
This looks like a slight performance win. The previous benchmark run hashed the length of slices and it had an assertion in the |
Split out from #50395
r? @michaelwoerister