2024-06-25 08:36:40 +00:00
|
|
|
error: const `impl` for trait `Add` which is not marked with `#[const_trait]`
|
|
|
|
--> $DIR/unify-op-with-fn-call.rs:10:12
|
|
|
|
|
|
|
|
|
LL | impl const std::ops::Add for Foo {
|
|
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= note: marking a trait with `#[const_trait]` ensures all default method bodies are `const`
|
|
|
|
= note: adding a non-const method body in the future would be a breaking change
|
|
|
|
|
2023-08-06 13:20:55 +00:00
|
|
|
error[E0741]: `Foo` must implement `ConstParamTy` to be used as the type of a const generic parameter
|
|
|
|
--> $DIR/unify-op-with-fn-call.rs:18:29
|
2021-09-09 15:43:59 +01:00
|
|
|
|
|
2023-08-06 13:20:55 +00:00
|
|
|
LL | struct Evaluatable<const N: Foo>;
|
|
|
|
| ^^^
|
|
|
|
|
|
|
|
|
help: add `#[derive(ConstParamTy)]` to the struct
|
|
|
|
|
|
|
|
|
LL + #[derive(ConstParamTy)]
|
|
|
|
LL | struct Foo(u8);
|
|
|
|
|
|
|
|
|
|
2024-06-30 17:08:45 +00:00
|
|
|
error[E0284]: type annotations needed: cannot normalize `foo<N>::{constant#0}`
|
|
|
|
--> $DIR/unify-op-with-fn-call.rs:20:25
|
|
|
|
|
|
|
|
|
LL | fn foo<const N: Foo>(a: Evaluatable<{ N + N }>) {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ cannot normalize `foo<N>::{constant#0}`
|
|
|
|
|
2023-08-06 13:20:55 +00:00
|
|
|
error[E0741]: `Foo` must implement `ConstParamTy` to be used as the type of a const generic parameter
|
|
|
|
--> $DIR/unify-op-with-fn-call.rs:20:17
|
|
|
|
|
|
|
|
|
LL | fn foo<const N: Foo>(a: Evaluatable<{ N + N }>) {
|
|
|
|
| ^^^
|
|
|
|
|
|
|
|
|
help: add `#[derive(ConstParamTy)]` to the struct
|
|
|
|
|
|
|
|
|
LL + #[derive(ConstParamTy)]
|
|
|
|
LL | struct Foo(u8);
|
|
|
|
|
|
|
|
|
|
|
|
|
error[E0741]: `Foo` must implement `ConstParamTy` to be used as the type of a const generic parameter
|
|
|
|
--> $DIR/unify-op-with-fn-call.rs:24:17
|
|
|
|
|
|
|
|
|
LL | fn bar<const N: Foo>() {}
|
|
|
|
| ^^^
|
|
|
|
|
|
|
|
|
help: add `#[derive(ConstParamTy)]` to the struct
|
|
|
|
|
|
|
|
|
LL + #[derive(ConstParamTy)]
|
|
|
|
LL | struct Foo(u8);
|
2021-09-09 15:43:59 +01:00
|
|
|
|
|
|
|
|
|
2024-06-30 17:08:45 +00:00
|
|
|
error[E0284]: type annotations needed: cannot normalize `foo2<N>::{constant#0}`
|
|
|
|
--> $DIR/unify-op-with-fn-call.rs:29:28
|
2024-03-11 21:28:16 +00:00
|
|
|
|
|
2024-06-30 17:08:45 +00:00
|
|
|
LL | fn foo2<const N: usize>(a: Evaluatable2<{ N + N }>) {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^ cannot normalize `foo2<N>::{constant#0}`
|
|
|
|
|
|
|
|
error[E0284]: type annotations needed: cannot normalize `foo<N>::{constant#0}`
|
|
|
|
--> $DIR/unify-op-with-fn-call.rs:21:11
|
2024-03-11 21:28:16 +00:00
|
|
|
|
|
2024-06-30 17:08:45 +00:00
|
|
|
LL | bar::<{ std::ops::Add::add(N, N) }>();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot normalize `foo<N>::{constant#0}`
|
|
|
|
|
|
|
|
error[E0284]: type annotations needed: cannot normalize `foo2<N>::{constant#0}`
|
|
|
|
--> $DIR/unify-op-with-fn-call.rs:30:12
|
2024-03-21 00:03:59 +00:00
|
|
|
|
|
2024-06-30 17:08:45 +00:00
|
|
|
LL | bar2::<{ std::ops::Add::add(N, N) }>();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot normalize `foo2<N>::{constant#0}`
|
2024-03-11 21:28:16 +00:00
|
|
|
|
2024-06-30 17:08:45 +00:00
|
|
|
error: aborting due to 8 previous errors
|
2021-09-09 15:43:59 +01:00
|
|
|
|
2024-06-30 17:08:45 +00:00
|
|
|
Some errors have detailed explanations: E0284, E0741.
|
|
|
|
For more information about an error, try `rustc --explain E0284`.
|