1
Fork 0

Fix lints documents

This commit is contained in:
hafeoz 2022-01-13 03:57:44 +00:00
parent 124555a69e
commit 7b74ded9a0
2 changed files with 38 additions and 5 deletions

View file

@ -3147,6 +3147,7 @@ declare_lint! {
/// ### Example /// ### Example
/// ///
/// ```rust,compile_fail /// ```rust,compile_fail
/// # #![feature(asm)]
/// use std::arch::asm; /// use std::arch::asm;
/// ///
/// fn main() { /// fn main() {

View file

@ -1805,7 +1805,7 @@ declare_lint! {
/// ///
/// ### Example /// ### Example
/// ///
/// ``` /// ```rust
/// if let _ = 123 { /// if let _ = 123 {
/// println!("always runs!"); /// println!("always runs!");
/// } /// }
@ -2431,7 +2431,19 @@ declare_lint! {
/// } /// }
/// ``` /// ```
/// ///
/// {{produces}} /// This will produce:
///
/// ```text
/// warning: formatting may not be suitable for sub-register argument
/// --> src/main.rs:7:19
/// |
/// 7 | asm!("mov {0}, {0}", in(reg) 0i16);
/// | ^^^ ^^^ ---- for this argument
/// |
/// = note: `#[warn(asm_sub_register)]` on by default
/// = help: use the `x` modifier to have the register formatted as `ax`
/// = help: or use the `r` modifier to keep the default formatting of `rax`
/// ```
/// ///
/// ### Explanation /// ### Explanation
/// ///
@ -2470,7 +2482,17 @@ declare_lint! {
/// } /// }
/// ``` /// ```
/// ///
/// {{produces}} /// This will produce:
///
/// ```text
/// warning: avoid using `.att_syntax`, prefer using `options(att_syntax)` instead
/// --> src/main.rs:8:14
/// |
/// 8 | ".att_syntax",
/// | ^^^^^^^^^^^
/// |
/// = note: `#[warn(bad_asm_style)]` on by default
/// ```
/// ///
/// ### Explanation /// ### Explanation
/// ///
@ -2788,7 +2810,7 @@ declare_lint! {
/// ///
/// ### Example /// ### Example
/// ///
/// ```compile_fail /// ```rust,compile_fail
/// #![feature(staged_api)] /// #![feature(staged_api)]
/// ///
/// #[derive(Clone)] /// #[derive(Clone)]
@ -3618,7 +3640,17 @@ declare_lint! {
/// fn foo() {} /// fn foo() {}
/// ``` /// ```
/// ///
/// {{produces}} /// This will produce:
///
/// ```text
/// warning: duplicated attribute
/// --> src/lib.rs:2:1
/// |
/// 2 | #[test]
/// | ^^^^^^^
/// |
/// = note: `#[warn(duplicate_macro_attributes)]` on by default
/// ```
/// ///
/// ### Explanation /// ### Explanation
/// ///