Skip to content

Make it clearer that the suggestion is an alternative one #13390

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 1 commit into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion clippy_lints/src/needless_pass_by_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ impl<'tcx> LateLintPass<'tcx> for NeedlessPassByValue {
)
.is_ok()
{
diag.span_help(span, "consider marking this type as `Copy`");
diag.span_help(span, "or consider marking this type as `Copy`");
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error: this argument is passed by value, but not consumed in the function body
LL | fn test(x: Foo<'_>) {}
| ^^^^^^^ help: consider taking a reference instead: `&Foo<'_>`
|
help: consider marking this type as `Copy`
help: or consider marking this type as `Copy`
--> tests/ui/crashes/needless_pass_by_value-w-late-bound.rs:5:1
|
LL | struct Foo<'a>(&'a [(); 100]);
Expand Down
8 changes: 4 additions & 4 deletions tests/ui/needless_pass_by_value.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ error: this argument is passed by value, but not consumed in the function body
LL | fn bar_copy(x: u32, y: CopyWrapper) {
| ^^^^^^^^^^^ help: consider taking a reference instead: `&CopyWrapper`
|
help: consider marking this type as `Copy`
help: or consider marking this type as `Copy`
--> tests/ui/needless_pass_by_value.rs:141:1
|
LL | struct CopyWrapper(u32);
Expand All @@ -133,7 +133,7 @@ error: this argument is passed by value, but not consumed in the function body
LL | fn test_destructure_copy(x: CopyWrapper, y: CopyWrapper, z: CopyWrapper) {
| ^^^^^^^^^^^ help: consider taking a reference instead: `&CopyWrapper`
|
help: consider marking this type as `Copy`
help: or consider marking this type as `Copy`
--> tests/ui/needless_pass_by_value.rs:141:1
|
LL | struct CopyWrapper(u32);
Expand All @@ -145,7 +145,7 @@ error: this argument is passed by value, but not consumed in the function body
LL | fn test_destructure_copy(x: CopyWrapper, y: CopyWrapper, z: CopyWrapper) {
| ^^^^^^^^^^^ help: consider taking a reference instead: `&CopyWrapper`
|
help: consider marking this type as `Copy`
help: or consider marking this type as `Copy`
--> tests/ui/needless_pass_by_value.rs:141:1
|
LL | struct CopyWrapper(u32);
Expand All @@ -157,7 +157,7 @@ error: this argument is passed by value, but not consumed in the function body
LL | fn test_destructure_copy(x: CopyWrapper, y: CopyWrapper, z: CopyWrapper) {
| ^^^^^^^^^^^ help: consider taking a reference instead: `&CopyWrapper`
|
help: consider marking this type as `Copy`
help: or consider marking this type as `Copy`
--> tests/ui/needless_pass_by_value.rs:141:1
|
LL | struct CopyWrapper(u32);
Expand Down