-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Point at specific field in struct literal when trait fulfillment fails
- Loading branch information
1 parent
c8e6a9e
commit 2a67e99
Showing
21 changed files
with
1,151 additions
and
112 deletions.
There are no files selected for viewing
457 changes: 457 additions & 0 deletions
457
compiler/rustc_hir_typeck/src/fn_ctxt/adjust_fulfillment_errors.rs
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
mod _impl; | ||
mod adjust_fulfillment_errors; | ||
mod arg_matrix; | ||
mod checks; | ||
mod suggestions; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule reference
updated
7 files
+1 −1 | src/const_eval.md | |
+2 −7 | src/destructors.md | |
+1 −1 | src/expressions/field-expr.md | |
+1 −8 | src/expressions/operator-expr.md | |
+20 −150 | src/items/enumerations.md | |
+1 −1 | src/type-layout.md | |
+0 −2 | triagebot.toml |
Submodule rust-by-example
updated
2 files
+3 −3 | src/error/option_unwrap/defaults.md | |
+3 −6 | src/hello/print.md |
Submodule cargo
updated
99 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
tests/ui/errors/trait-bound-error-spans/blame-trait-error.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() {} |
Oops, something went wrong.