Skip to content

Add "unnecessary mut passed" lint #354

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 8 commits into from
Oct 6, 2015

Conversation

Pyriphlegethon
Copy link
Contributor

This is the implementation of the first lint mentioned in issue #353. I tested it on some external crates (racer, winapi-rs, ...) and some of my own projects, seems to work properly.
Note that this doesn't work for methods currently.
Edit: It does now.

},
ExprMethodCall(ref name, _, ref arguments) => {
let method_call = MethodCall::expr(e.id);
let borrowed_table = cx.tcx.tables.borrow();
Copy link
Contributor

Choose a reason for hiding this comment

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

These two blocks are almost duplicated. It should be possible to factor the common code out into a helper method.

@birkenfeld
Copy link
Contributor

A few test cases would be nice :)

@Pyriphlegethon
Copy link
Contributor Author

Thanks for the feedback 😄. I'm still a bit new to rust, but it get's better every day.

@Pyriphlegethon
Copy link
Contributor Author

Any idea why this build is failing? The file that the compiler complained about hasn't changed.

@Manishearth
Copy link
Member

We needed a rustup. Fixed

Manishearth added a commit that referenced this pull request Oct 6, 2015
Add "unnecessary mut passed" lint
@Manishearth Manishearth merged commit 3e475e9 into rust-lang:master Oct 6, 2015
@Manishearth
Copy link
Member

Sorry about forgetting about this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants