Skip to content

Remove useless drop of copy type #12136

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from May 13, 2023
Merged

Remove useless drop of copy type #12136

merged 1 commit into from May 13, 2023

Conversation

heiher
Copy link
Contributor

@heiher heiher commented May 13, 2023

What does this PR try to resolve?

This PR aims to remove useless drop of copy type to clear warnings that reported after rust-lang/rust#109732

warning: calls to `std::mem::drop` with a value that implements `Copy` does nothing
    --> src/cargo/core/compiler/job_queue/mod.rs:1048:21
     |
1048 |                        drop(write!(
     |  ______________________^____-
     | | _____________________|
     | ||
1049 | ||                         message,
1050 | ||                         " (run `{command} --{args}` to apply {suggestions})"
1051 | ||                     ))
     | ||_____________________-^
     | |______________________|
     |                        argument has type `Result<(), std::fmt::Error>`
     |
     = note: use `let _ = ...` to ignore the expression or result
     = note: `#[warn(drop_copy)]` on by default

How should we test and review this PR?

cargo build && cargo test # without any warnings

Additional information

None

@rustbot
Copy link
Collaborator

rustbot commented May 13, 2023

r? @weihanglo

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added A-build-execution Area: anything dealing with executing the compiler A-unstable Area: nightly unstable support S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 13, 2023
@rustbot rustbot added the A-testing-cargo-itself Area: cargo's tests label May 13, 2023
Copy link
Member

@0xPoe 0xPoe left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks!

Copy link
Member

@weihanglo weihanglo left a comment

Choose a reason for hiding this comment

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

Thank you all for the patch and the review!

@weihanglo
Copy link
Member

@bors r=hi-rustin

@bors
Copy link
Contributor

bors commented May 13, 2023

📌 Commit 6a9cb23 has been approved by hi-rustin

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 13, 2023
@bors
Copy link
Contributor

bors commented May 13, 2023

⌛ Testing commit 6a9cb23 with merge 651799a...

@bors
Copy link
Contributor

bors commented May 13, 2023

☀️ Test successful - checks-actions
Approved by: hi-rustin
Pushing 651799a to master...

@bors bors merged commit 651799a into rust-lang:master May 13, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request May 17, 2023
Update cargo

8 commits in 13413c64ff88dd6c2824e9eb9374fc5f10895d28..09276c703a473ab33daaeb94917232e80eefd628
2023-05-10 13:46:18 +0000 to 2023-05-16 21:43:35 +0000
- docs: Clarify that crates.io doesn't link to docs.rs right away. (rust-lang/cargo#12146)
- docs(ref): Clarify MSRV is generally minor (rust-lang/cargo#12122)
- Fix `check_for_file_and_add`'s check for conflict file (rust-lang/cargo#12135)
- Fixes: Incorrect document link (rust-lang/cargo#12143)
- doc: intra-doc links and doc comments for build script (rust-lang/cargo#12133)
- Add Cargo team charter. (rust-lang/cargo#12010)
- Remove useless drop of copy type (rust-lang/cargo#12136)
- Fix dep/feat syntax with hidden implicit optional dependencies (rust-lang/cargo#12130)

r? ghost
This was referenced May 19, 2023
bors added a commit that referenced this pull request May 23, 2023
[beta-1.70] backport #12165

Beta backports:

- #12165
  - Adjusted a bit since `TomlDebugInfo::None` was not there in 1.70.0. It was a simple u32 `0`.

In order to make CI pass, the following PRs are also cherry-picked:

- #12136
@ehuss ehuss added this to the 1.71.0 milestone May 30, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-build-execution Area: anything dealing with executing the compiler A-testing-cargo-itself Area: cargo's tests A-unstable Area: nightly unstable support S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants