-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Add --pass $mode
to compiletest through ./x.py
#61755
Merged
+194
−88
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
a56a6d7
bootstrap: pass '--pass' on to compiletest.
Centril 54337fa
compiletest: support '--pass check' and '// ignore-pass'.
Centril e364eb4
add '// ignore-pass' where applicable.
Centril e4e0f95
promoted_errors: warn -> deny.
Centril 5baac07
lint-type-overflow2: warn -> deny.
Centril 5eaedda
Address review comments.
Centril a60bbb0
--bless you.
Centril 93077f3
Hash force_pass_mode when config.mode == Pretty.
Centril File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,23 @@ | ||
#![warn(const_err)] | ||
|
||
// compile-pass | ||
// compile-flags: -O | ||
|
||
#![deny(const_err)] | ||
|
||
fn main() { | ||
println!("{}", 0u32 - 1); | ||
let _x = 0u32 - 1; | ||
//~^ WARN const_err | ||
//~^ ERROR this expression will panic at runtime [const_err] | ||
println!("{}", 1/(1-1)); | ||
//~^ WARN const_err | ||
//~^ ERROR this expression will panic at runtime [const_err] | ||
//~| ERROR attempt to divide by zero [const_err] | ||
//~| ERROR reaching this expression at runtime will panic or abort [const_err] | ||
let _x = 1/(1-1); | ||
//~^ WARN const_err | ||
//~| WARN const_err | ||
//~^ ERROR const_err | ||
//~| ERROR const_err | ||
println!("{}", 1/(false as u32)); | ||
//~^ WARN const_err | ||
//~^ ERROR this expression will panic at runtime [const_err] | ||
//~| ERROR attempt to divide by zero [const_err] | ||
//~| ERROR reaching this expression at runtime will panic or abort [const_err] | ||
let _x = 1/(false as u32); | ||
//~^ WARN const_err | ||
//~| WARN const_err | ||
//~^ ERROR const_err | ||
//~| ERROR const_err | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,74 @@ | ||
warning: this expression will panic at runtime | ||
error: this expression will panic at runtime | ||
--> $DIR/promoted_errors.rs:7:14 | ||
| | ||
LL | let _x = 0u32 - 1; | ||
| ^^^^^^^^ attempt to subtract with overflow | ||
| | ||
note: lint level defined here | ||
--> $DIR/promoted_errors.rs:1:9 | ||
--> $DIR/promoted_errors.rs:3:9 | ||
| | ||
LL | #![warn(const_err)] | ||
LL | #![deny(const_err)] | ||
| ^^^^^^^^^ | ||
|
||
warning: attempt to divide by zero | ||
error: attempt to divide by zero | ||
--> $DIR/promoted_errors.rs:9:20 | ||
| | ||
LL | println!("{}", 1/(1-1)); | ||
| ^^^^^^^ | ||
|
||
warning: this expression will panic at runtime | ||
error: this expression will panic at runtime | ||
--> $DIR/promoted_errors.rs:9:20 | ||
| | ||
LL | println!("{}", 1/(1-1)); | ||
| ^^^^^^^ attempt to divide by zero | ||
|
||
warning: attempt to divide by zero | ||
--> $DIR/promoted_errors.rs:11:14 | ||
error: attempt to divide by zero | ||
--> $DIR/promoted_errors.rs:13:14 | ||
| | ||
LL | let _x = 1/(1-1); | ||
| ^^^^^^^ | ||
|
||
warning: this expression will panic at runtime | ||
--> $DIR/promoted_errors.rs:11:14 | ||
error: this expression will panic at runtime | ||
--> $DIR/promoted_errors.rs:13:14 | ||
| | ||
LL | let _x = 1/(1-1); | ||
| ^^^^^^^ attempt to divide by zero | ||
|
||
warning: attempt to divide by zero | ||
--> $DIR/promoted_errors.rs:14:20 | ||
error: attempt to divide by zero | ||
--> $DIR/promoted_errors.rs:16:20 | ||
| | ||
LL | println!("{}", 1/(false as u32)); | ||
| ^^^^^^^^^^^^^^^^ | ||
|
||
warning: this expression will panic at runtime | ||
--> $DIR/promoted_errors.rs:14:20 | ||
error: this expression will panic at runtime | ||
--> $DIR/promoted_errors.rs:16:20 | ||
| | ||
LL | println!("{}", 1/(false as u32)); | ||
| ^^^^^^^^^^^^^^^^ attempt to divide by zero | ||
|
||
warning: attempt to divide by zero | ||
--> $DIR/promoted_errors.rs:16:14 | ||
error: attempt to divide by zero | ||
--> $DIR/promoted_errors.rs:20:14 | ||
| | ||
LL | let _x = 1/(false as u32); | ||
| ^^^^^^^^^^^^^^^^ | ||
|
||
warning: this expression will panic at runtime | ||
--> $DIR/promoted_errors.rs:16:14 | ||
error: this expression will panic at runtime | ||
--> $DIR/promoted_errors.rs:20:14 | ||
| | ||
LL | let _x = 1/(false as u32); | ||
| ^^^^^^^^^^^^^^^^ attempt to divide by zero | ||
|
||
warning: reaching this expression at runtime will panic or abort | ||
--> $DIR/promoted_errors.rs:14:20 | ||
error: reaching this expression at runtime will panic or abort | ||
--> $DIR/promoted_errors.rs:16:20 | ||
| | ||
LL | println!("{}", 1/(false as u32)); | ||
| ^^^^^^^^^^^^^^^^ attempt to divide by zero | ||
|
||
warning: reaching this expression at runtime will panic or abort | ||
error: reaching this expression at runtime will panic or abort | ||
--> $DIR/promoted_errors.rs:9:20 | ||
| | ||
LL | println!("{}", 1/(1-1)); | ||
| ^^^^^^^ attempt to divide by zero | ||
|
||
error: aborting due to 11 previous errors | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,13 @@ | ||
// compile-flags: -O | ||
#![warn(overflowing_literals)] | ||
#![warn(const_err)] | ||
// compile-pass | ||
|
||
#[allow(unused_variables)] | ||
#![deny(overflowing_literals)] | ||
#![deny(const_err)] | ||
|
||
fn main() { | ||
let x2: i8 = --128; //~ warn: literal out of range for i8 | ||
let x2: i8 = --128; //~ ERROR literal out of range for `i8` | ||
|
||
let x = -3.40282357e+38_f32; //~ warn: literal out of range for f32 | ||
let x = 3.40282357e+38_f32; //~ warn: literal out of range for f32 | ||
let x = -1.7976931348623159e+308_f64; //~ warn: literal out of range for f64 | ||
let x = 1.7976931348623159e+308_f64; //~ warn: literal out of range for f64 | ||
let x = -3.40282357e+38_f32; //~ ERROR literal out of range for `f32` | ||
let x = 3.40282357e+38_f32; //~ ERROR literal out of range for `f32` | ||
let x = -1.7976931348623159e+308_f64; //~ ERROR literal out of range for `f64` | ||
let x = 1.7976931348623159e+308_f64; //~ ERROR literal out of range for `f64` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,38 @@ | ||
warning: literal out of range for `i8` | ||
--> $DIR/lint-type-overflow2.rs:9:20 | ||
error: literal out of range for `i8` | ||
--> $DIR/lint-type-overflow2.rs:7:20 | ||
| | ||
LL | let x2: i8 = --128; | ||
| ^^^ | ||
| | ||
note: lint level defined here | ||
--> $DIR/lint-type-overflow2.rs:2:9 | ||
--> $DIR/lint-type-overflow2.rs:3:9 | ||
| | ||
LL | #![warn(overflowing_literals)] | ||
LL | #![deny(overflowing_literals)] | ||
| ^^^^^^^^^^^^^^^^^^^^ | ||
|
||
warning: literal out of range for `f32` | ||
--> $DIR/lint-type-overflow2.rs:11:14 | ||
error: literal out of range for `f32` | ||
--> $DIR/lint-type-overflow2.rs:9:14 | ||
| | ||
LL | let x = -3.40282357e+38_f32; | ||
| ^^^^^^^^^^^^^^^^^^ | ||
|
||
warning: literal out of range for `f32` | ||
--> $DIR/lint-type-overflow2.rs:12:14 | ||
error: literal out of range for `f32` | ||
--> $DIR/lint-type-overflow2.rs:10:14 | ||
| | ||
LL | let x = 3.40282357e+38_f32; | ||
| ^^^^^^^^^^^^^^^^^^ | ||
|
||
warning: literal out of range for `f64` | ||
--> $DIR/lint-type-overflow2.rs:13:14 | ||
error: literal out of range for `f64` | ||
--> $DIR/lint-type-overflow2.rs:11:14 | ||
| | ||
LL | let x = -1.7976931348623159e+308_f64; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
warning: literal out of range for `f64` | ||
--> $DIR/lint-type-overflow2.rs:14:14 | ||
error: literal out of range for `f64` | ||
--> $DIR/lint-type-overflow2.rs:12:14 | ||
| | ||
LL | let x = 1.7976931348623159e+308_f64; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
warning: this expression will panic at runtime | ||
--> $DIR/lint-type-overflow2.rs:9:18 | ||
| | ||
LL | let x2: i8 = --128; | ||
| ^^^^^ attempt to negate with overflow | ||
| | ||
note: lint level defined here | ||
--> $DIR/lint-type-overflow2.rs:3:9 | ||
| | ||
LL | #![warn(const_err)] | ||
| ^^^^^^^^^ | ||
error: aborting due to 5 previous errors | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
// run-pass | ||
// force-host | ||
// no-prefer-dynamic | ||
// ignore-pass | ||
|
||
#![crate_type = "proc-macro"] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
// compile-pass | ||
// compile-flags: -Zsave-analysis -Zemit-artifact-notifications | ||
// compile-flags: --crate-type rlib --error-format=json | ||
// ignore-pass | ||
// ^-- needed because otherwise, the .stderr file changes with --pass check | ||
|
||
pub fn foo() {} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Pass annotations in
auxiliary
files?What the hell.
What do they even mean?
compiletest
should catch them and report an 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.
I have... no idea :)