Skip to content

Commit 6812da4

Browse files
Rollup merge of rust-lang#135406 - Aditya-PS-05:fix/unstable-lint-docs, r=compiler-errors
Update unstable lint docs to include required feature attributes closes rust-lang#135298 ## Summary This PR updates the documentation examples for the following unstable lints to ensure they include the necessary feature attributes for proper usage: - fuzzy_provenance_casts - lossy_provenance_casts - unqualified_local_imports - test_unstable_lint ## Changes Made: - Added the appropriate #![feature(...)] attributes to the example code for each lint. - Updated the examples to produce correct and meaningful warnings, ensuring they align with current lint behavior. Reference: - Used the `must_not_suspend` lint documentation as a template for these updates.
2 parents b34ce62 + 7ece88a commit 6812da4

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

compiler/rustc_lint/src/unqualified_local_imports.rs

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ declare_lint! {
1212
/// ### Example
1313
///
1414
/// ```rust,edition2018
15+
/// #![feature(unqualified_local_imports)]
1516
/// #![warn(unqualified_local_imports)]
1617
///
1718
/// mod localmod {

compiler/rustc_lint_defs/src/builtin.rs

+4
Original file line numberDiff line numberDiff line change
@@ -2671,6 +2671,7 @@ declare_lint! {
26712671
/// ### Example
26722672
///
26732673
/// ```rust
2674+
/// #![feature(strict_provenance_lints)]
26742675
/// #![warn(fuzzy_provenance_casts)]
26752676
///
26762677
/// fn main() {
@@ -2714,6 +2715,7 @@ declare_lint! {
27142715
/// ### Example
27152716
///
27162717
/// ```rust
2718+
/// #![feature(strict_provenance_lints)]
27172719
/// #![warn(lossy_provenance_casts)]
27182720
///
27192721
/// fn main() {
@@ -4033,6 +4035,8 @@ declare_lint! {
40334035
/// ### Example
40344036
///
40354037
/// ```rust
4038+
/// // This lint is intentionally used to test the compiler's behavior
4039+
/// // when an unstable lint is enabled without the corresponding feature gate.
40364040
/// #![allow(test_unstable_lint)]
40374041
/// ```
40384042
///

0 commit comments

Comments
 (0)