mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-02 18:27:37 +00:00

When encountering an unmet trait bound, point at local type that doesn't implement the trait: ``` error[E0277]: the trait bound `Bar<T>: Foo` is not satisfied --> $DIR/issue-64855.rs:9:19 | LL | pub struct Bar<T>(<Self as Foo>::Type) where Self: ; | ^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | help: the trait `Foo` is not implemented for `Bar<T>` --> $DIR/issue-64855.rs:9:1 | LL | pub struct Bar<T>(<Self as Foo>::Type) where Self: ; | ^^^^^^^^^^^^^^^^^ ```
27 lines
572 B
Rust
27 lines
572 B
Rust
struct Tuple; //~ HELP the trait `From<u8>` is not implemented for `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>`
|
|
}
|