forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
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 rust-lang#107064 - GuillaumeGomez:rollup-pbgu6r3, r=Gui…
…llaumeGomez Rollup of 5 pull requests Successful merges: - rust-lang#105977 (Transform async `ResumeTy` in generator transform) - rust-lang#106927 (make `CastError::NeedsDeref` create a `MachineApplicable` suggestion) - rust-lang#106931 (document + UI test `E0208` and make its output more user-friendly) - rust-lang#107027 (Remove extra removal from test path) - rust-lang#107037 (Fix Dominators::rank_partial_cmp to match documentation) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
33 changed files
with
716 additions
and
100 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,46 @@ | ||
#### This error code is internal to the compiler and will not be emitted with normal Rust code. | ||
#### Note: this error code is no longer emitted by the compiler. | ||
|
||
This error code shows the variance of a type's generic parameters. | ||
|
||
Erroneous code example: | ||
|
||
```compile_fail | ||
// NOTE: this feature is perma-unstable and should *only* be used for | ||
// testing purposes. | ||
#![feature(rustc_attrs)] | ||
#[rustc_variance] | ||
struct Foo<'a, T> { // error: deliberate error to display type's variance | ||
t: &'a mut T, | ||
} | ||
``` | ||
|
||
which produces the following error: | ||
|
||
```text | ||
error: [-, o] | ||
--> <anon>:4:1 | ||
| | ||
4 | struct Foo<'a, T> { | ||
| ^^^^^^^^^^^^^^^^^ | ||
``` | ||
|
||
*Note that while `#[rustc_variance]` still exists and is used within the* | ||
*compiler, it no longer is marked as `E0208` and instead has no error code.* | ||
|
||
This error is deliberately triggered with the `#[rustc_variance]` attribute | ||
(`#![feature(rustc_attrs)]` must be enabled) and helps to show you the variance | ||
of the type's generic parameters. You can read more about variance and | ||
subtyping in [this section of the Rustnomicon]. For a more in depth look at | ||
variance (including a more complete list of common variances) see | ||
[this section of the Reference]. For information on how variance is implemented | ||
in the compiler, see [this section of `rustc-dev-guide`]. | ||
|
||
This error can be easily fixed by removing the `#[rustc_variance]` attribute, | ||
the compiler's suggestion to comment it out can be applied automatically with | ||
`rustfix`. | ||
|
||
[this section of the Rustnomicon]: https://doc.rust-lang.org/nomicon/subtyping.html | ||
[this section of the Reference]: https://doc.rust-lang.org/reference/subtyping.html#variance | ||
[this section of `rustc-dev-guide`]: https://rustc-dev-guide.rust-lang.org/variance.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
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 |
---|---|---|
|
@@ -164,6 +164,7 @@ symbols! { | |
Capture, | ||
Center, | ||
Clone, | ||
Context, | ||
Continue, | ||
Copy, | ||
Count, | ||
|
Oops, something went wrong.