Skip to content

Commit

Permalink
Rollup merge of rust-lang#127245 - BoxyUwU:gce_hang_test, r=Nilstrieb
Browse files Browse the repository at this point in the history
Add a test for `generic_const_exprs`

Fixes rust-lang#103770

r? `@Nilstrieb`
  • Loading branch information
matthiaskrgr committed Jul 2, 2024
2 parents 0108a84 + 8ce8c62 commit 7500abf
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/ui/const-generics/generic_const_exprs/adt_wf_hang.rs
Original file line number Diff line number Diff line change
@@ -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() {}
18 changes: 18 additions & 0 deletions tests/ui/const-generics/generic_const_exprs/adt_wf_hang.stderr
Original file line number Diff line number Diff line change
@@ -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`.

0 comments on commit 7500abf

Please sign in to comment.