@@ -27,11 +27,13 @@ LL + #[derive(ConstParamTy)]
2727LL | struct Foo(u8);
2828 |
2929
30- error[E0284 ]: type annotations needed: cannot normalize `foo<N>::{constant#0}`
31- --> $DIR/unify-op-with-fn-call.rs:20:25
30+ error[E0015 ]: cannot call non-const operator in constants
31+ --> $DIR/unify-op-with-fn-call.rs:20:39
3232 |
3333LL | fn foo<const N: Foo>(a: Evaluatable<{ N + N }>) {
34- | ^^^^^^^^^^^^^^^^^^^^^^ cannot normalize `foo<N>::{constant#0}`
34+ | ^^^^^
35+ |
36+ = note: calls in constants are limited to constant functions, tuple structs and tuple variants
3537
3638error[E0741]: `Foo` must implement `ConstParamTy` to be used as the type of a const generic parameter
3739 --> $DIR/unify-op-with-fn-call.rs:20:17
@@ -63,19 +65,29 @@ error[E0284]: type annotations needed: cannot normalize `foo2<N>::{constant#0}`
6365LL | fn foo2<const N: usize>(a: Evaluatable2<{ N + N }>) {
6466 | ^^^^^^^^^^^^^^^^^^^^^^^ cannot normalize `foo2<N>::{constant#0}`
6567
66- error[E0284 ]: type annotations needed: cannot normalize `foo<N >::{constant#0}`
67- --> $DIR/unify-op-with-fn-call.rs:21:11
68+ error[E0015 ]: cannot call non-const fn `<Foo as Add >::add` in constants
69+ --> $DIR/unify-op-with-fn-call.rs:21:13
6870 |
6971LL | bar::<{ std::ops::Add::add(N, N) }>();
70- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot normalize `foo<N>::{constant#0}`
72+ | ^^^^^^^^^^^^^^^^^^^^^^^^
73+ |
74+ = note: calls in constants are limited to constant functions, tuple structs and tuple variants
75+
76+ error[E0015]: cannot call non-const fn `<usize as Add>::add` in constants
77+ --> $DIR/unify-op-with-fn-call.rs:30:14
78+ |
79+ LL | bar2::<{ std::ops::Add::add(N, N) }>();
80+ | ^^^^^^^^^^^^^^^^^^^^^^^^
81+ |
82+ = note: calls in constants are limited to constant functions, tuple structs and tuple variants
7183
7284error[E0284]: type annotations needed: cannot normalize `foo2<N>::{constant#0}`
7385 --> $DIR/unify-op-with-fn-call.rs:30:12
7486 |
7587LL | bar2::<{ std::ops::Add::add(N, N) }>();
7688 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot normalize `foo2<N>::{constant#0}`
7789
78- error: aborting due to 9 previous errors
90+ error: aborting due to 10 previous errors
7991
80- Some errors have detailed explanations: E0284, E0741.
81- For more information about an error, try `rustc --explain E0284 `.
92+ Some errors have detailed explanations: E0015, E0284, E0741.
93+ For more information about an error, try `rustc --explain E0015 `.
0 commit comments