-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Closed
Copy link
Labels
A-documentationArea: Adding or improving documentationArea: Adding or improving documentationC-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thingI-false-positiveIssue: The lint was triggered on code it shouldn't haveIssue: The lint was triggered on code it shouldn't have
Description
Summary
The config value avoid_breaking_exported_api configuration is documented as:
avoid-breaking-exported-api:bool(defaults totrue): Suppress lints whenever the suggested change would cause breakage for other crates.
However, this lint just produces a warning message that this lint breaks API instead of suppressing it.
Bonus issue: This config argument is not documented with the lint. The lint name has to be added to the macro in conf.rs.
Lint Name
needless_pass_by_ref_mut
Reproducer
I tried this code: Playground
pub fn foo(s: &mut Vec<u32>, b: &u32, x: &mut u32) {
*x += *b + s.len() as u32;
}I saw this happen:
warning: this argument is a mutable reference, but not used mutably
--> src/lib.rs:1:15
|
1 | pub fn foo(s: &mut Vec<u32>, b: &u32, x: &mut u32) {
| ^^^^^^^^^^^^^ help: consider changing to: `&Vec<u32>`
|
= warning: changing this function will impact semver compatibility
I expected to see this happen: no lint emission.
Version
rustc 1.73.0-nightly (07438b092 2023-08-16)
binary: rustc
commit-hash: 07438b0928c6691d6ee734a5a77823ec143be94d
commit-date: 2023-08-16
host: x86_64-unknown-linux-gnu
release: 1.73.0-nightly
LLVM version: 17.0.0
Additional Labels
No response
PatchMixolydic
Metadata
Metadata
Assignees
Labels
A-documentationArea: Adding or improving documentationArea: Adding or improving documentationC-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thingI-false-positiveIssue: The lint was triggered on code it shouldn't haveIssue: The lint was triggered on code it shouldn't have