rust/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-fail.stderr

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

29 lines
994 B
Plaintext
Raw Normal View History

2023-04-16 06:12:37 -05:00
error[E0277]: can't compare `T` with `T` in const contexts
--> $DIR/call-generic-method-fail.rs:5:5
|
LL | *t == *t
2023-04-16 06:12:37 -05:00
| ^^^^^^^^ no implementation for `T == T`
2022-02-10 03:22:54 -06:00
|
2023-04-16 06:12:37 -05:00
note: the trait `PartialEq` is implemented for `T`, but that implementation is not `const`
--> $DIR/call-generic-method-fail.rs:5:5
2022-02-10 03:22:54 -06:00
|
LL | *t == *t
2023-04-16 06:12:37 -05:00
| ^^^^^^^^
2023-04-16 06:12:37 -05:00
error[E0015]: cannot call non-const operator in constant functions
--> $DIR/call-generic-method-fail.rs:5:5
|
LL | *t == *t
| ^^^^^^^^
|
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
help: consider further restricting this bound
|
LL | pub const fn equals_self<T: PartialEq + ~const std::cmp::PartialEq>(t: &T) -> bool {
| ++++++++++++++++++++++++++++
error: aborting due to 2 previous errors
2023-04-16 06:12:37 -05:00
Some errors have detailed explanations: E0015, E0277.
For more information about an error, try `rustc --explain E0015`.