diff options
| author | bors <bors@rust-lang.org> | 2018-10-26 11:05:00 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-10-26 11:05:00 +0000 |
| commit | 694cf752988728ba5da85c36c2deaeefeb49c05e (patch) | |
| tree | f2501734f55b37ac50bf5604a897c939ccfdc996 /src/test/ui/error-codes | |
| parent | 82239b04dc9cea1d54422c2fb223ff5321ccafdd (diff) | |
| parent | 13d94ee1154770caa8e027394fa2221db2dfe5c3 (diff) | |
| download | rust-694cf752988728ba5da85c36c2deaeefeb49c05e.tar.gz rust-694cf752988728ba5da85c36c2deaeefeb49c05e.zip | |
Auto merge of #53821 - oli-obk:sanity_query, r=RalfJung
Report const eval error inside the query Functional changes: We no longer warn about bad constants embedded in unused types. This relied on being able to report just a warning, not a hard error on that case, which we cannot do any more now that error reporting is consistently centralized. r? @RalfJung fixes #53561
Diffstat (limited to 'src/test/ui/error-codes')
| -rw-r--r-- | src/test/ui/error-codes/E0080.rs | 3 | ||||
| -rw-r--r-- | src/test/ui/error-codes/E0080.stderr | 28 | ||||
| -rw-r--r-- | src/test/ui/error-codes/E0396-fixed.rs | 2 | ||||
| -rw-r--r-- | src/test/ui/error-codes/E0396-fixed.stderr | 2 |
4 files changed, 5 insertions, 30 deletions
diff --git a/src/test/ui/error-codes/E0080.rs b/src/test/ui/error-codes/E0080.rs index 7f3e6eaad9b..2ab15dfedca 100644 --- a/src/test/ui/error-codes/E0080.rs +++ b/src/test/ui/error-codes/E0080.rs @@ -12,9 +12,6 @@ enum Enum { X = (1 << 500), //~ ERROR E0080 //~| shift left with overflow Y = (1 / 0) //~ ERROR E0080 - //~| const_err - //~| const_err - //~| const_err } fn main() { diff --git a/src/test/ui/error-codes/E0080.stderr b/src/test/ui/error-codes/E0080.stderr index a213c2b1b20..e60c905587d 100644 --- a/src/test/ui/error-codes/E0080.stderr +++ b/src/test/ui/error-codes/E0080.stderr @@ -1,37 +1,15 @@ -error: attempt to shift left with overflow - --> $DIR/E0080.rs:12:9 - | -LL | X = (1 << 500), //~ ERROR E0080 - | ^^^^^^^^^^ - | - = note: #[deny(exceeding_bitshifts)] on by default - -error[E0080]: could not evaluate enum discriminant +error[E0080]: evaluation of constant value failed --> $DIR/E0080.rs:12:9 | LL | X = (1 << 500), //~ ERROR E0080 | ^^^^^^^^^^ attempt to shift left with overflow -error: attempt to divide by zero - --> $DIR/E0080.rs:14:9 - | -LL | Y = (1 / 0) //~ ERROR E0080 - | ^^^^^^^ - | - = note: #[deny(const_err)] on by default - -error: this expression will panic at runtime - --> $DIR/E0080.rs:14:9 - | -LL | Y = (1 / 0) //~ ERROR E0080 - | ^^^^^^^ attempt to divide by zero - -error[E0080]: could not evaluate enum discriminant +error[E0080]: evaluation of constant value failed --> $DIR/E0080.rs:14:9 | LL | Y = (1 / 0) //~ ERROR E0080 | ^^^^^^^ attempt to divide by zero -error: aborting due to 5 previous errors +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0080`. diff --git a/src/test/ui/error-codes/E0396-fixed.rs b/src/test/ui/error-codes/E0396-fixed.rs index 08d20e7850d..005f2c36688 100644 --- a/src/test/ui/error-codes/E0396-fixed.rs +++ b/src/test/ui/error-codes/E0396-fixed.rs @@ -13,7 +13,7 @@ const REG_ADDR: *const u8 = 0x5f3759df as *const u8; const VALUE: u8 = unsafe { *REG_ADDR }; -//~^ ERROR this constant cannot be used +//~^ ERROR any use of this value will cause an error fn main() { } diff --git a/src/test/ui/error-codes/E0396-fixed.stderr b/src/test/ui/error-codes/E0396-fixed.stderr index 7d3c98c8ea8..e868d5a33fa 100644 --- a/src/test/ui/error-codes/E0396-fixed.stderr +++ b/src/test/ui/error-codes/E0396-fixed.stderr @@ -1,4 +1,4 @@ -error: this constant cannot be used +error: any use of this value will cause an error --> $DIR/E0396-fixed.rs:15:1 | LL | const VALUE: u8 = unsafe { *REG_ADDR }; |
