94 lines
3.3 KiB
Plaintext
94 lines
3.3 KiB
Plaintext
error: `-Znext-solver=globally` and `generic_const_exprs` are incompatible, using them at the same time is not allowed
|
|
--> $DIR/unify-op-with-fn-call.rs:3:12
|
|
|
|
|
LL | #![feature(generic_const_exprs, adt_const_params, const_trait_impl)]
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: remove one of these features
|
|
|
|
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
|
|
|
|
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
|
|
|
|
|
LL | struct Evaluatable<const N: Foo>;
|
|
| ^^^
|
|
|
|
|
help: add `#[derive(ConstParamTy)]` to the struct
|
|
|
|
|
LL + #[derive(ConstParamTy)]
|
|
LL | struct Foo(u8);
|
|
|
|
|
|
|
error[E0015]: cannot call non-const operator in constants
|
|
--> $DIR/unify-op-with-fn-call.rs:20:39
|
|
|
|
|
LL | fn foo<const N: Foo>(a: Evaluatable<{ N + N }>) {
|
|
| ^^^^^
|
|
|
|
|
= note: calls in constants are limited to constant functions, tuple structs and tuple variants
|
|
|
|
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);
|
|
|
|
|
|
|
error[E0284]: type annotations needed: cannot normalize `foo2<N>::{constant#0}`
|
|
--> $DIR/unify-op-with-fn-call.rs:29:28
|
|
|
|
|
LL | fn foo2<const N: usize>(a: Evaluatable2<{ N + N }>) {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^ cannot normalize `foo2<N>::{constant#0}`
|
|
|
|
error[E0015]: cannot call non-const fn `<Foo as Add>::add` in constants
|
|
--> $DIR/unify-op-with-fn-call.rs:21:13
|
|
|
|
|
LL | bar::<{ std::ops::Add::add(N, N) }>();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: calls in constants are limited to constant functions, tuple structs and tuple variants
|
|
|
|
error[E0015]: cannot call non-const fn `<usize as Add>::add` in constants
|
|
--> $DIR/unify-op-with-fn-call.rs:30:14
|
|
|
|
|
LL | bar2::<{ std::ops::Add::add(N, N) }>();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: calls in constants are limited to constant functions, tuple structs and tuple variants
|
|
|
|
error[E0284]: type annotations needed: cannot normalize `foo2<N>::{constant#0}`
|
|
--> $DIR/unify-op-with-fn-call.rs:30:12
|
|
|
|
|
LL | bar2::<{ std::ops::Add::add(N, N) }>();
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot normalize `foo2<N>::{constant#0}`
|
|
|
|
error: aborting due to 10 previous errors
|
|
|
|
Some errors have detailed explanations: E0015, E0284, E0741.
|
|
For more information about an error, try `rustc --explain E0015`.
|