mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-16 21:15:18 +03:00
Rollup merge of #135406 - Aditya-PS-05:fix/unstable-lint-docs, r=compiler-errors
Update unstable lint docs to include required feature attributes closes #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.
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
/// ### Example
|
||||
///
|
||||
/// ```rust,edition2018
|
||||
/// #![feature(unqualified_local_imports)]
|
||||
/// #![warn(unqualified_local_imports)]
|
||||
///
|
||||
/// mod localmod {
|
||||
|
||||
@@ -2671,6 +2671,7 @@
|
||||
/// ### Example
|
||||
///
|
||||
/// ```rust
|
||||
/// #![feature(strict_provenance_lints)]
|
||||
/// #![warn(fuzzy_provenance_casts)]
|
||||
///
|
||||
/// fn main() {
|
||||
@@ -2714,6 +2715,7 @@
|
||||
/// ### Example
|
||||
///
|
||||
/// ```rust
|
||||
/// #![feature(strict_provenance_lints)]
|
||||
/// #![warn(lossy_provenance_casts)]
|
||||
///
|
||||
/// fn main() {
|
||||
@@ -4033,6 +4035,8 @@
|
||||
/// ### Example
|
||||
///
|
||||
/// ```rust
|
||||
/// // 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)]
|
||||
/// ```
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user