diff options
| author | Boxy <supbscripter@gmail.com> | 2024-07-02 17:07:21 +0100 |
|---|---|---|
| committer | Boxy <supbscripter@gmail.com> | 2024-07-02 17:07:21 +0100 |
| commit | 8ce8c62f1e908ffb7edec993cb5e6cbafe4d620c (patch) | |
| tree | 06a4db06eb469bb42595bb67aab56408b9daa553 | |
| parent | 7d97c59438e933e86f557ed999da3b8dfc6855a7 (diff) | |
| download | rust-8ce8c62f1e908ffb7edec993cb5e6cbafe4d620c.tar.gz rust-8ce8c62f1e908ffb7edec993cb5e6cbafe4d620c.zip | |
add test
| -rw-r--r-- | tests/ui/const-generics/generic_const_exprs/adt_wf_hang.rs | 14 | ||||
| -rw-r--r-- | tests/ui/const-generics/generic_const_exprs/adt_wf_hang.stderr | 18 |
2 files changed, 32 insertions, 0 deletions
diff --git a/tests/ui/const-generics/generic_const_exprs/adt_wf_hang.rs b/tests/ui/const-generics/generic_const_exprs/adt_wf_hang.rs new file mode 100644 index 00000000000..5d538d2679d --- /dev/null +++ b/tests/ui/const-generics/generic_const_exprs/adt_wf_hang.rs @@ -0,0 +1,14 @@ +#![feature(generic_const_exprs)] +#![feature(adt_const_params)] +#![allow(incomplete_features)] +#![allow(dead_code)] + +#[derive(PartialEq, Eq)] +struct U; + +struct S<const N: U>() +where + S<{ U }>:; +//~^ ERROR: overflow evaluating the requirement `S<{ U }> well-formed` + +fn main() {} diff --git a/tests/ui/const-generics/generic_const_exprs/adt_wf_hang.stderr b/tests/ui/const-generics/generic_const_exprs/adt_wf_hang.stderr new file mode 100644 index 00000000000..b244acb37dd --- /dev/null +++ b/tests/ui/const-generics/generic_const_exprs/adt_wf_hang.stderr @@ -0,0 +1,18 @@ +error[E0275]: overflow evaluating the requirement `S<{ U }> well-formed` + --> $DIR/adt_wf_hang.rs:11:5 + | +LL | S<{ U }>:; + | ^^^^^^^^ + | +note: required by a bound in `S` + --> $DIR/adt_wf_hang.rs:11:5 + | +LL | struct S<const N: U>() + | - required by a bound in this struct +LL | where +LL | S<{ U }>:; + | ^^^^^^^^ required by this bound in `S` + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0275`. |
