rust/tests/ui/lint/non-local-defs/exhaustive-trait.rs

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

49 lines
978 B
Rust
Raw Normal View History

//@ check-pass
//@ edition:2021
struct Dog;
fn main() {
impl PartialEq<()> for Dog {
//~^ WARN non-local `impl` definition
fn eq(&self, _: &()) -> bool {
todo!()
}
}
impl PartialEq<()> for &Dog {
//~^ WARN non-local `impl` definition
fn eq(&self, _: &()) -> bool {
todo!()
}
}
impl PartialEq<Dog> for () {
//~^ WARN non-local `impl` definition
fn eq(&self, _: &Dog) -> bool {
todo!()
}
}
impl PartialEq<&Dog> for () {
//~^ WARN non-local `impl` definition
fn eq(&self, _: &&Dog) -> bool {
todo!()
}
}
impl PartialEq<Dog> for &Dog {
//~^ WARN non-local `impl` definition
fn eq(&self, _: &Dog) -> bool {
todo!()
}
}
impl PartialEq<&Dog> for &Dog {
//~^ WARN non-local `impl` definition
fn eq(&self, _: &&Dog) -> bool {
todo!()
}
}
}