-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #106614 - Ezrashaw:ui-test-fixups-2, r=GuillaumeGomez
error-code docs improvements (No. 2) - Added empty error-code docs for `E0208`, `E0640` and `E0717` with the "internal" header as discussed on Discord. - Wrote docs and UI test for `E0711`, again with the header. - `tidy` changes are common-sense and make everything pass, `style.rs` hack is annoying though. r? ```@GuillaumeGomez```
- Loading branch information
Showing
20 changed files
with
88 additions
and
6 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
#### This error code is internal to the compiler and will not be emitted with normal Rust code. |
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 @@ | ||
#### This error code is internal to the compiler and will not be emitted with normal Rust code. |
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,30 @@ | ||
#### This error code is internal to the compiler and will not be emitted with normal Rust code. | ||
|
||
Feature declared with conflicting stability requirements. | ||
|
||
```compile_fail,E0711 | ||
// NOTE: this attribute is perma-unstable and should *never* be used outside of | ||
// stdlib and the compiler. | ||
#![feature(staged_api)] | ||
#![stable(feature = "...", since = "1.0.0")] | ||
#[stable(feature = "foo", since = "1.0.0")] | ||
fn foo_stable_1_0_0() {} | ||
// error: feature `foo` is declared stable since 1.29.0 | ||
#[stable(feature = "foo", since = "1.29.0")] | ||
fn foo_stable_1_29_0() {} | ||
// error: feature `foo` is declared unstable | ||
#[unstable(feature = "foo", issue = "none")] | ||
fn foo_unstable() {} | ||
``` | ||
|
||
In the above example, the `foo` feature is first defined to be stable since | ||
1.0.0, but is then re-declared stable since 1.29.0. This discrepancy in | ||
versions causes an error. Furthermore, `foo` is then re-declared as unstable, | ||
again the conflict causes an error. | ||
|
||
This error can be fixed by splitting the feature, this allows any | ||
stability requirements and removes any possibility of conflict. |
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 @@ | ||
#### This error code is internal to the compiler and will not be emitted with normal Rust code. |
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,18 @@ | ||
// copied from: src/test/ui/feature-gates/stability-attribute-consistency.rs | ||
|
||
#![feature(staged_api)] | ||
|
||
#![stable(feature = "stable_test_feature", since = "1.0.0")] | ||
|
||
#[stable(feature = "foo", since = "1.0.0")] | ||
fn foo_stable_1_0_0() {} | ||
|
||
#[stable(feature = "foo", since = "1.29.0")] | ||
//~^ ERROR feature `foo` is declared stable since 1.29.0 | ||
fn foo_stable_1_29_0() {} | ||
|
||
#[unstable(feature = "foo", issue = "none")] | ||
//~^ ERROR feature `foo` is declared unstable | ||
fn foo_unstable() {} | ||
|
||
fn main() {} |
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,15 @@ | ||
error[E0711]: feature `foo` is declared stable since 1.29.0, but was previously declared stable since 1.0.0 | ||
--> $DIR/E0711.rs:10:1 | ||
| | ||
LL | #[stable(feature = "foo", since = "1.29.0")] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error[E0711]: feature `foo` is declared unstable, but was previously declared stable | ||
--> $DIR/E0711.rs:14:1 | ||
| | ||
LL | #[unstable(feature = "foo", issue = "none")] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0711`. |
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
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