Skip to content
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

Merged
merged 6 commits into from
May 26, 2017
Merged

Conversation

venkatagiri
Copy link
Contributor

closes #36379
closes #37550
closes #37665
closes #38160
closes #38954
closes #39362

r? @Mark-Simulacrum

@rust-highfive
Copy link
Collaborator

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.

let mut foo : String = "hello".to_string();
foo.push(MAIN_SEPARATOR);
println!("{}", foo);
}
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Member

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?

Copy link
Contributor Author

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.

@Mark-Simulacrum Mark-Simulacrum added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label May 25, 2017
@Mark-Simulacrum
Copy link
Member

Thanks!

@bors r+ rollup

@bors
Copy link
Contributor

bors commented May 25, 2017

📌 Commit c4570a7 has been approved by Mark-Simulacrum

@Mark-Simulacrum
Copy link
Member

@bors r-

Travis failed

@venkatagiri
Copy link
Contributor Author

The --unpretty=mir option is affecting the error being thrown.
With this option, the compilation is succeeding. Even though #[rustc_error] is added.
Removing the mir option, the compilation is failing as expected.

$ 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

@Mark-Simulacrum
Copy link
Member

Right, I think the fix I suggested here: #42230 (comment) should help.

@Mark-Simulacrum
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented May 26, 2017

📌 Commit 2160b4a has been approved by Mark-Simulacrum

Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this pull request May 26, 2017
frewsxcv added a commit to frewsxcv/rust that referenced this pull request May 26, 2017
frewsxcv added a commit to frewsxcv/rust that referenced this pull request May 26, 2017
bors added a commit that referenced this pull request May 26, 2017
Rollup of 7 pull requests

- Successful merges: #42169, #42215, #42216, #42224, #42230, #42236, #42241
- Failed merges:
@bors bors merged commit 2160b4a into rust-lang:master May 26, 2017
@venkatagiri venkatagiri deleted the ice_regression_tests branch May 26, 2017 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
Projects
None yet
4 participants