-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
regression tests for ICEs #42230
regression tests for ICEs #42230
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Mark-Simulacrum (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
src/test/compile-fail/issue-37665.rs
Outdated
let mut foo : String = "hello".to_string(); | ||
foo.push(MAIN_SEPARATOR); | ||
println!("{}", foo); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this test needs to have --unpretty mir -Z unstable-options
passed to the compiler. // compile-flags: -Z unstable-options --unpretty=mir
should work at the top of the file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, looks like this won't quite work since (I believe) we don't actually reach the phase of the compiler where this errors out. Could you add a let x: () = 0;
line with //~ ERROR: mismatched types
attached to it and remove the rustc_error
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the tip. Am getting the error locally now, with & without the mir option.
Have pushed the fix.
e1b59c6
to
c4570a7
Compare
Thanks! @bors r+ rollup |
📌 Commit c4570a7 has been approved by |
@bors r- Travis failed |
The $ build/x86_64-unknown-linux-gnu/stage2/bin/rustc src/test/compile-fail/issue-37665.rs \
-L build/x86_64-unknown-linux-gnu/test/compile-fail --target=x86_64-unknown-linux-gnu --error-format json \
-L build/x86_64-unknown-linux-gnu/test/compile-fail/issue-37665.stage2-x86_64-unknown-linux-gnu.compile-fail.libaux \
-C prefer-dynamic -o build/x86_64-unknown-linux-gnu/test/compile-fail/issue-37665.stage2-x86_64-unknown-linux-gnu \
-Crpath -O -Lnative=build/x86_64-unknown-linux-gnu/native/rust-test-helpers -Z unstable-options --unpretty=mir
$ echo $?
0
$ build/x86_64-unknown-linux-gnu/stage2/bin/rustc src/test/compile-fail/issue-37665.rs \
-L build/x86_64-unknown-linux-gnu/test/compile-fail --target=x86_64-unknown-linux-gnu --error-format json \
-L build/x86_64-unknown-linux-gnu/test/compile-fail/issue-37665.stage2-x86_64-unknown-linux-gnu.compile-fail.libaux \
-C prefer-dynamic -o build/x86_64-unknown-linux-gnu/test/compile-fail/issue-37665.stage2-x86_64-unknown-linux-gnu \
-Crpath -O -Lnative=build/x86_64-unknown-linux-gnu/native/rust-test-helpers -Z unstable-options
{"message":"compilation successful","code":null,"level":"error","spans":[{"file_name":"src/test/compile-fail/issue-37665.rs","byte_start":594,"byte_end":743,"line_start":18,"line_end":22,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"fn main() { //~ ERROR compilation successful","highlight_start":1,"highlight_end":45},{"text":" let mut foo : String = \"hello\".to_string();","highlight_start":1,"highlight_end":48},{"text":" foo.push(MAIN_SEPARATOR);","highlight_start":1,"highlight_end":30},{"text":" println!(\"{}\", foo);","highlight_start":1,"highlight_end":25},{"text":"}","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":null,"expansion":null}],"children":[],"rendered":null}
$ echo $?
101 |
Right, I think the fix I suggested here: #42230 (comment) should help. |
regression test for rust-lang#37550
c4570a7
to
2160b4a
Compare
@bors r+ rollup |
📌 Commit 2160b4a has been approved by |
…=Mark-Simulacrum regression tests for ICEs closes rust-lang#36379 closes rust-lang#37550 closes rust-lang#37665 closes rust-lang#38160 closes rust-lang#38954 closes rust-lang#39362 r? @Mark-Simulacrum
…=Mark-Simulacrum regression tests for ICEs closes rust-lang#36379 closes rust-lang#37550 closes rust-lang#37665 closes rust-lang#38160 closes rust-lang#38954 closes rust-lang#39362 r? @Mark-Simulacrum
…=Mark-Simulacrum regression tests for ICEs closes rust-lang#36379 closes rust-lang#37550 closes rust-lang#37665 closes rust-lang#38160 closes rust-lang#38954 closes rust-lang#39362 r? @Mark-Simulacrum
closes #36379
closes #37550
closes #37665
closes #38160
closes #38954
closes #39362
r? @Mark-Simulacrum