@@ -19,6 +19,12 @@ LL + #[derive(ConstParamTy)]
19
19
LL | struct Foo(u8);
20
20
|
21
21
22
+ error[E0284]: type annotations needed: cannot normalize `foo<N>::{constant#0}`
23
+ --> $DIR/unify-op-with-fn-call.rs:20:25
24
+ |
25
+ LL | fn foo<const N: Foo>(a: Evaluatable<{ N + N }>) {
26
+ | ^^^^^^^^^^^^^^^^^^^^^^ cannot normalize `foo<N>::{constant#0}`
27
+
22
28
error[E0741]: `Foo` must implement `ConstParamTy` to be used as the type of a const generic parameter
23
29
--> $DIR/unify-op-with-fn-call.rs:20:17
24
30
|
@@ -43,17 +49,25 @@ LL + #[derive(ConstParamTy)]
43
49
LL | struct Foo(u8);
44
50
|
45
51
46
- error: unconstrained generic constant
47
- --> $DIR/unify-op-with-fn-call.rs:30:12
52
+ error[E0284]: type annotations needed: cannot normalize `foo2<N>::{ constant#0}`
53
+ --> $DIR/unify-op-with-fn-call.rs:29:28
48
54
|
49
- LL | bar2::<{ std::ops::Add::add(N, N) }>();
50
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
55
+ LL | fn foo2<const N: usize>(a: Evaluatable2<{ N + N }>) {
56
+ | ^^^^^^^^^^^^^^^^^^^^^^^ cannot normalize `foo2<N>::{constant#0}`
57
+
58
+ error[E0284]: type annotations needed: cannot normalize `foo<N>::{constant#0}`
59
+ --> $DIR/unify-op-with-fn-call.rs:21:11
51
60
|
52
- help: try adding a `where` bound
61
+ LL | bar::<{ std::ops::Add::add(N, N) }>();
62
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot normalize `foo<N>::{constant#0}`
63
+
64
+ error[E0284]: type annotations needed: cannot normalize `foo2<N>::{constant#0}`
65
+ --> $DIR/unify-op-with-fn-call.rs:30:12
53
66
|
54
- LL | fn foo2<const N: usize>(a: Evaluatable2 <{ N + N }>) where [(); { std::ops::Add::add(N, N) }]: {
55
- | +++++++++++++++++++++++++++++++++++++++++
67
+ LL | bar2:: <{ std::ops::Add::add(N, N) }>();
68
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot normalize `foo2<N>::{constant#0}`
56
69
57
- error: aborting due to 5 previous errors
70
+ error: aborting due to 8 previous errors
58
71
59
- For more information about this error, try `rustc --explain E0741`.
72
+ Some errors have detailed explanations: E0284, E0741.
73
+ For more information about an error, try `rustc --explain E0284`.
0 commit comments