-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #69643 - Dylan-DPC:rollup-gmt6lm8, r=Dylan-DPC
Rollup of 7 pull requests Successful merges: - #69620 (doc(librustc_error_codes): add long error explanation for E0719) - #69621 (use question mark operator in a few places.) - #69626 (Toolstate: don't duplicate nightly tool list.) - #69633 (Update my mailmap entry) - #69634 (clean up E0378 explanation) - #69637 (Don't convert Results to Options just for matching.) - #69641 (Update books) Failed merges: r? @ghost
- Loading branch information
Showing
18 changed files
with
77 additions
and
48 deletions.
There are no files selected for viewing
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 embedded-book
updated
2 files
+19 −0 | src/intro/index.md | |
+1 −1 | src/static-guarantees/design-contracts.md |
Submodule nomicon
updated
8 files
+7 −0 | book.toml | |
+3 −3 | src/destructors.md | |
+2 −2 | src/ffi.md | |
+2 −0 | src/lifetimes.md | |
+1 −1 | src/safe-unsafe-meaning.md | |
+4 −4 | src/subtyping.md | |
+1 −1 | src/vec-alloc.md | |
+1 −1 | src/vec-final.md |
Submodule reference
updated
8 files
+1 −1 | src/attributes.md | |
+1 −1 | src/behavior-considered-undefined.md | |
+3 −3 | src/const_eval.md | |
+1 −1 | src/expressions/array-expr.md | |
+5 −5 | src/items/associated-items.md | |
+1 −1 | src/items/enumerations.md | |
+1 −1 | src/items/use-declarations.md | |
+25 −3 | src/type-layout.md |
Submodule rust-by-example
updated
3 files
+2 −2 | src/conversion/from_into.md | |
+2 −2 | src/flow_control/if_let.md | |
+1 −1 | src/mod/visibility.md |
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
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,35 @@ | ||
The value for an associated type has already been specified. | ||
|
||
Erroneous code example: | ||
|
||
```compile_fail,E0719 | ||
#![feature(associated_type_bounds)] | ||
trait FooTrait {} | ||
trait BarTrait {} | ||
// error: associated type `Item` in trait `Iterator` is specified twice | ||
struct Foo<T: Iterator<Item: FooTrait, Item: BarTrait>> { f: T } | ||
``` | ||
|
||
`Item` in trait `Iterator` cannot be specified multiple times for struct `Foo`. | ||
To fix this, create a new trait that is a combination of the desired traits and | ||
specify the associated type with the new trait. | ||
|
||
Corrected example: | ||
|
||
``` | ||
#![feature(associated_type_bounds)] | ||
trait FooTrait {} | ||
trait BarTrait {} | ||
trait FooBarTrait: FooTrait + BarTrait {} | ||
struct Foo<T: Iterator<Item: FooBarTrait>> { f: T } | ||
``` | ||
|
||
For more information about associated types, see [the book][bk-at]. For more | ||
information on associated type bounds, see [RFC 2289][rfc-2289]. | ||
|
||
[bk-at]: https://doc.rust-lang.org/book/ch19-03-advanced-traits.html#specifying-placeholder-types-in-trait-definitions-with-associated-types | ||
[rfc-2289]: https://rust-lang.github.io/rfcs/2289-associated-type-bounds.html |
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
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