mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-04 04:39:16 +00:00
19 lines
324 B
Rust
19 lines
324 B
Rust
#![allow(warnings)]
|
|
|
|
struct MyType;
|
|
|
|
impl PartialEq<usize> for MyType {
|
|
fn eq(&self, y: &usize) -> bool {
|
|
true
|
|
}
|
|
}
|
|
|
|
const CONSTANT: &&MyType = &&MyType;
|
|
|
|
fn main() {
|
|
if let CONSTANT = &&MyType {
|
|
//~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]`
|
|
println!("did match!");
|
|
}
|
|
}
|