From 562107760d6fdbe77bbcb8e1b251ef54e2bb9c7d Mon Sep 17 00:00:00 2001 From: Aditya-PS-05 Date: Sun, 12 Jan 2025 19:31:05 +0530 Subject: [PATCH 1/2] Update unstable lint docs to include required feature attributes --- compiler/rustc_lint/src/unqualified_local_imports.rs | 1 + compiler/rustc_lint_defs/src/builtin.rs | 3 +++ 2 files changed, 4 insertions(+) diff --git a/compiler/rustc_lint/src/unqualified_local_imports.rs b/compiler/rustc_lint/src/unqualified_local_imports.rs index c9dd6b32d8822..b27398a950c81 100644 --- a/compiler/rustc_lint/src/unqualified_local_imports.rs +++ b/compiler/rustc_lint/src/unqualified_local_imports.rs @@ -12,6 +12,7 @@ declare_lint! { /// ### Example /// /// ```rust,edition2018 + /// #![feature(unqualified_local_imports)] /// #![warn(unqualified_local_imports)] /// /// mod localmod { diff --git a/compiler/rustc_lint_defs/src/builtin.rs b/compiler/rustc_lint_defs/src/builtin.rs index 8399f4c12f4f5..8fbafe9c8839e 100644 --- a/compiler/rustc_lint_defs/src/builtin.rs +++ b/compiler/rustc_lint_defs/src/builtin.rs @@ -2671,6 +2671,7 @@ declare_lint! { /// ### Example /// /// ```rust + /// #![feature(strict_provenance_lints)] /// #![warn(fuzzy_provenance_casts)] /// /// fn main() { @@ -2714,6 +2715,7 @@ declare_lint! { /// ### Example /// /// ```rust + /// #![feature(strict_provenance_lints)] /// #![warn(lossy_provenance_casts)] /// /// fn main() { @@ -4033,6 +4035,7 @@ declare_lint! { /// ### Example /// /// ```rust + /// #![feature(test_unstable_lint)] /// #![allow(test_unstable_lint)] /// ``` /// From 7ece88a2d7795cb0beb719848a563c6870531632 Mon Sep 17 00:00:00 2001 From: Aditya-PS-05 Date: Mon, 13 Jan 2025 00:14:24 +0530 Subject: [PATCH 2/2] remove test_unstable_lint feature --- compiler/rustc_lint_defs/src/builtin.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_lint_defs/src/builtin.rs b/compiler/rustc_lint_defs/src/builtin.rs index 8fbafe9c8839e..0c6147f4a46c9 100644 --- a/compiler/rustc_lint_defs/src/builtin.rs +++ b/compiler/rustc_lint_defs/src/builtin.rs @@ -4035,7 +4035,8 @@ declare_lint! { /// ### Example /// /// ```rust - /// #![feature(test_unstable_lint)] + /// // This lint is intentionally used to test the compiler's behavior + /// // when an unstable lint is enabled without the corresponding feature gate. /// #![allow(test_unstable_lint)] /// ``` ///