Skip to content

Fix items_after_test_module: Ignore imported modules#10719

Merged
bors merged 4 commits into
rust-lang:masterfrom
blyxyas:fix-items_after_test_mod_imported_modules
Apr 28, 2023
Merged

Fix items_after_test_module: Ignore imported modules#10719
bors merged 4 commits into
rust-lang:masterfrom
blyxyas:fix-items_after_test_mod_imported_modules

Conversation

@blyxyas

@blyxyas blyxyas commented Apr 27, 2023

Copy link
Copy Markdown
Member

Fixes #10713. It does a little bit of dark magic, but intention is what really counts.
changelog:[items_after_test_module]: Ignore imported modules (mod foo;) with no body.

@rustbot

rustbot commented Apr 27, 2023

Copy link
Copy Markdown
Collaborator

r? @Alexendoo

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Apr 27, 2023

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can create a test in ui-cargo rather than ui for this, that way the module isn't being itself compiled as a test

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That or put the module in auxiliary and import it with #[path = "auxiliary/tests.rs"] mod tests;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Comment thread clippy_lints/src/items_after_test_module.rs Outdated
Comment on lines +13 to +15
fn should_lint() {}

const SHOULD_ALSO_LINT: usize = 1;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These could do with a rename

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty stderrs can be removed

@Alexendoo

Copy link
Copy Markdown
Member

Thanks!

@bors r+

@bors

bors commented Apr 28, 2023

Copy link
Copy Markdown
Contributor

📌 Commit 395b1f5 has been approved by Alexendoo

It is now in the queue for this repository.

@bors

bors commented Apr 28, 2023

Copy link
Copy Markdown
Contributor

⌛ Testing commit 395b1f5 with merge 3594d55...

@bors

bors commented Apr 28, 2023

Copy link
Copy Markdown
Contributor

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: Alexendoo
Pushing 3594d55 to master...

@bors bors merged commit 3594d55 into rust-lang:master Apr 28, 2023
@blyxyas blyxyas deleted the fix-items_after_test_mod_imported_modules branch October 5, 2023 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties

Projects

None yet

Development

Successfully merging this pull request may close these issues.

items_after_test_module disagrees with widespread practice

4 participants