Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some lints documentation #92840

Merged
merged 2 commits into from
Jan 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 37 additions & 5 deletions compiler/rustc_lint_defs/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1805,7 +1805,7 @@ declare_lint! {
///
/// ### Example
///
/// ```
/// ```rust
/// if let _ = 123 {
/// println!("always runs!");
/// }
Expand Down Expand Up @@ -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
///
Expand Down Expand Up @@ -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
///
Expand Down Expand Up @@ -2788,7 +2810,7 @@ declare_lint! {
///
/// ### Example
///
/// ```compile_fail
/// ```rust,compile_fail
/// #![feature(staged_api)]
///
/// #[derive(Clone)]
Expand Down Expand Up @@ -3618,7 +3640,17 @@ declare_lint! {
/// 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
///
Expand Down