2022-10-14 22:50:23 +00:00
|
|
|
#![warn(clippy::from_over_into)]
|
|
|
|
|
|
|
|
struct InMacro(String);
|
|
|
|
|
|
|
|
macro_rules! in_macro {
|
2023-05-28 21:50:08 +00:00
|
|
|
() => {
|
|
|
|
Self::new()
|
2022-10-14 22:50:23 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Into<InMacro> for String {
|
|
|
|
fn into(self) -> InMacro {
|
2023-05-28 21:50:08 +00:00
|
|
|
InMacro(in_macro!())
|
2022-10-14 22:50:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
struct WeirdUpperSelf;
|
|
|
|
|
|
|
|
impl Into<WeirdUpperSelf> for &'static [u8] {
|
|
|
|
fn into(self) -> WeirdUpperSelf {
|
|
|
|
let _ = Self::default();
|
|
|
|
WeirdUpperSelf
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
struct ContainsVal;
|
|
|
|
|
|
|
|
impl Into<u8> for ContainsVal {
|
|
|
|
fn into(self) -> u8 {
|
|
|
|
let val = 1;
|
|
|
|
val + 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|