#![warn(clippy::from_over_into)] struct InMacro(String); macro_rules! in_macro { () => { Self::new() }; } impl Into for String { //~^ ERROR: an implementation of `From` is preferred since it gives you `Into<_>` for free fn into(self) -> InMacro { InMacro(in_macro!()) } } struct WeirdUpperSelf; impl Into for &'static [u8] { //~^ ERROR: an implementation of `From` is preferred since it gives you `Into<_>` for free fn into(self) -> WeirdUpperSelf { let _ = Self::default(); WeirdUpperSelf } } struct ContainsVal; impl Into for ContainsVal { //~^ ERROR: an implementation of `From` is preferred since it gives you `Into<_>` for free fn into(self) -> u8 { let val = 1; val + 1 } } pub struct Lval(T); pub struct Rval(T); impl Into> for Lval { //~^ ERROR: an implementation of `From` is preferred since it gives you `Into<_>` for free fn into(self) -> Rval { Rval(self) } } fn main() {}