0c0dfb88ee
as request T-lang is requesting some major changes in the lint inner workings in #126768#issuecomment-2192634762
51 lines
1011 B
Rust
51 lines
1011 B
Rust
//@ check-pass
|
|
//@ edition:2021
|
|
|
|
#![warn(non_local_definitions)]
|
|
|
|
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!()
|
|
}
|
|
}
|
|
}
|