@@ -4,7 +4,7 @@ error: unconstrained generic constant
44LL | fn foo1<const N: usize>() -> HasTrait<HasCastInTraitImpl<{ N + 2}, { N }>> {
55 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66 |
7- = help: try adding a `where` bound using this expression: `where [(); { M + 1 }]:`
7+ = help: try adding a `where` bound using this expression: `where [(); { N + 2 + 1 }]:`
88note: required because of the requirements on the impl of `Trait` for `HasCastInTraitImpl<{ N + 2}, N>`
99 --> $DIR/mismatched-const-errors.rs:6:22
1010 |
@@ -31,7 +31,7 @@ error: unconstrained generic constant
3131LL | fn foo2<const N: usize>() -> HasTrait<HasCastInTraitImpl<{ N + 1}, { N + 1 }>> {
3232 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3333 |
34- = help: try adding a `where` bound using this expression: `where [(); { M + 1 }]:`
34+ = help: try adding a `where` bound using this expression: `where [(); { N + 1 + 1 }]:`
3535note: required because of the requirements on the impl of `Trait` for `HasCastInTraitImpl<{ N + 1}, { N + 1 }>`
3636 --> $DIR/mismatched-const-errors.rs:6:22
3737 |
@@ -58,7 +58,7 @@ error: unconstrained generic constant
5858LL | fn foo3<const N: usize>() -> HasTrait<HasCastInTraitImpl<{ N + 1}, { N - 1}>> {
5959 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6060 |
61- = help: try adding a `where` bound using this expression: `where [(); { M + 1 }]:`
61+ = help: try adding a `where` bound using this expression: `where [(); { N + 1 + 1 }]:`
6262note: required because of the requirements on the impl of `Trait` for `HasCastInTraitImpl<{ N + 1}, { N - 1}>`
6363 --> $DIR/mismatched-const-errors.rs:6:22
6464 |
@@ -80,12 +80,12 @@ LL | fn foo3<const N: usize>() -> HasTrait<HasCastInTraitImpl<{ N + 1}, { N - 1}
8080 found type `{ N + 1 + 1 }`
8181
8282error: unconstrained generic constant
83- --> $DIR/mismatched-const-errors.rs:28 :44
83+ --> $DIR/mismatched-const-errors.rs:27 :44
8484 |
8585LL | fn foo4<const N: usize>(c : [usize; N]) -> HasTrait<HasCastInTraitImpl<{ N - 1}, { N }>> {
8686 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8787 |
88- = help: try adding a `where` bound using this expression: `where [(); { M + 1 }]:`
88+ = help: try adding a `where` bound using this expression: `where [(); { N - 1 + 1 }]:`
8989note: required because of the requirements on the impl of `Trait` for `HasCastInTraitImpl<{ N - 1}, N>`
9090 --> $DIR/mismatched-const-errors.rs:6:22
9191 |
@@ -98,7 +98,7 @@ LL | pub struct HasTrait<T: Trait>(T);
9898 | ^^^^^ required by this bound in `HasTrait`
9999
100100error[E0308]: mismatched types
101- --> $DIR/mismatched-const-errors.rs:28 :44
101+ --> $DIR/mismatched-const-errors.rs:27 :44
102102 |
103103LL | fn foo4<const N: usize>(c : [usize; N]) -> HasTrait<HasCastInTraitImpl<{ N - 1}, { N }>> {
104104 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `N`, found `{ N - 1 + 1 }`
@@ -107,12 +107,12 @@ LL | fn foo4<const N: usize>(c : [usize; N]) -> HasTrait<HasCastInTraitImpl<{ N
107107 found type `{ N - 1 + 1 }`
108108
109109error: unconstrained generic constant
110- --> $DIR/mismatched-const-errors.rs:34 :30
110+ --> $DIR/mismatched-const-errors.rs:33 :30
111111 |
112112LL | fn foo5<const N: usize>() -> HasTrait<HasCastInTraitImpl<{ N + N }, { 2 * N }>> {
113113 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
114114 |
115- = help: try adding a `where` bound using this expression: `where [(); { M + 1 }]:`
115+ = help: try adding a `where` bound using this expression: `where [(); { N + N + 1 }]:`
116116note: required because of the requirements on the impl of `Trait` for `HasCastInTraitImpl<{ N + N }, { 2 * N }>`
117117 --> $DIR/mismatched-const-errors.rs:6:22
118118 |
@@ -125,7 +125,7 @@ LL | pub struct HasTrait<T: Trait>(T);
125125 | ^^^^^ required by this bound in `HasTrait`
126126
127127error[E0308]: mismatched types
128- --> $DIR/mismatched-const-errors.rs:34 :30
128+ --> $DIR/mismatched-const-errors.rs:33 :30
129129 |
130130LL | fn foo5<const N: usize>() -> HasTrait<HasCastInTraitImpl<{ N + N }, { 2 * N }>> {
131131 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `{ 2 * N }`, found `{ N + N + 1 }`
0 commit comments