Point at specific field in struct literal when trait fulfillment fails
This commit is contained in:
parent
c8e6a9e8b6
commit
2a67e99d7d
21 changed files with 1150 additions and 111 deletions
28
tests/ui/errors/trait-bound-error-spans/blame-trait-error.rs
Normal file
28
tests/ui/errors/trait-bound-error-spans/blame-trait-error.rs
Normal file
|
@ -0,0 +1,28 @@
|
|||
trait T1 {}
|
||||
trait T2 {}
|
||||
trait T3 {}
|
||||
trait T4 {}
|
||||
|
||||
impl<B: T2> T1 for Wrapper<B> {}
|
||||
|
||||
impl T2 for i32 {}
|
||||
impl T3 for i32 {}
|
||||
|
||||
impl<A: T3> T2 for Burrito<A> {}
|
||||
|
||||
struct Wrapper<W> {
|
||||
value: W,
|
||||
}
|
||||
|
||||
struct Burrito<F> {
|
||||
filling: F,
|
||||
}
|
||||
|
||||
fn want<V: T1>(_x: V) {}
|
||||
|
||||
fn example<Q>(q: Q) {
|
||||
want(Wrapper { value: Burrito { filling: q } });
|
||||
//~^ ERROR the trait bound `Q: T3` is not satisfied [E0277]
|
||||
}
|
||||
|
||||
fn main() {}
|
Loading…
Add table
Add a link
Reference in a new issue