Skip to content

Commit 4c162a1

Browse files
authored
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.
2 parents e825715 + 2c9074b commit 4c162a1

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

src/test/ui/const-generics/issues/issue-775377.stderr renamed to src/test/ui/const-generics/issues/issue-77357.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: overly complex generic constant
2-
--> $DIR/issue-775377.rs:6:46
2+
--> $DIR/issue-77357.rs:6:46
33
|
44
LL | fn bug<'a, T>() -> &'static dyn MyTrait<[(); { |x: &'a u32| { x }; 4 }]> {
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^ blocks are not supported in generic constant
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// check-pass
2+
3+
struct A<const M: u32> {}
4+
5+
struct B<const M: u32> {}
6+
7+
impl<const M: u32> B<M> {
8+
const M: u32 = M;
9+
}
10+
11+
struct C<const M: u32> {
12+
a: A<{ B::<1>::M }>,
13+
}
14+
15+
fn main() {}

0 commit comments

Comments
 (0)