mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 09:14:20 +00:00
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:
commit
4c162a1cc6
@ -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
|
15
src/test/ui/const-generics/issues/issue-96654.rs
Normal file
15
src/test/ui/const-generics/issues/issue-96654.rs
Normal 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() {}
|
Loading…
Reference in New Issue
Block a user