mirror of
https://github.com/rust-lang/rust
synced 2024-09-15 22:50:55 +00:00
16 lines
359 B
Rust
16 lines
359 B
Rust
|
fn f<T>(a: T, b: T) -> std::cmp::Ordering {
|
||
|
a.cmp(&b) //~ ERROR E0599
|
||
|
}
|
||
|
fn g<T>(a: T, b: T) -> std::cmp::Ordering {
|
||
|
(&a).cmp(&b) //~ ERROR E0599
|
||
|
}
|
||
|
fn h<T>(a: &T, b: T) -> std::cmp::Ordering {
|
||
|
a.cmp(&b) //~ ERROR E0599
|
||
|
}
|
||
|
trait T {}
|
||
|
impl<X: std::cmp::Ord> T for X {}
|
||
|
fn main() {
|
||
|
let x: Box<dyn T> = Box::new(0);
|
||
|
x.cmp(&x); //~ ERROR E0599
|
||
|
}
|