Skip to content

ui_test annotation cleanup #14232

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

Merged
merged 1 commit into from
Feb 16, 2025
Merged
Show file tree
Hide file tree
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
6 changes: 1 addition & 5 deletions tests/ui/asm_syntax_not_x86.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//@ignore-target: i686 x86
//@needs-asm-support
//@check-pass

#[warn(clippy::inline_asm_x86_intel_syntax)]
#[warn(clippy::inline_asm_x86_att_syntax)]
Expand All @@ -8,17 +9,12 @@ mod dont_warn {

pub(super) unsafe fn use_asm() {
asm!("");
//~^ inline_asm_x86_intel_syntax
asm!("", options());
//~^ inline_asm_x86_intel_syntax
asm!("", options(nostack));
//~^ inline_asm_x86_intel_syntax
}

global_asm!("");
//~^ inline_asm_x86_intel_syntax
global_asm!("", options());
//~^ inline_asm_x86_intel_syntax
}

fn main() {
Expand Down
5 changes: 1 addition & 4 deletions tests/ui/attrs.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#![warn(clippy::inline_always, clippy::deprecated_semver)]
#![allow(clippy::assertions_on_constants, clippy::empty_line_after_outer_attr)]
#![allow(clippy::assertions_on_constants)]
#![allow(clippy::missing_docs_in_private_items, clippy::panic, clippy::unreachable)]

#[inline(always)]
//~^ inline_always

fn test_attr_lint() {
assert!(true)
}
Expand All @@ -26,12 +25,10 @@ fn empty_and_false_positive_stmt() {

#[deprecated(since = "forever")]
//~^ deprecated_semver

pub const SOME_CONST: u8 = 42;

#[deprecated(since = "1")]
//~^ deprecated_semver

pub const ANOTHER_CONST: u8 = 23;

#[deprecated(since = "0.1.1")]
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/attrs.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: the since field must contain a semver-compliant version
--> tests/ui/attrs.rs:27:14
--> tests/ui/attrs.rs:26:14
|
LL | #[deprecated(since = "forever")]
| ^^^^^^^^^^^^^^^^^
Expand All @@ -8,7 +8,7 @@ LL | #[deprecated(since = "forever")]
= help: to override `-D warnings` add `#[allow(clippy::deprecated_semver)]`

error: the since field must contain a semver-compliant version
--> tests/ui/attrs.rs:32:14
--> tests/ui/attrs.rs:30:14
|
LL | #[deprecated(since = "1")]
| ^^^^^^^^^^^
Expand Down
10 changes: 10 additions & 0 deletions tests/ui/crashes/ice-5835.fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#[rustfmt::skip]
pub struct Foo {
//~v tabs_in_doc_comments
/// 位
/// ^ Do not remove this tab character.
/// It was required to trigger the ICE.
pub bar: u8,
}

fn main() {}
5 changes: 1 addition & 4 deletions tests/ui/crashes/ice-5835.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#[rustfmt::skip]
pub struct Foo {
//~v tabs_in_doc_comments
/// 位
//~^ tabs_in_doc_comments
//~| empty_line_after_doc_comments


/// ^ Do not remove this tab character.
/// It was required to trigger the ICE.
pub bar: u8,
Expand Down
20 changes: 2 additions & 18 deletions tests/ui/crashes/ice-5835.stderr
Original file line number Diff line number Diff line change
@@ -1,27 +1,11 @@
error: using tabs in doc comments is not recommended
--> tests/ui/crashes/ice-5835.rs:3:10
--> tests/ui/crashes/ice-5835.rs:4:10
|
LL | /// 位
| ^^^^ help: consider using four spaces per tab
|
= note: `-D clippy::tabs-in-doc-comments` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::tabs_in_doc_comments)]`

error: empty lines after doc comment
--> tests/ui/crashes/ice-5835.rs:3:5
|
LL | / /// 位
... |
LL | |
| |_^
|
= note: `-D clippy::empty-line-after-doc-comments` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::empty_line_after_doc_comments)]`
= help: if the empty lines are unintentional remove them
help: if the doc comment should not document `bar` comment it out
|
LL | // /// 位
| ++

error: aborting due to 2 previous errors
error: aborting due to 1 previous error

25 changes: 10 additions & 15 deletions tests/ui/doc/unbalanced_ticks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,20 @@
#![warn(clippy::doc_markdown)]

/// This is a doc comment with `unbalanced_tick marks and several words that
//~^ empty_line_after_doc_comments

//~^ doc_markdown
/// should be `encompassed_by` tick marks because they `contain_underscores`.
/// Because of the initial `unbalanced_tick` pair, the error message is
/// very `confusing_and_misleading`.
fn main() {}

/// This paragraph has `unbalanced_tick marks and should stop_linting.
//~^ empty_line_after_doc_comments

//~^ doc_markdown
///
/// This paragraph is fine and should_be linted normally.

//~^ doc_markdown
///
/// Double unbalanced backtick from ``here to here` should lint.

//~^ doc_markdown
///
/// Double balanced back ticks ``start end`` is fine.
fn multiple_paragraphs() {}
Expand All @@ -34,16 +32,15 @@ fn in_code_block() {}
/// # `Fine`
///
/// ## not_fine
//~^ empty_line_after_doc_comments

//~^ doc_markdown
///
/// ### `unbalanced

//~^ doc_markdown
///
/// - This `item has unbalanced tick marks

//~^ doc_markdown
/// - This item needs backticks_here

//~^ doc_markdown
fn other_markdown() {}

#[rustfmt::skip]
Expand All @@ -54,8 +51,7 @@ fn other_markdown() {}
fn issue_7421() {}

/// `
//~^ empty_line_after_doc_comments

//~^ doc_markdown
fn escape_0() {}

/// Escaped \` backticks don't count.
Expand All @@ -65,8 +61,7 @@ fn escape_1() {}
fn escape_2() {}

/// Escaped \` ` backticks don't count, but unescaped backticks do.
//~^ empty_line_after_doc_comments

//~^ doc_markdown
fn escape_3() {}

/// Backslashes ` \` within code blocks don't count.
Expand Down
174 changes: 80 additions & 94 deletions tests/ui/doc/unbalanced_ticks.stderr
Original file line number Diff line number Diff line change
@@ -1,112 +1,98 @@
error: empty line after doc comment
--> tests/ui/doc/unbalanced_ticks.rs:7:1
error: backticks are unbalanced
--> tests/ui/doc/unbalanced_ticks.rs:7:5
|
LL | / /// This is a doc comment with `unbalanced_tick marks and several words that
LL | /// This is a doc comment with `unbalanced_tick marks and several words that
| _____^
LL | |
LL | |
| |_^
...
LL | fn main() {}
| --------- the comment documents this function
|
= note: `-D clippy::empty-line-after-doc-comments` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::empty_line_after_doc_comments)]`
= help: if the empty line is unintentional remove it
help: if the doc comment should not document `main` comment it out
|
LL | // /// This is a doc comment with `unbalanced_tick marks and several words that
| ++
LL | | /// should be `encompassed_by` tick marks because they `contain_underscores`.
LL | | /// Because of the initial `unbalanced_tick` pair, the error message is
LL | | /// very `confusing_and_misleading`.
| |____________________________________^
|
= help: a backtick may be missing a pair
= note: `-D clippy::doc-markdown` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::doc_markdown)]`

error: empty lines after doc comment
--> tests/ui/doc/unbalanced_ticks.rs:15:1
error: backticks are unbalanced
--> tests/ui/doc/unbalanced_ticks.rs:14:5
|
LL | / /// This paragraph has `unbalanced_tick marks and should stop_linting.
LL | |
LL | |
LL | | ///
... |
LL | | /// Double unbalanced backtick from ``here to here` should lint.
LL | |
| |_^
...
LL | fn multiple_paragraphs() {}
| ------------------------ the comment documents this function
|
= help: if the empty lines are unintentional remove them
help: if the doc comment should not document `multiple_paragraphs` comment it out
|
LL ~ // /// This paragraph has `unbalanced_tick marks and should stop_linting.
LL |
LL |
LL ~ // ///
LL ~ // /// This paragraph is fine and should_be linted normally.
LL |
LL ~ // ///
LL ~ // /// Double unbalanced backtick from ``here to here` should lint.
LL | /// This paragraph has `unbalanced_tick marks and should stop_linting.
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: a backtick may be missing a pair

error: empty lines after doc comment
--> tests/ui/doc/unbalanced_ticks.rs:36:1
error: item in documentation is missing backticks
--> tests/ui/doc/unbalanced_ticks.rs:17:32
|
LL | / /// ## not_fine
LL | |
LL | |
LL | | ///
... |
LL | | /// - This item needs backticks_here
LL | |
| |_^
LL | fn other_markdown() {}
| ------------------- the comment documents this function
|
= help: if the empty lines are unintentional remove them
help: if the doc comment should not document `other_markdown` comment it out
|
LL ~ // /// # `Fine`
LL ~ // ///
LL ~ // /// ## not_fine
LL |
LL |
LL ~ // ///
LL ~ // /// ### `unbalanced
LL |
LL ~ // ///
LL ~ // /// - This `item has unbalanced tick marks
LL |
LL ~ // /// - This item needs backticks_here
LL | /// This paragraph is fine and should_be linted normally.
| ^^^^^^^^^
|
help: try
|
LL | /// This paragraph is fine and `should_be` linted normally.
| ~~~~~~~~~~~

error: empty line after doc comment
--> tests/ui/doc/unbalanced_ticks.rs:56:1
error: backticks are unbalanced
--> tests/ui/doc/unbalanced_ticks.rs:20:5
|
LL | / /// `
LL | |
LL | |
| |_^
LL | fn escape_0() {}
| ------------- the comment documents this function
LL | /// Double unbalanced backtick from ``here to here` should lint.
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: if the empty line is unintentional remove it
help: if the doc comment should not document `escape_0` comment it out
= help: a backtick may be missing a pair

error: item in documentation is missing backticks
--> tests/ui/doc/unbalanced_ticks.rs:34:8
|
LL | // /// `
| ++
LL | /// ## not_fine
| ^^^^^^^^
|
help: try
|
LL | /// ## `not_fine`
| ~~~~~~~~~~

error: empty line after doc comment
--> tests/ui/doc/unbalanced_ticks.rs:67:1
error: backticks are unbalanced
--> tests/ui/doc/unbalanced_ticks.rs:37:5
|
LL | / /// Escaped \` ` backticks don't count, but unescaped backticks do.
LL | |
LL | |
| |_^
LL | fn escape_3() {}
| ------------- the comment documents this function
LL | /// ### `unbalanced
| ^^^^^^^^^^^^^^^
|
= help: a backtick may be missing a pair

error: backticks are unbalanced
--> tests/ui/doc/unbalanced_ticks.rs:40:5
|
LL | /// - This `item has unbalanced tick marks
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: a backtick may be missing a pair

error: item in documentation is missing backticks
--> tests/ui/doc/unbalanced_ticks.rs:42:23
|
LL | /// - This item needs backticks_here
| ^^^^^^^^^^^^^^
|
help: try
|
LL | /// - This item needs `backticks_here`
| ~~~~~~~~~~~~~~~~

error: backticks are unbalanced
--> tests/ui/doc/unbalanced_ticks.rs:53:5
|
LL | /// `
| ^
|
= help: a backtick may be missing a pair

error: backticks are unbalanced
--> tests/ui/doc/unbalanced_ticks.rs:63:5
|
= help: if the empty line is unintentional remove it
help: if the doc comment should not document `escape_3` comment it out
LL | /// Escaped \` ` backticks don't count, but unescaped backticks do.
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
LL | // /// Escaped \` ` backticks don't count, but unescaped backticks do.
| ++
= help: a backtick may be missing a pair

error: aborting due to 5 previous errors
error: aborting due to 10 previous errors

1 change: 0 additions & 1 deletion tests/ui/doc_link_with_quotes.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![warn(clippy::doc_link_with_quotes)]
#![allow(clippy::empty_line_after_doc_comments)]

fn main() {
foo()
Expand Down
Loading