rust/tests/ui/on-unimplemented/suggest_tuple_wrap_root_obligation.rs
2024-11-04 12:06:19 +01:00

27 lines
511 B
Rust

struct Tuple;
impl From<(u8,)> for Tuple {
fn from(_: (u8,)) -> Self {
todo!()
}
}
impl From<(u8, u8)> for Tuple {
fn from(_: (u8, u8)) -> Self {
todo!()
}
}
impl From<(u8, u8, u8)> for Tuple {
fn from(_: (u8, u8, u8)) -> Self {
todo!()
}
}
fn convert_into_tuple(_x: impl Into<Tuple>) {}
fn main() {
convert_into_tuple(42_u8);
//~^ ERROR E0277
//~| HELP use a unary tuple instead
//~| HELP the following other types implement trait `From<T>`
}