diff options
| author | Matthias Krüger <476013+matthiaskrgr@users.noreply.github.com> | 2025-07-11 07:35:18 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-11 07:35:18 +0200 |
| commit | 3d6eb225e26448b09fdec1ba7222f3e7174c6ac2 (patch) | |
| tree | 17d044aac71ec4a410ebbb33c8f8349d46d395e1 /tests/ui/consts/const-eval-array-len-in-impl.rs | |
| parent | 2730bebbf88ae9473b339bb7f66eb77fb2c9fa6f (diff) | |
| parent | 3ad95cccf9b3af7e527869a1eb130217971b7a57 (diff) | |
| download | rust-3d6eb225e26448b09fdec1ba7222f3e7174c6ac2.tar.gz rust-3d6eb225e26448b09fdec1ba7222f3e7174c6ac2.zip | |
Rollup merge of #143302 - Kivooeo:tf27, r=tgross35
`tests/ui`: A New Order [27/N] > [!NOTE] > > Intermediate commits are intended to help review, but will be squashed prior to merge. Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang/rust#133895. r? ``@tgross35``
Diffstat (limited to 'tests/ui/consts/const-eval-array-len-in-impl.rs')
| -rw-r--r-- | tests/ui/consts/const-eval-array-len-in-impl.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/ui/consts/const-eval-array-len-in-impl.rs b/tests/ui/consts/const-eval-array-len-in-impl.rs new file mode 100644 index 00000000000..0373274770d --- /dev/null +++ b/tests/ui/consts/const-eval-array-len-in-impl.rs @@ -0,0 +1,15 @@ +//! This checks that compiler correctly evaluate constant array lengths within trait `impl` headers. +//! +//! Regression test for <https://github.com/rust-lang/rust/issues/49208>. + +trait Foo { + fn foo(); +} + +impl Foo for [(); 1] { + fn foo() {} +} + +fn main() { + <[(); 0] as Foo>::foo() //~ ERROR E0277 +} |
