mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-27 07:00:55 +00:00
2da0edbdf1
Until now, the lint only emitted a warning, when breaking public API. Now it doesn't lint at all when the config value is not set to `false`, bringing it in line with the other lints using this config value. Also ensures that this config value is documented in the lint.
24 lines
668 B
Rust
24 lines
668 B
Rust
// If both `inner_async3` and `inner_async4` are present, aliases are declared after
|
|
// they're used in `inner_async4` for some reasons... This test ensures that no
|
|
// only `v` is marked as not used mutably in `inner_async4`.
|
|
|
|
#![allow(clippy::redundant_closure_call)]
|
|
#![warn(clippy::needless_pass_by_ref_mut)]
|
|
|
|
async fn inner_async3(x: &i32, y: &mut u32) {
|
|
//~^ ERROR: this argument is a mutable reference, but not used mutably
|
|
async {
|
|
*y += 1;
|
|
}
|
|
.await;
|
|
}
|
|
|
|
async fn inner_async4(u: &mut i32, v: &u32) {
|
|
//~^ ERROR: this argument is a mutable reference, but not used mutably
|
|
async {
|
|
*u += 1;
|
|
}
|
|
.await;
|
|
}
|
|
|
|
fn main() {}
|