-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
A small diagnostic improvement for dropping_copy_types #125433
Conversation
rustbot has assigned @petrochenkov. Use |
a84f56a
to
1bba58c
Compare
tests/ui/lint/dropping_copy_types-issue-125189-can-not-fixed.rs
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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.
(you will have to wait for @compiler-errors for the final approval)
Btw, the same improvement can also be done for the |
Thank you very much, I tend to implement in follow-up PRs. |
@bors r=Urgau |
A small diagnostic improvement for dropping_copy_types For a value `m` which implements `Copy` trait, `drop(m);` does nothing. We now suggest user to ignore it by a abstract and general note: `let _ = ...`. I think we can give a clearer note here: `let _ = m;` fixes rust-lang#125189 <!-- If this PR is related to an unstable feature or an otherwise tracked effort, please link to the relevant tracking issue here. If you don't know of a related tracking issue or there are none, feel free to ignore this. This PR will get automatically assigned to a reviewer. In case you would like a specific user to review your work, you can assign it to them by using r? <reviewer name> -->
…kingjubilee Rollup of 9 pull requests Successful merges: - rust-lang#124080 (Some unstable changes to where opaque types get defined) - rust-lang#125271 (use posix_memalign on almost all Unix targets) - rust-lang#125433 (A small diagnostic improvement for dropping_copy_types) - rust-lang#125498 (Stop using the avx512er and avx512pf x86 target features) - rust-lang#125510 (remove proof tree formatting, make em shallow) - rust-lang#125513 (Don't eagerly monomorphize drop for types that are impossible to instantiate) - rust-lang#125514 (Structurally resolve before `builtin_index` in EUV) - rust-lang#125515 ( bootstrap: support target specific config overrides ) - rust-lang#125527 (Add manual Sync impl for ReentrantLockGuard) r? `@ghost` `@rustbot` modify labels: rollup
A small diagnostic improvement for dropping_copy_types For a value `m` which implements `Copy` trait, `drop(m);` does nothing. We now suggest user to ignore it by a abstract and general note: `let _ = ...`. I think we can give a clearer note here: `let _ = m;` fixes rust-lang#125189 <!-- If this PR is related to an unstable feature or an otherwise tracked effort, please link to the relevant tracking issue here. If you don't know of a related tracking issue or there are none, feel free to ignore this. This PR will get automatically assigned to a reviewer. In case you would like a specific user to review your work, you can assign it to them by using r? <reviewer name> -->
A job failed! Check out the build log: (web) (plain) Click to see the possible cause of the failure (guessed by this bot)
|
💔 Test failed - checks-actions |
@bors r=Urgau |
💡 This pull request was already approved, no need to approve it again.
|
Hi, Thanks to the committers who are working hard to merge this PR. |
A small diagnostic improvement for dropping_copy_types For a value `m` which implements `Copy` trait, `drop(m);` does nothing. We now suggest user to ignore it by a abstract and general note: `let _ = ...`. I think we can give a clearer note here: `let _ = m;` fixes rust-lang#125189 <!-- If this PR is related to an unstable feature or an otherwise tracked effort, please link to the relevant tracking issue here. If you don't know of a related tracking issue or there are none, feel free to ignore this. This PR will get automatically assigned to a reviewer. In case you would like a specific user to review your work, you can assign it to them by using r? <reviewer name> -->
💔 Test failed - checks-actions |
rust-lang/cargo#13964 was merged in #125682. Let's retry merging this PR. @bors r=Urgau |
💡 This pull request was already approved, no need to approve it again.
|
☀️ Test successful - checks-actions |
Finished benchmarking commit (5870f1c): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)Results (primary 2.4%, secondary -2.8%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 667.785s -> 667.011s (-0.12%) |
…ke_drop_lint, r=Urgau Make lint: `lint_dropping_references` `lint_forgetting_copy_types` `lint_forgetting_references` give suggestion if possible. This is a follow-up PR of rust-lang#125433. When it's merged, I want change lint `dropping_copy_types` to use the same `Subdiagnostic` struct `UseLetUnderscoreIgnoreSuggestion` which is added in this PR. Hi, Thank you(`@Urgau` ) again for your help in the previous PR. If your time permits, please also take a look at this one. r? compiler <!-- If this PR is related to an unstable feature or an otherwise tracked effort, please link to the relevant tracking issue here. If you don't know of a related tracking issue or there are none, feel free to ignore this. This PR will get automatically assigned to a reviewer. In case you would like a specific user to review your work, you can assign it to them by using r? <reviewer name> -->
As lint dropping_copy_types will give suggsetion in this situation.(Changed in rust-lang/rust#125433)
For a value
m
which implementsCopy
trait,drop(m);
does nothing.We now suggest user to ignore it by a abstract and general note:
let _ = ...
.I think we can give a clearer note here:
let _ = m;
fixes #125189