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 items_after_test_module: Ignore imported modules #10719

Merged

Conversation

blyxyas
Copy link
Member

@blyxyas blyxyas commented Apr 27, 2023

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
Copy link
Collaborator

rustbot commented Apr 27, 2023

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
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
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
Member Author

Choose a reason for hiding this comment

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

Fixed

Comment on lines 13 to 15
fn should_lint() {}

const SHOULD_ALSO_LINT: usize = 1;
Copy link
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
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
Member

Thanks!

@bors r+

@bors
Copy link
Collaborator

bors commented Apr 28, 2023

📌 Commit 395b1f5 has been approved by Alexendoo

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Apr 28, 2023

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

@bors
Copy link
Collaborator

bors commented Apr 28, 2023

☀️ 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