-
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
Check for occupied niches #104862
Check for occupied niches #104862
Conversation
This comment has been minimized.
This comment has been minimized.
728d411
to
ef3960a
Compare
This comment has been minimized.
This comment has been minimized.
ef3960a
to
14aacea
Compare
This comment has been minimized.
This comment has been minimized.
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
This is not done yet. I wish generalized niche checks were as simple as what I whipped up here, and also CI doesn't pass for... reasons. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #111082) made this pull request unmergeable. Please resolve the merge conflicts. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
086c91c
to
980a43a
Compare
To reproduce the crash, compile this: #[derive(thiserror::Error)]
#[error("...")]
pub enum ErrorEnum {
Test {
source: u8,
},
} With a toolchain built with
|
This comment has been minimized.
This comment has been minimized.
I can confirm that this is the same issue as #116976. LLVM 17.0.4 should be released soon. |
☔ The latest upstream changes (presumably #117498) made this pull request unmergeable. Please resolve the merge conflicts. |
980a43a
to
c627bf7
Compare
This comment has been minimized.
This comment has been minimized.
c627bf7
to
9c7354e
Compare
This comment has been minimized.
This comment has been minimized.
9c7354e
to
5573275
Compare
This comment has been minimized.
This comment has been minimized.
5573275
to
5c19cfd
Compare
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
Check for occupied niches Implementation of rust-lang/compiler-team#624 Crater run has 62 crates that hit the check, 43 of those are published to crates.io. I see a lot of null function pointers and use of `mem::uninitialized` where the 0x1-filling collides with an enum niche. But that is with full niche checks; checking transmute, plus any place where that we Copy, Move, or Inspect. Such checking is definitely too thorough to be on by default because it is 2x compile time overhead. --- During implementation, this ran into llvm/llvm-project#68381 r? `@ghost`
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (eaa4669): comparison URL. Overall result: ❌✅ regressions and improvements - ACTION NEEDEDBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Bootstrap: 674.395s -> 673.749s (-0.10%) |
@saethlin any updates on this? |
Yes; I'm working on an alternative implementation. It's almost ready for a draft PR. |
Replaced by #121174 |
Check for occupied niches This is a replacement for rust-lang#104862 r? `@ghost`
Implementation of rust-lang/compiler-team#624
Crater run has 62 crates that hit the check, 43 of those are published to crates.io. I see a lot of null function pointers and use of
mem::uninitialized
where the 0x1-filling collides with an enum niche.But that is with full niche checks; checking transmute, plus any place where that we Copy, Move, or Inspect. Such checking is definitely too thorough to be on by default because it is 2x compile time overhead.
During implementation, this ran into llvm/llvm-project#68381
r? @ghost