-
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
detect dyn-unsized arguments before they cause ICEs #116115
Conversation
(rustbot has picked a reviewer for you, use r? to override) |
Some changes occurred to the CTFE / Miri engine cc @rust-lang/miri This PR changes MIR cc @oli-obk, @RalfJung, @JakobDegen, @davidtwco, @celinval, @vakaras The Miri subtree was changed cc @rust-lang/miri |
I am quite concerned that this will be way too expensive perf-wise, since "post-mono" means "runs a lot for functions that get monomorphized a lot"... I also don't have any good ideas for how to make this check any more efficient, so let's just see what happens. @bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
detect dyn-unsized arguments before they cause ICEs "Fixes" rust-lang#115709 in a crude way, with a post-mono check. This is entirely caused by us not having a trait to express "type can have its size determined at runtime".
This comment has been minimized.
This comment has been minimized.
356b1c2
to
0389d09
Compare
Some changes occurred in compiler/rustc_codegen_cranelift cc @bjorn3 |
@bors try |
detect dyn-unsized arguments before they cause ICEs "Fixes" rust-lang#115709 in a crude way, with a post-mono check. This is entirely caused by us not having a trait to express "type can have its size determined at runtime".
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (6e5c4b6): 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 sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 629.884s -> 632.427s (0.40%) |
Wait, there's speedup for some tests? That's got to be noise. 😂 For the slowdown, the good news it it's only the CTFE stress test. That one is pretty badly affected though. So... I guess the question is whether it's worth the perf hit to avoid ICEs in the interaction of two unstable features. I don't have a strong opinion on that matter. |
what's the actual status of unsized function arguments right now? if they're still fairly far from getting stabilized, I feel like this check may not be worth it 🤔 |
I have no idea. 🤷 #111175 is definitely a blocker in my view. |
I can probably disable this check in the interpreter. Miri already doesn't ICE here. Since only the ctfe stress test is affected, it seems like checking this from the codegen backends is actually fine. |
hmm, skimming over the discussions here it feels like unsized function arguments may want to wait on an RFC to detect this before monomorphization
so maybe it's better to keep this ICE around and just make it a blocker for stabilization to handle this. Assuming that there's a path forward which eagerly detects these without post-mono errors, that feels preferable to me. I lean towards closing this PR in that case. I may be misinterpreting something here |
Yeah we probably don't want to stabilize this with a post-mono check. I'm a bit worried someone might encounter the ICE and try to fix it locally without realizing that this is doomed, but it's probably not worth defending against that. So yeah closing is fine for me. |
…iler-errors more targeted errors when extern types end up in places they should not Cc rust-lang#115709 -- this does not fix that bug but it makes the panics less obscure and makes it more clear that this is a deeper issue than just a little codegen oversight. (In rust-lang#116115 we decided we'd stick to causing ICEs here for now, rather than nicer errors. We can't currently show any errors pre-mono and probably we don't want post-mono checks when this gets stabilized anyway.)
Rollup merge of rust-lang#118551 - RalfJung:extern-types-bugs, r=compiler-errors more targeted errors when extern types end up in places they should not Cc rust-lang#115709 -- this does not fix that bug but it makes the panics less obscure and makes it more clear that this is a deeper issue than just a little codegen oversight. (In rust-lang#116115 we decided we'd stick to causing ICEs here for now, rather than nicer errors. We can't currently show any errors pre-mono and probably we don't want post-mono checks when this gets stabilized anyway.)
more targeted errors when extern types end up in places they should not Cc rust-lang/rust#115709 -- this does not fix that bug but it makes the panics less obscure and makes it more clear that this is a deeper issue than just a little codegen oversight. (In rust-lang/rust#116115 we decided we'd stick to causing ICEs here for now, rather than nicer errors. We can't currently show any errors pre-mono and probably we don't want post-mono checks when this gets stabilized anyway.)
"Fixes" #115709 in a crude way, with a post-mono check. This is entirely caused by us not having a trait to express "type can have its size determined at runtime".