|
| 1 | +error: the constant `B` is not of type `usize` |
| 2 | + --> $DIR/check_const_arg_type_in_free_alias.rs:15:1 |
| 3 | + | |
| 4 | +LL | type ArrLen<const B: bool> = [(); B]; |
| 5 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `bool` |
| 6 | + | |
| 7 | + = note: the length of array `[(); B]` must be type `usize` |
| 8 | + |
| 9 | +error[E0308]: mismatched types |
| 10 | + --> $DIR/check_const_arg_type_in_free_alias.rs:17:24 |
| 11 | + | |
| 12 | +LL | type AnonArrLen = [(); true]; |
| 13 | + | ^^^^ expected `usize`, found `bool` |
| 14 | + |
| 15 | +error: the constant `B` is not of type `usize` |
| 16 | + --> $DIR/check_const_arg_type_in_free_alias.rs:19:1 |
| 17 | + | |
| 18 | +LL | type ConstArg<const B: bool> = Foo<B>; |
| 19 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `bool` |
| 20 | + | |
| 21 | +note: required by a const generic parameter in `Foo` |
| 22 | + --> $DIR/check_const_arg_type_in_free_alias.rs:13:12 |
| 23 | + | |
| 24 | +LL | struct Foo<const N: usize>; |
| 25 | + | ^^^^^^^^^^^^^^ required by this const generic parameter in `Foo` |
| 26 | + |
| 27 | +error[E0308]: mismatched types |
| 28 | + --> $DIR/check_const_arg_type_in_free_alias.rs:21:25 |
| 29 | + | |
| 30 | +LL | type AnonConstArg = Foo<true>; |
| 31 | + | ^^^^ expected `usize`, found `bool` |
| 32 | + |
| 33 | +error: the constant `B` is not of type `usize` |
| 34 | + --> $DIR/check_const_arg_type_in_free_alias.rs:32:1 |
| 35 | + | |
| 36 | +LL | type Alias<const B: bool> = <() as IdentityWithUnused<B>>::This; |
| 37 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `bool` |
| 38 | + | |
| 39 | +note: required for `()` to implement `IdentityWithUnused<B>` |
| 40 | + --> $DIR/check_const_arg_type_in_free_alias.rs:28:25 |
| 41 | + | |
| 42 | +LL | impl<T, const N: usize> IdentityWithUnused<N> for T { |
| 43 | + | -------------- ^^^^^^^^^^^^^^^^^^^^^ ^ |
| 44 | + | | |
| 45 | + | unsatisfied trait bound introduced here |
| 46 | + |
| 47 | +error[E0308]: mismatched types |
| 48 | + --> $DIR/check_const_arg_type_in_free_alias.rs:34:44 |
| 49 | + | |
| 50 | +LL | type AnonAlias = <() as IdentityWithUnused<true>>::This; |
| 51 | + | ^^^^ expected `usize`, found `bool` |
| 52 | + |
| 53 | +error: the constant `B` is not of type `usize` |
| 54 | + --> $DIR/check_const_arg_type_in_free_alias.rs:38:1 |
| 55 | + | |
| 56 | +LL | type UseFree<const B: bool> = Free<B>; |
| 57 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `bool` |
| 58 | + | |
| 59 | +note: required by a bound on the type alias `Free` |
| 60 | + --> $DIR/check_const_arg_type_in_free_alias.rs:37:11 |
| 61 | + | |
| 62 | +LL | type Free<const N: usize> = [(); N]; |
| 63 | + | ^^^^^^^^^^^^^^ required by this bound |
| 64 | + |
| 65 | +error[E0308]: mismatched types |
| 66 | + --> $DIR/check_const_arg_type_in_free_alias.rs:40:25 |
| 67 | + | |
| 68 | +LL | type AnonUseFree = Free<true>; |
| 69 | + | ^^^^ expected `usize`, found `bool` |
| 70 | + |
| 71 | +error: the constant `N` is not of type `bool` |
| 72 | + --> $DIR/check_const_arg_type_in_free_alias.rs:51:1 |
| 73 | + | |
| 74 | +LL | type UseFreeIndirectlyCorrect<const N: usize> = UseFree<N>; |
| 75 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `usize` |
| 76 | + | |
| 77 | +note: required by a bound on the type alias `UseFree` |
| 78 | + --> $DIR/check_const_arg_type_in_free_alias.rs:38:14 |
| 79 | + | |
| 80 | +LL | type UseFree<const B: bool> = Free<B>; |
| 81 | + | ^^^^^^^^^^^^^ required by this bound |
| 82 | + |
| 83 | +error[E0308]: mismatched types |
| 84 | + --> $DIR/check_const_arg_type_in_free_alias.rs:53:45 |
| 85 | + | |
| 86 | +LL | type AnonUseFreeIndirectlyCorrect = UseFree<1_usize>; |
| 87 | + | ^^^^^^^ expected `bool`, found `usize` |
| 88 | + |
| 89 | +error: the constant `B` is not of type `usize` |
| 90 | + --> $DIR/check_const_arg_type_in_free_alias.rs:58:1 |
| 91 | + | |
| 92 | +LL | type IndirectArr<const B: bool> = Wrap<Wrap<[(); B]>>; |
| 93 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `bool` |
| 94 | + | |
| 95 | + = note: the length of array `[(); B]` must be type `usize` |
| 96 | + |
| 97 | +error[E0308]: mismatched types |
| 98 | + --> $DIR/check_const_arg_type_in_free_alias.rs:60:39 |
| 99 | + | |
| 100 | +LL | type AnonIndirectArr = Wrap<Wrap<[(); true]>>; |
| 101 | + | ^^^^ expected `usize`, found `bool` |
| 102 | + |
| 103 | +error: the constant `B` is not of type `usize` |
| 104 | + --> $DIR/check_const_arg_type_in_free_alias.rs:62:1 |
| 105 | + | |
| 106 | +LL | type IndirectConstArg<const B: bool> = Wrap<Wrap<Foo<B>>>; |
| 107 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `bool` |
| 108 | + | |
| 109 | +note: required by a const generic parameter in `Foo` |
| 110 | + --> $DIR/check_const_arg_type_in_free_alias.rs:13:12 |
| 111 | + | |
| 112 | +LL | struct Foo<const N: usize>; |
| 113 | + | ^^^^^^^^^^^^^^ required by this const generic parameter in `Foo` |
| 114 | + |
| 115 | +error[E0308]: mismatched types |
| 116 | + --> $DIR/check_const_arg_type_in_free_alias.rs:64:43 |
| 117 | + | |
| 118 | +LL | type AnonIndirectConstArg = Wrap<Wrap<Foo<true>>>; |
| 119 | + | ^^^^ expected `usize`, found `bool` |
| 120 | + |
| 121 | +error: aborting due to 14 previous errors |
| 122 | + |
| 123 | +For more information about this error, try `rustc --explain E0308`. |
0 commit comments