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

Lint against mod lib; #9677

Closed
crlf0710 opened this issue Oct 18, 2022 · 4 comments
Closed

Lint against mod lib; #9677

crlf0710 opened this issue Oct 18, 2022 · 4 comments
Assignees
Labels
A-lint Area: New lints good-first-issue These issues are a good way to get started with Clippy

Comments

@crlf0710
Copy link
Member

What it does

Found that some beginners write mod lib; in main.rs to reference lib.rs contents. Definitely not what people actually want to do!

Lint Name

No response

Category

suspicious

Advantage

No response

Drawbacks

No response

Example

// main.rs
mod lib;

Could be written as:

use this_package as lib;
@crlf0710 crlf0710 added the A-lint Area: New lints label Oct 18, 2022
@Alexendoo Alexendoo added the good-first-issue These issues are a good way to get started with Clippy label Oct 20, 2022
@st3fan
Copy link

st3fan commented Oct 23, 2022

@crlf0710 @Alexendoo I'm interested in working on this issue.

@Alexendoo
Copy link
Member

Great, thanks @st3fan!

If you need any help at all feel free to ask in here or on Zulip

st3fan added a commit to st3fan/rust-clippy that referenced this issue Oct 25, 2022
st3fan added a commit to st3fan/rust-clippy that referenced this issue Oct 25, 2022
st3fan added a commit to st3fan/rust-clippy that referenced this issue Oct 25, 2022
@Alexendoo
Copy link
Member

Looks like rustc had beaten us to this one rust-lang/rust#94467

Sorry about that @st3fan, I wasn't aware of that lint at the time

@st3fan
Copy link

st3fan commented Nov 8, 2022

No worries. I enjoyed hacking on this and I learned some new things. I'll find something else to contribute!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Area: New lints good-first-issue These issues are a good way to get started with Clippy
Projects
None yet
Development

No branches or pull requests

3 participants