about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorfee1-dead <ent3rm4n@gmail.com>2023-01-09 23:35:32 +0800
committerGitHub <noreply@github.com>2023-01-09 23:35:32 +0800
commit77f529bb0ae361e6948336f27ce51f686a681e7a (patch)
tree7651a82109249755c6194a1b757a88e9eadc6d28 /compiler
parent99529b0cd2022c9002fd4f5fef119ba4ca100b81 (diff)
parent2c92c72c46e6a300c902c6d0e1c4b5c6b9b5c179 (diff)
downloadrust-77f529bb0ae361e6948336f27ce51f686a681e7a.tar.gz
rust-77f529bb0ae361e6948336f27ce51f686a681e7a.zip
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```
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_error_codes/src/error_codes.rs8
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0208.md1
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0640.md1
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0711.md30
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0717.md1
5 files changed, 37 insertions, 4 deletions
diff --git a/compiler/rustc_error_codes/src/error_codes.rs b/compiler/rustc_error_codes/src/error_codes.rs
index 76d5da19399..686c22bc386 100644
--- a/compiler/rustc_error_codes/src/error_codes.rs
+++ b/compiler/rustc_error_codes/src/error_codes.rs
@@ -110,6 +110,7 @@ E0204: include_str!("./error_codes/E0204.md"),
 E0205: include_str!("./error_codes/E0205.md"),
 E0206: include_str!("./error_codes/E0206.md"),
 E0207: include_str!("./error_codes/E0207.md"),
+E0208: include_str!("./error_codes/E0208.md"),
 E0210: include_str!("./error_codes/E0210.md"),
 E0211: include_str!("./error_codes/E0211.md"),
 E0212: include_str!("./error_codes/E0212.md"),
@@ -387,6 +388,7 @@ E0636: include_str!("./error_codes/E0636.md"),
 E0637: include_str!("./error_codes/E0637.md"),
 E0638: include_str!("./error_codes/E0638.md"),
 E0639: include_str!("./error_codes/E0639.md"),
+E0640: include_str!("./error_codes/E0640.md"),
 E0641: include_str!("./error_codes/E0641.md"),
 E0642: include_str!("./error_codes/E0642.md"),
 E0643: include_str!("./error_codes/E0643.md"),
@@ -434,6 +436,8 @@ E0713: include_str!("./error_codes/E0713.md"),
 E0714: include_str!("./error_codes/E0714.md"),
 E0715: include_str!("./error_codes/E0715.md"),
 E0716: include_str!("./error_codes/E0716.md"),
+E0711: include_str!("./error_codes/E0711.md"),
+E0717: include_str!("./error_codes/E0717.md"),
 E0718: include_str!("./error_codes/E0718.md"),
 E0719: include_str!("./error_codes/E0719.md"),
 E0720: include_str!("./error_codes/E0720.md"),
@@ -540,7 +544,6 @@ E0791: include_str!("./error_codes/E0791.md"),
 //  E0190, // deprecated: can only cast a &-pointer to an &-object
 //  E0194, // merged into E0403
 //  E0196, // cannot determine a type for this closure
-    E0208, // internal error code
 //  E0209, // builtin traits can only be implemented on structs or enums
 //  E0213, // associated types are not accepted in this context
 //  E0215, // angle-bracket notation is not stable with `Fn`
@@ -633,14 +636,11 @@ E0791: include_str!("./error_codes/E0791.md"),
 //  E0629, // missing 'feature' (rustc_const_unstable)
 //  E0630, // rustc_const_unstable attribute must be paired with stable/unstable
            // attribute
-    E0640, // infer outlives requirements, internal error code
 //  E0645, // trait aliases not finished
 //  E0694, // an unknown tool name found in scoped attributes
 //  E0702, // replaced with a generic attribute input check
 //  E0707, // multiple elided lifetimes used in arguments of `async fn`
 //  E0709, // multiple different lifetimes used in arguments of `async fn`
-    E0711, // a feature has been declared with conflicting stability attributes, internal error code
-    E0717, // rustc_promotable without stability attribute, internal error code
 //  E0721, // `await` keyword
 //  E0723, // unstable feature in `const` context
 //  E0738, // Removed; errored on `#[track_caller] fn`s in `extern "Rust" { ... }`.
diff --git a/compiler/rustc_error_codes/src/error_codes/E0208.md b/compiler/rustc_error_codes/src/error_codes/E0208.md
new file mode 100644
index 00000000000..7edd93e56a9
--- /dev/null
+++ b/compiler/rustc_error_codes/src/error_codes/E0208.md
@@ -0,0 +1 @@
+#### This error code is internal to the compiler and will not be emitted with normal Rust code.
diff --git a/compiler/rustc_error_codes/src/error_codes/E0640.md b/compiler/rustc_error_codes/src/error_codes/E0640.md
new file mode 100644
index 00000000000..7edd93e56a9
--- /dev/null
+++ b/compiler/rustc_error_codes/src/error_codes/E0640.md
@@ -0,0 +1 @@
+#### This error code is internal to the compiler and will not be emitted with normal Rust code.
diff --git a/compiler/rustc_error_codes/src/error_codes/E0711.md b/compiler/rustc_error_codes/src/error_codes/E0711.md
new file mode 100644
index 00000000000..a2150037f78
--- /dev/null
+++ b/compiler/rustc_error_codes/src/error_codes/E0711.md
@@ -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.
diff --git a/compiler/rustc_error_codes/src/error_codes/E0717.md b/compiler/rustc_error_codes/src/error_codes/E0717.md
new file mode 100644
index 00000000000..7edd93e56a9
--- /dev/null
+++ b/compiler/rustc_error_codes/src/error_codes/E0717.md
@@ -0,0 +1 @@
+#### This error code is internal to the compiler and will not be emitted with normal Rust code.