From 0d8a071f983ee2a9863b2bfa7b73f809a1c9b109 Mon Sep 17 00:00:00 2001 From: Jesus Rubio Date: Sat, 6 Feb 2021 18:27:19 +0100 Subject: [PATCH 1/3] Improve long explanation for E0546 --- compiler/rustc_error_codes/src/error_codes/E0546.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler/rustc_error_codes/src/error_codes/E0546.md b/compiler/rustc_error_codes/src/error_codes/E0546.md index b2df22c0f8fad..c5313490f2e5f 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0546.md +++ b/compiler/rustc_error_codes/src/error_codes/E0546.md @@ -1,4 +1,4 @@ -A feature name is missing. +The `feature` value is missing in a stability attribute. Erroneous code example: @@ -13,15 +13,15 @@ fn unstable_fn() {} fn stable_fn() {} ``` -To fix the issue you need to provide a feature name. +To fix the issue you need to provide the `feature` field. ``` #![feature(staged_api)] #![stable(since = "1.0.0", feature = "test")] -#[unstable(feature = "unstable_fn", issue = "none")] // ok! +#[unstable(feature = "unstable_fn", issue = "none")] fn unstable_fn() {} -#[stable(feature = "stable_fn", since = "1.0.0")] // ok! +#[stable(feature = "stable_fn", since = "1.0.0")] fn stable_fn() {} ``` From 777582228c22824d7615a93bf042df910af601b0 Mon Sep 17 00:00:00 2001 From: Jesus Rubio Date: Sat, 6 Feb 2021 19:44:09 +0100 Subject: [PATCH 2/3] References added --- compiler/rustc_error_codes/src/error_codes/E0546.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_error_codes/src/error_codes/E0546.md b/compiler/rustc_error_codes/src/error_codes/E0546.md index c5313490f2e5f..11f2bebba43ff 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0546.md +++ b/compiler/rustc_error_codes/src/error_codes/E0546.md @@ -19,9 +19,16 @@ To fix the issue you need to provide the `feature` field. #![feature(staged_api)] #![stable(since = "1.0.0", feature = "test")] -#[unstable(feature = "unstable_fn", issue = "none")] +#[unstable(feature = "unstable_fn", issue = "none")] // ok!! fn unstable_fn() {} -#[stable(feature = "stable_fn", since = "1.0.0")] +#[stable(feature = "stable_fn", since = "1.0.0")] // ok!! fn stable_fn() {} ``` + +See the [How Rust is Made and “Nightly Rust”][how-rust-made-nightly] appendix +of the Book and the [Stability attributes][stability-attributes] section of the +Rustc Dev Guide for more details. + +[how-rust-made-nightly]: https://doc.rust-lang.org/book/appendix-07-nightly-rust.html +[stability-attributes]: https://rustc-dev-guide.rust-lang.org/stability.html From ac6c09a980ff0785f0be209c86cb6da563f0ad26 Mon Sep 17 00:00:00 2001 From: Jesus Rubio Date: Sat, 6 Feb 2021 19:45:43 +0100 Subject: [PATCH 3/3] Typo fix --- compiler/rustc_error_codes/src/error_codes/E0546.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_error_codes/src/error_codes/E0546.md b/compiler/rustc_error_codes/src/error_codes/E0546.md index 11f2bebba43ff..0073357b5ea84 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0546.md +++ b/compiler/rustc_error_codes/src/error_codes/E0546.md @@ -19,10 +19,10 @@ To fix the issue you need to provide the `feature` field. #![feature(staged_api)] #![stable(since = "1.0.0", feature = "test")] -#[unstable(feature = "unstable_fn", issue = "none")] // ok!! +#[unstable(feature = "unstable_fn", issue = "none")] // ok! fn unstable_fn() {} -#[stable(feature = "stable_fn", since = "1.0.0")] // ok!! +#[stable(feature = "stable_fn", since = "1.0.0")] // ok! fn stable_fn() {} ```