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

Stabilize `Option::as_deref` and `Option::as_deref_mut` #64708

Merged
merged 1 commit into from Oct 6, 2019

Conversation

@SimonSapin
Copy link
Contributor

commented Sep 23, 2019

The tracking issue #50264 still has unresolved question for the corresponding Result methods.

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

commented Sep 23, 2019

r? @withoutboats

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

@SimonSapin

This comment has been minimized.

Copy link
Contributor Author

commented Sep 23, 2019

There seems to be consensus for this in the tracking issue #50264, but not yet for the Result methods.

@rfcbot fcp merge

@Centril Centril changed the title Stabilize Option::deref and Option::deref_mut Stabilize `Option::as_deref` and `Option::as_deref_mut` Sep 23, 2019
@Centril Centril added the relnotes label Sep 23, 2019
@Centril Centril added this to the 1.40 milestone Sep 23, 2019
@Centril

This comment has been minimized.

Copy link
Member

commented Sep 23, 2019

r? @Centril

r=me rollup when FCP completes. There are also some #![feature(inner_deref)] throughout the compiler which can now be removed.

@rfcbot

This comment has been minimized.

Copy link

commented Sep 23, 2019

Team member @SimonSapin has proposed to merge this. The next step is review by the rest of the tagged team members:

No concerns currently listed.

Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

See this document for info about what commands tagged team members can give me.

@alexcrichton

This comment has been minimized.

Copy link
Member

commented Sep 23, 2019

On a mild stylistic note, would it be possible to move these two methods into the main impl Option<T> block with where clauses?

@Centril

This comment has been minimized.

Copy link
Member

commented Sep 23, 2019

(If you want to do that where clause change here, also r=me when... ^^)

@SimonSapin

This comment has been minimized.

Copy link
Contributor Author

commented Sep 23, 2019

@alexcrichton I considered that, but the rest of the file has impl<T: Default> Option<T> {…}, impl<T: Clone> Option<&mut T> {…}, impl<T: fmt::Debug> Option<T> {…}, etc. Changing the style for the whole file may be worth a separate PR.

The tracking issue #50264
still has unresolved question for the corresponding `Result` methods.
@SimonSapin SimonSapin force-pushed the SimonSapin:option-deref branch from 4e5e624 to 0797712 Sep 23, 2019
@SimonSapin

This comment has been minimized.

Copy link
Contributor Author

commented Sep 23, 2019

There are also some #![feature(inner_deref)] throughout the compiler which can now be removed.

Done.

@rfcbot

This comment has been minimized.

Copy link

commented Sep 24, 2019

🔔 This is now entering its final comment period, as per the review above. 🔔

@rfcbot

This comment has been minimized.

Copy link

commented Oct 4, 2019

The final comment period, with a disposition to merge, as per the review above, is now complete.

As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.

The RFC will be merged soon.

@Centril

This comment has been minimized.

Copy link
Member

commented Oct 4, 2019

@bors r+ rollup

@bors

This comment has been minimized.

Copy link
Contributor

commented Oct 4, 2019

📌 Commit 0797712 has been approved by Centril

Centril added a commit to Centril/rust that referenced this pull request Oct 4, 2019
Stabilize `Option::as_deref` and `Option::as_deref_mut`

The tracking issue rust-lang#50264 still has unresolved question for the corresponding `Result` methods.
@Centril Centril referenced this pull request Oct 4, 2019
bors added a commit that referenced this pull request Oct 5, 2019
Rollup of 8 pull requests

Successful merges:

 - #64708 (Stabilize `Option::as_deref` and `Option::as_deref_mut`)
 - #64909 (When encountering chained operators use heuristics to recover from bad turbofish)
 - #65011 (Do not ICE when dereferencing non-Copy raw pointer)
 - #65064 (permit asyncawait-ondeck to be added by anyone)
 - #65066 ([const-prop] Fix ICE when trying to eval polymorphic promoted MIR)
 - #65100 (Replace GeneratorSubsts with SubstsRef)
 - #65105 (Split out some passes from librustc)
 - #65106 (Allow unused attributes to avoid incremental bug)

Failed merges:

r? @ghost
bors added a commit that referenced this pull request Oct 5, 2019
Rollup of 8 pull requests

Successful merges:

 - #64708 (Stabilize `Option::as_deref` and `Option::as_deref_mut`)
 - #64909 (When encountering chained operators use heuristics to recover from bad turbofish)
 - #65011 (Do not ICE when dereferencing non-Copy raw pointer)
 - #65064 (permit asyncawait-ondeck to be added by anyone)
 - #65066 ([const-prop] Fix ICE when trying to eval polymorphic promoted MIR)
 - #65100 (Replace GeneratorSubsts with SubstsRef)
 - #65105 (Split out some passes from librustc)
 - #65106 (Allow unused attributes to avoid incremental bug)

Failed merges:

r? @ghost
tmandry added a commit to tmandry/rust that referenced this pull request Oct 5, 2019
Stabilize `Option::as_deref` and `Option::as_deref_mut`

The tracking issue rust-lang#50264 still has unresolved question for the corresponding `Result` methods.
bors added a commit that referenced this pull request Oct 5, 2019
Rollup of 15 pull requests

Successful merges:

 - #64708 (Stabilize `Option::as_deref` and `Option::as_deref_mut`)
 - #64765 (std: Reduce checks for `feature = "backtrace"`)
 - #65011 (Do not ICE when dereferencing non-Copy raw pointer)
 - #65064 (permit asyncawait-ondeck to be added by anyone)
 - #65066 ([const-prop] Fix ICE when trying to eval polymorphic promoted MIR)
 - #65095 (Sort error codes in librustc_passes)
 - #65100 (Replace GeneratorSubsts with SubstsRef)
 - #65106 (Allow unused attributes to avoid incremental bug)
 - #65113 (Fix lonely backtick)
 - #65116 (Remove unneeded visit_statement definition)
 - #65118 (Update the documented default of -Z mutable-noalias)
 - #65123 (Account for macro invocation in `let mut $pat` diagnostic.)
 - #65124 (Replace some instances of `as *[const | mut] _` with `.cast()`)
 - #65126 (Fix typo on `now()` comments)
 - #65130 (lint: extern non-exhaustive types are improper)

Failed merges:

 - #65105 (Split out some passes from librustc)

r? @ghost
bors added a commit that referenced this pull request Oct 6, 2019
Rollup of 15 pull requests

Successful merges:

 - #64708 (Stabilize `Option::as_deref` and `Option::as_deref_mut`)
 - #64765 (std: Reduce checks for `feature = "backtrace"`)
 - #65011 (Do not ICE when dereferencing non-Copy raw pointer)
 - #65064 (permit asyncawait-ondeck to be added by anyone)
 - #65066 ([const-prop] Fix ICE when trying to eval polymorphic promoted MIR)
 - #65095 (Sort error codes in librustc_passes)
 - #65100 (Replace GeneratorSubsts with SubstsRef)
 - #65106 (Allow unused attributes to avoid incremental bug)
 - #65113 (Fix lonely backtick)
 - #65116 (Remove unneeded visit_statement definition)
 - #65118 (Update the documented default of -Z mutable-noalias)
 - #65123 (Account for macro invocation in `let mut $pat` diagnostic.)
 - #65124 (Replace some instances of `as *[const | mut] _` with `.cast()`)
 - #65126 (Fix typo on `now()` comments)
 - #65130 (lint: extern non-exhaustive types are improper)

Failed merges:

 - #65105 (Split out some passes from librustc)

r? @ghost
tmandry added a commit to tmandry/rust that referenced this pull request Oct 6, 2019
Stabilize `Option::as_deref` and `Option::as_deref_mut`

The tracking issue rust-lang#50264 still has unresolved question for the corresponding `Result` methods.
bors added a commit that referenced this pull request Oct 6, 2019
Rollup of 18 pull requests

This contains changes from all the successful runs that bors marked as timed out, plus a revert of #63649 which appears to be the immediate cause of the timeouts.

Successful merges:

 - #64708 (Stabilize `Option::as_deref` and `Option::as_deref_mut`)
 - #64728 (Stabilize UdpSocket::peer_addr)
 - #64765 (std: Reduce checks for `feature = "backtrace"`)
 - #64909 (When encountering chained operators use heuristics to recover from bad turbofish)
 - #65011 (Do not ICE when dereferencing non-Copy raw pointer)
 - #65064 (permit asyncawait-ondeck to be added by anyone)
 - #65066 ([const-prop] Fix ICE when trying to eval polymorphic promoted MIR)
 - #65100 (Replace GeneratorSubsts with SubstsRef)
 - #65105 (Split out some passes from librustc)
 - #65106 (Allow unused attributes to avoid incremental bug)
 - #65113 (Fix lonely backtick)
 - #65116 (Remove unneeded visit_statement definition)
 - #65118 (Update the documented default of -Z mutable-noalias)
 - #65123 (Account for macro invocation in `let mut $pat` diagnostic.)
 - #65124 (Replace some instances of `as *[const | mut] _` with `.cast()`)
 - #65126 (Fix typo on `now()` comments)
 - #65130 (lint: extern non-exhaustive types are improper)
 - #65151 (Revert #63649 - "Upgrade Emscripten targets to use upstream LLVM backend")

Failed merges:

r? @ghost
@bors bors merged commit 0797712 into rust-lang:master Oct 6, 2019
4 checks passed
4 checks passed
pr Build #20190923.17 succeeded
Details
pr (Linux mingw-check) Linux mingw-check succeeded
Details
pr (Linux x86_64-gnu-llvm-6.0) Linux x86_64-gnu-llvm-6.0 succeeded
Details
pr (LinuxTools) LinuxTools succeeded
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.