diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-12-03 07:48:34 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-03 07:48:34 +0100 |
| commit | 8ae11145cefdd3cf3fe693ca871a29c91050ab82 (patch) | |
| tree | 13c5bc3c8acb78642717d0e5e739014c42d6b0d7 | |
| parent | 68279097d478433ecba15d1823bef2d0fdc4107c (diff) | |
| parent | 3b2ff90529ec6c24d87a7a163ed6acf70acfe4b3 (diff) | |
| download | rust-8ae11145cefdd3cf3fe693ca871a29c91050ab82.tar.gz rust-8ae11145cefdd3cf3fe693ca871a29c91050ab82.zip | |
Rollup merge of #133785 - HypheX:add-ui-test, r=compiler-errors
Add const evaluation error UI test. This closes #78834
| -rw-r--r-- | tests/ui/consts/const-eval-fail-too-big.rs | 12 | ||||
| -rw-r--r-- | tests/ui/consts/const-eval-fail-too-big.stderr | 9 |
2 files changed, 21 insertions, 0 deletions
diff --git a/tests/ui/consts/const-eval-fail-too-big.rs b/tests/ui/consts/const-eval-fail-too-big.rs new file mode 100644 index 00000000000..4b5dbc1d7a4 --- /dev/null +++ b/tests/ui/consts/const-eval-fail-too-big.rs @@ -0,0 +1,12 @@ +//Error output test for #78834: Type is too big for the target architecture +struct B< + A: Sized = [(); { + let x = [0u8; !0usize]; + //~^ ERROR evaluation of constant value failed + 1 + }], +> { + a: A, +} + +fn main() {} diff --git a/tests/ui/consts/const-eval-fail-too-big.stderr b/tests/ui/consts/const-eval-fail-too-big.stderr new file mode 100644 index 00000000000..ae666483233 --- /dev/null +++ b/tests/ui/consts/const-eval-fail-too-big.stderr @@ -0,0 +1,9 @@ +error[E0080]: evaluation of constant value failed + --> $DIR/const-eval-fail-too-big.rs:4:28 + | +LL | let x = [0u8; !0usize]; + | ^^^^^^^^^^^^^^ values of the type `[u8; usize::MAX]` are too big for the target architecture + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0080`. |
