rust/src/test/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst.stderr

24 lines
982 B
Plaintext
Raw Normal View History

error[E0277]: can't compare `S` with `S` in const contexts
--> $DIR/call-generic-method-nonconst.rs:18:34
2021-07-26 04:06:55 +00:00
|
LL | pub const EQ: bool = equals_self(&S);
| ----------- ^^ no implementation for `S == S`
| |
| required by a bound introduced by this call
2021-07-26 04:06:55 +00:00
|
= help: the trait `~const PartialEq` is not implemented for `S`
note: the trait `PartialEq` is implemented for `S`, but that implementation is not `const`
--> $DIR/call-generic-method-nonconst.rs:18:34
|
LL | pub const EQ: bool = equals_self(&S);
| ^^
note: required by a bound in `equals_self`
--> $DIR/call-generic-method-nonconst.rs:11:25
|
2021-08-25 15:21:55 +00:00
LL | const fn equals_self<T: ~const PartialEq>(t: &T) -> bool {
| ^^^^^^^^^^^^^^^^ required by this bound in `equals_self`
2021-07-26 04:06:55 +00:00
error: aborting due to previous error
For more information about this error, try `rustc --explain E0277`.