Skip to content

Conversation

Twisol
Copy link
Contributor

@Twisol Twisol commented Dec 24, 2014

ref on an entire argument (as opposed to a substructure of an argument) is effectively ignored by rustc, as you only receive a reference to the value already copied as a parameter.

fn bleh(ref mut x: u8) {
}
warning: `ref` directly on a function argument is ignored. Have you considered using a reference type instead?, #[warn(clippy_toplevel_ref_arg)] on by default
fn bleh(ref mut x: u8) {
        ^~~~~~~~~

Manishearth added a commit that referenced this pull request Dec 25, 2014
Check for args like `fn foo(ref x: u8)`, where the `ref` is useless
@Manishearth Manishearth merged commit 6f99849 into rust-lang:master Dec 25, 2014
@Twisol Twisol deleted the lint-toplevel-ref-arg branch December 25, 2014 01:45
yaahc pushed a commit to yaahc/rust-clippy that referenced this pull request Mar 14, 2019
Don't rebuild dependencies if they haven't changed
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.

2 participants