@@ -19,6 +19,12 @@ LL + #[derive(ConstParamTy)]
1919LL | struct Foo(u8);
2020 |
2121
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+
2228error[E0741]: `Foo` must implement `ConstParamTy` to be used as the type of a const generic parameter
2329 --> $DIR/unify-op-with-fn-call.rs:20:17
2430 |
@@ -43,17 +49,25 @@ LL + #[derive(ConstParamTy)]
4349LL | struct Foo(u8);
4450 |
4551
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
4854 |
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
5160 |
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
5366 |
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}`
5669
57- error: aborting due to 5 previous errors
70+ error: aborting due to 8 previous errors
5871
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