Skip to content

Commit

Permalink
Rollup merge of #96830 - JohnTitor:issue-96654, r=compiler-errors
Browse files Browse the repository at this point in the history
Add and tweak const-generics tests

Closes #96654
Also correct the src/test/ui/const-generics/issues/issue-77357.rs test's issue number.
  • Loading branch information
matthiaskrgr authored May 8, 2022
2 parents e825715 + 2c9074b commit 4c162a1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: overly complex generic constant
--> $DIR/issue-775377.rs:6:46
--> $DIR/issue-77357.rs:6:46
|
LL | fn bug<'a, T>() -> &'static dyn MyTrait<[(); { |x: &'a u32| { x }; 4 }]> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^ blocks are not supported in generic constant
Expand Down
15 changes: 15 additions & 0 deletions src/test/ui/const-generics/issues/issue-96654.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// check-pass

struct A<const M: u32> {}

struct B<const M: u32> {}

impl<const M: u32> B<M> {
const M: u32 = M;
}

struct C<const M: u32> {
a: A<{ B::<1>::M }>,
}

fn main() {}

0 comments on commit 4c162a1

Please sign in to comment.