rust/tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-and-const-params.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
920 B
Plaintext
Raw Normal View History

error: `~const` is not allowed here
--> $DIR/tilde-const-and-const-params.rs:25:11
|
LL | fn bar<A: ~const Add42, const N: usize>(_: Foo<N>) -> Foo<{ A::add(N) }> {
| ^^^^^^^^^^^^
|
note: this function is not `const`, so it cannot have `~const` trait bounds
--> $DIR/tilde-const-and-const-params.rs:25:4
|
LL | fn bar<A: ~const Add42, const N: usize>(_: Foo<N>) -> Foo<{ A::add(N) }> {
| ^^^
2023-07-29 03:20:25 -05:00
error[E0015]: cannot call non-const fn `<A as Add42>::add` in constants
--> $DIR/tilde-const-and-const-params.rs:25:61
|
LL | fn bar<A: ~const Add42, const N: usize>(_: Foo<N>) -> Foo<{ A::add(N) }> {
| ^^^^^^^^^
|
= note: calls in constants are limited to constant functions, tuple structs and tuple variants
error: aborting due to 2 previous errors
2023-07-29 03:20:25 -05:00
For more information about this error, try `rustc --explain E0015`.