File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed
src/test/ui/const-generics Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change
1
+ // check-pass
2
+ // revisions: full min
3
+ #![ cfg_attr( full, feature( const_generics) ) ]
4
+ #![ cfg_attr( full, allow( incomplete_features) ) ]
5
+ #![ cfg_attr( min, feature( min_const_generics) ) ]
6
+
7
+ trait Bar < const N : usize > { fn bar ( ) { } }
8
+ trait Foo < const N : usize > : Bar < N > { }
9
+
10
+ fn test < T , const N : usize > ( ) where T : Foo < N > {
11
+ <T as Bar < N > >:: bar ( ) ;
12
+ }
13
+
14
+ struct Faz < const N : usize > ;
15
+
16
+ impl < const N : usize > Faz < N > {
17
+ fn test < T > ( ) where T : Foo < N > {
18
+ <T as Bar < N > >:: bar ( )
19
+ }
20
+ }
21
+
22
+ trait Fiz < const N : usize > {
23
+ fn fiz < T > ( ) where T : Foo < N > {
24
+ <T as Bar < N > >:: bar ( ) ;
25
+ }
26
+ }
27
+
28
+ impl < const N : usize > Bar < N > for u8 { }
29
+ impl < const N : usize > Foo < N > for u8 { }
30
+ impl < const N : usize > Fiz < N > for u8 { }
31
+ fn main ( ) {
32
+ test :: < u8 , 13 > ( ) ;
33
+ Faz :: < 3 > :: test :: < u8 > ( ) ;
34
+ <u8 as Fiz < 13 > >:: fiz :: < u8 > ( ) ;
35
+ }
You can’t perform that action at this time.
0 commit comments