]> git.proxmox.com Git - rustc.git/blob - src/test/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst.stderr
New upstream version 1.62.1+dfsg1
[rustc.git] / src / test / ui / rfc-2632-const-trait-impl / call-generic-method-nonconst.stderr
1 error[E0277]: can't compare `S` with `S` in const contexts
2 --> $DIR/call-generic-method-nonconst.rs:18:34
3 |
4 LL | pub const EQ: bool = equals_self(&S);
5 | ----------- ^^ no implementation for `S == S`
6 | |
7 | required by a bound introduced by this call
8 |
9 = help: the trait `~const PartialEq` is not implemented for `S`
10 note: the trait `PartialEq` is implemented for `S`, but that implementation is not `const`
11 --> $DIR/call-generic-method-nonconst.rs:18:34
12 |
13 LL | pub const EQ: bool = equals_self(&S);
14 | ^^
15 note: required by a bound in `equals_self`
16 --> $DIR/call-generic-method-nonconst.rs:11:25
17 |
18 LL | const fn equals_self<T: ~const PartialEq>(t: &T) -> bool {
19 | ^^^^^^^^^^^^^^^^ required by this bound in `equals_self`
20 help: consider annotating `S` with `#[derive(PartialEq)]`
21 |
22 LL | #[derive(PartialEq)]
23 |
24
25 error: aborting due to previous error
26
27 For more information about this error, try `rustc --explain E0277`.