-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Convert run-pass tests with trivial main to build-pass. #119484
Conversation
(rustbot has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
Multiple entry points (under
Potentially testing if built executable works:
|
// run-pass | ||
#![allow(dead_code)] | ||
#![allow(unused_mut)] | ||
#![allow(unused_imports)] |
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 assume you used some script or regex to remove the attributes.
Could you tweak it to remove lines entirely, instead of leaving empty lines?
|
||
#![feature(coroutines)] | ||
|
||
fn _run(bar: &mut i32) { | ||
|| { //~ WARN unused coroutine that must be used |
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.
Maybe it makes sense to add #[warn(...)]
attributes to keep the warnings when they are significant.
@@ -1,4 +1,4 @@ | |||
// run-pass | |||
// build-pass |
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.
False positive, the empty main
is under cfg
.
Many of these can probably be Also need to double check any tests involving potential life before and after main - global variables with constructors/destructors, |
// run-pass | ||
// build-pass |
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.
this main is not very trivial
@@ -1,4 +1,4 @@ | |||
// run-pass |
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.
This tests dynamic linking. The original issue #12133 also looks like it encountered issue at runtime.
I'm concerned that these changes are applied too broadly and some other subtle things that happen before/after main are being missed.
I should really avoid filing PR 30mins before new year. Thankfully that happens only once a year. |
If
main
is empty, having a run-pass test does not bring anything more than a build-pass one.