//@ check-pass //@ edition:2021 trait Global {} fn main() { trait Local {}; impl Global for Vec { } //~^ WARN non-local `impl` definition } trait Uto7 {} trait Uto8 {} struct Test; fn bad() { struct Local; impl Uto7 for Test where Local: std::any::Any {} //~^ WARN non-local `impl` definition impl Uto8 for T {} //~^ WARN non-local `impl` definition } struct UwU(T); fn fun() { #[derive(Debug)] struct OwO; impl Default for UwU { fn default() -> Self { UwU(OwO) } } } fn meow() { #[derive(Debug)] struct Cat; impl AsRef for () { fn as_ref(&self) -> &Cat { &Cat } } } struct G; fn fun2() { #[derive(Debug, Default)] struct B; impl PartialEq for G { fn eq(&self, _: &B) -> bool { true } } } struct Wrap(T); impl Wrap>> {} fn rawr() { struct Lion; impl From>> for () { fn from(_: Wrap>) -> Self { todo!() } } impl From<()> for Wrap { fn from(_: ()) -> Self { todo!() } } } fn side_effects() { dbg!(().as_ref()); // prints `Cat` dbg!(UwU::default().0); let _ = G::eq(&G, dbg!(&<_>::default())); }