Rollup merge of #96830 - JohnTitor:issue-96654, r=compiler-errors

Add and tweak const-generics tests

Closes #96654
Also correct the src/test/ui/const-generics/issues/issue-77357.rs test's issue number.
This commit is contained in:
Matthias Krüger 2022-05-08 21:31:19 +02:00 committed by GitHub
commit 4c162a1cc6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 1 deletions

View File

@ -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

View File

@ -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() {}