Abort if a promoted fails to be const evaluable and its runtime checks didn't trigger#52571
Abort if a promoted fails to be const evaluable and its runtime checks didn't trigger#52571bors merged 5 commits intorust-lang:masterfrom
Conversation
|
@bors r+ |
|
📌 Commit 7064f69 has been approved by |
|
A test would be great still. Either a codegen or run-pass that self-invokes is fine. |
|
@bors r=nagisa |
|
📌 Commit 92fad0f has been approved by |
This comment has been minimized.
This comment has been minimized.
|
@bors r=nagisa |
|
📌 Commit 297ad72 has been approved by |
|
@bors r- You cannot spawn a process on wasm32. Please |
|
@bors r=nagisa |
|
📌 Commit 555a7b4 has been approved by |
| .stdout(Stdio::piped()) | ||
| .stdin(Stdio::piped()) | ||
| .arg("test").output().unwrap(); | ||
| assert!(!p.status.success()); |
There was a problem hiding this comment.
This test would also pass if the program SEGFAULTs (like some variants of this did) instead of SIGILLs... but I am not sure how to test for this properly, so whatever.^^
There was a problem hiding this comment.
rust/src/test/run-pass/segfault-no-out-of-stack.rs
Lines 26 to 40 in a5c2d0f
There was a problem hiding this comment.
So...? That's how this test could be improved, is what you are saying?
There was a problem hiding this comment.
I mean we already have copy-pastable code that does the exact checking necessary here. We should avoid writing non-trivial tests by hand when there's already a good example.
| // option. This file may not be copied, modified, or distributed | ||
| // except according to those terms. | ||
|
|
||
| // ignore-wasm |
There was a problem hiding this comment.
Sorry it should be // ignore-wasm32 😭 (or maybe // ignore-emscripten to include asm.js too, I'm not sure if asm.js can run a program)
|
@bors r=nagisa |
|
📌 Commit 233a6e1 has been approved by |
|
☀️ Test successful - status-appveyor, status-travis |
[beta] Abort instead of UB if promotion fails original PR: #52571 (not beta approved yet) r? @nikomatsakis cc @RalfJung
|
landed in beta in #52624 |
[beta] Abort instead of UB if promotion fails original PR: rust-lang/rust#52571 (not beta approved yet) r? @nikomatsakis cc @RalfJung
r? @eddyb
cc @RalfJung @nagisa
cc #49760