Skip to content
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

remove no-op 'let _ = ' #105243

Merged
merged 1 commit into from
Dec 6, 2022
Merged

remove no-op 'let _ = ' #105243

merged 1 commit into from
Dec 6, 2022

Conversation

RalfJung
Copy link
Member

@RalfJung RalfJung commented Dec 4, 2022

Also see the discussion at #93563 (comment).

I don't know why these Drop implementations exist to begin with, given that their body does literally nothing, but did not want to change that. (It might affect dropck.)

Cc @ibraheemdev @Amanieu

@rustbot
Copy link
Collaborator

rustbot commented Dec 4, 2022

r? @Mark-Simulacrum

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

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Dec 4, 2022
@rustbot
Copy link
Collaborator

rustbot commented Dec 4, 2022

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@Amanieu
Copy link
Member

Amanieu commented Dec 4, 2022

I think we can remove these drop impls entirely. Any dropck requirements are handled by the inner drop.

@RalfJung
Copy link
Member Author

RalfJung commented Dec 4, 2022

The one concern raised by @ibraheemdev is that this is technically a breaking change -- in case anyone relied on Receiver<T>: Drop (which is a possible but rather silly bound one could use).

@Noratrieb
Copy link
Member

If you're relying on Drop bounds then you're doing something really wrong and I don't think we should support that.
There should be a lint of : Drop bounds if there isn't already.

@kpreid
Copy link
Contributor

kpreid commented Dec 4, 2022

There should be a lint of : Drop bounds if there isn't already.

There is: drop_bounds

@Mark-Simulacrum
Copy link
Member

r=me, but no opinion on whether to remove the Drop impls too. It does seem relatively harmless.

@Mark-Simulacrum Mark-Simulacrum added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 5, 2022
@RalfJung
Copy link
Member Author

RalfJung commented Dec 5, 2022

All right, I have removed the empty drop impls.

@bors r=Mark-Simulacrum

@bors
Copy link
Contributor

bors commented Dec 5, 2022

📌 Commit 9e05798e24e46f9c3c9f7f27d75d388497a27078 has been approved by Mark-Simulacrum

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Dec 5, 2022
@rust-log-analyzer

This comment has been minimized.

@RalfJung
Copy link
Member Author

RalfJung commented Dec 5, 2022

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Dec 5, 2022
@RalfJung
Copy link
Member Author

RalfJung commented Dec 5, 2022

Turns out this actually makes some test fail... I guess not then. ;)

@RalfJung
Copy link
Member Author

RalfJung commented Dec 5, 2022

@bors r=Mark-Simulacrum

@bors
Copy link
Contributor

bors commented Dec 5, 2022

📌 Commit c823dfa has been approved by Mark-Simulacrum

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Dec 5, 2022
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 5, 2022
remove no-op 'let _ = '

Also see the discussion at rust-lang#93563 (comment).

I don't know why these `Drop` implementations exist to begin with, given that their body does literally nothing, but did not want to change that. (It might affect dropck.)

Cc `@ibraheemdev` `@Amanieu`
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 5, 2022
remove no-op 'let _ = '

Also see the discussion at rust-lang#93563 (comment).

I don't know why these `Drop` implementations exist to begin with, given that their body does literally nothing, but did not want to change that. (It might affect dropck.)

Cc ``@ibraheemdev`` ``@Amanieu``
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 5, 2022
remove no-op 'let _ = '

Also see the discussion at rust-lang#93563 (comment).

I don't know why these `Drop` implementations exist to begin with, given that their body does literally nothing, but did not want to change that. (It might affect dropck.)

Cc ```@ibraheemdev``` ```@Amanieu```
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 6, 2022
remove no-op 'let _ = '

Also see the discussion at rust-lang#93563 (comment).

I don't know why these `Drop` implementations exist to begin with, given that their body does literally nothing, but did not want to change that. (It might affect dropck.)

Cc ````@ibraheemdev```` ````@Amanieu````
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 6, 2022
…iaskrgr

Rollup of 11 pull requests

Successful merges:

 - rust-lang#104439 (Add prototype to generate `COPYRIGHT` from REUSE metadata)
 - rust-lang#105005 (On E0195 point at where clause lifetime bounds)
 - rust-lang#105098 (propagate the error from parsing enum variant to the parser and emit out)
 - rust-lang#105243 (remove no-op 'let _ = ')
 - rust-lang#105254 (Recurse into nested impl-trait when computing variance.)
 - rust-lang#105287 (Synthesize substitutions for bad auto traits in dyn types)
 - rust-lang#105310 (Be more careful about unresolved exprs in suggestion)
 - rust-lang#105318 (Make `get_impl_future_output_ty` work with AFIT)
 - rust-lang#105339 (support `ConstKind::Expr` in `is_const_evaluatable` and `WfPredicates::compute`)
 - rust-lang#105340 (Avoid ICE by accounting for missing type)
 - rust-lang#105342 (Make `note_obligation_cause_code`  take a `impl ToPredicate` for predicate)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 7d8e329 into rust-lang:master Dec 6, 2022
@rustbot rustbot added this to the 1.67.0 milestone Dec 6, 2022
@RalfJung RalfJung deleted the no-op-let branch December 8, 2022 21:36
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Sep 17, 2023
Remove Drop impl of mpsc Receiver and (Sync)Sender

This change removes the empty `Drop` implementations for `mpsc::Receiver`, `mpsc::Sender` and `mpsc::SyncSender`. These implementations do not specify `#[may_dangle]`, so by removing them we make `mpsc` types play nice with drop check.

This was previously attempted in [rust-lang#105243](rust-lang#105243 (comment)) but then [abandoned due to a test failure](rust-lang#105243 (comment)). I've aligned the test with those for `Mutex` and `RwLock`.
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 17, 2023
Remove Drop impl of mpsc Receiver and (Sync)Sender

This change removes the empty `Drop` implementations for `mpsc::Receiver`, `mpsc::Sender` and `mpsc::SyncSender`. These implementations do not specify `#[may_dangle]`, so by removing them we make `mpsc` types play nice with drop check.

This was previously attempted in [rust-lang#105243](rust-lang#105243 (comment)) but then [abandoned due to a test failure](rust-lang#105243 (comment)). I've aligned the test with those for `Mutex` and `RwLock`.
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Sep 17, 2023
Rollup merge of rust-lang#114965 - benschulz:mpsc-drop, r=dtolnay

Remove Drop impl of mpsc Receiver and (Sync)Sender

This change removes the empty `Drop` implementations for `mpsc::Receiver`, `mpsc::Sender` and `mpsc::SyncSender`. These implementations do not specify `#[may_dangle]`, so by removing them we make `mpsc` types play nice with drop check.

This was previously attempted in [rust-lang#105243](rust-lang#105243 (comment)) but then [abandoned due to a test failure](rust-lang#105243 (comment)). I've aligned the test with those for `Mutex` and `RwLock`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants