Skip to content

Commit b5a9f6a

Browse files
Update rustdoc test to check its error output
1 parent 0669379 commit b5a9f6a

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/test/rustdoc/const-evalutation-ice.rs renamed to src/test/rustdoc-ui/const-evalutation-ice.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ pub struct S {
77
s: Cell<usize>
88
}
99

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

0 commit comments

Comments
 (0)