Update rustdoc test to check its error output

This commit is contained in:
Guillaume Gomez 2022-12-07 16:08:58 +01:00
parent 06693790ce
commit b5a9f6a537
2 changed files with 11 additions and 1 deletions

View file

@ -7,4 +7,5 @@ pub struct S {
s: Cell<usize>
}
pub const N: usize = 0 - (mem::size_of::<S>() != 4) as usize;
pub const N: usize = 0 - (mem::size_of::<S>() != 400) as usize;
//~^ ERROR evaluation of constant value failed

View file

@ -0,0 +1,9 @@
error[E0080]: evaluation of constant value failed
--> $DIR/const-evalutation-ice.rs:10:22
|
LL | pub const N: usize = 0 - (mem::size_of::<S>() != 400) as usize;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `0_usize - 1_usize`, which would overflow
error: aborting due to previous error
For more information about this error, try `rustc --explain E0080`.