Skip to content

Introduce as_deref to Option #62421

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 4 commits into from
Jul 26, 2019
Merged

Introduce as_deref to Option #62421

merged 4 commits into from
Jul 26, 2019

Conversation

JohnTitor
Copy link
Member

@JohnTitor JohnTitor commented Jul 5, 2019

This is re-submission for #59628.
Renames deref() to as_deref() and adds deref_mut() impls and tests.

CC #50264

r? @Kimundi
(I picked you as you're the previous reviewer.)

@bors
Copy link
Collaborator

bors commented Jul 7, 2019

☔ The latest upstream changes (presumably #62458) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jul 7, 2019
@JohnTitor
Copy link
Member Author

Rebased

@rustbot modify labels: +S-waiting-on-review and -S-waiting-on-author

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 7, 2019
@bors
Copy link
Collaborator

bors commented Jul 17, 2019

☔ The latest upstream changes (presumably #62596) made this pull request unmergeable. Please resolve the merge conflicts.

@Alexendoo
Copy link
Member

Ping from triage, any updates? @Kimundi

@Dylan-DPC-zz
Copy link

can anyone from @rust-lang/libs review this?

@alexcrichton
Copy link
Member

@bors: r+

r? @alexcrichton

@bors
Copy link
Collaborator

bors commented Jul 25, 2019

📌 Commit 59634bc has been approved by alexcrichton

@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 Jul 25, 2019
@alexcrichton
Copy link
Member

Sorry for the delay @JohnTitor!

Centril added a commit to Centril/rust that referenced this pull request Jul 25, 2019
Introduce `as_deref` to Option

This is re-submission for rust-lang#59628.
Renames `deref()` to `as_deref()` and adds `deref_mut()` impls and tests.

CC rust-lang#50264

r? @Kimundi
(I picked you as you're the previous reviewer.)
Centril added a commit to Centril/rust that referenced this pull request Jul 26, 2019
Introduce `as_deref` to Option

This is re-submission for rust-lang#59628.
Renames `deref()` to `as_deref()` and adds `deref_mut()` impls and tests.

CC rust-lang#50264

r? @Kimundi
(I picked you as you're the previous reviewer.)
bors added a commit that referenced this pull request Jul 26, 2019
Rollup of 14 pull requests

Successful merges:

 - #62084 (allow clippy::unreadable_literal in unicode tables)
 - #62421 (Introduce `as_deref` to Option)
 - #62692 (rustc: precompute the largest Niche and store it in LayoutDetails.)
 - #62801 (Remove support for -Zlower-128bit-ops)
 - #62828 (Remove vector fadd/fmul reduction workarounds)
 - #62862 (code cleanup)
 - #62897 (Attempt to fix backtrace tests on i686-msvc)
 - #62904 (Disable d32 on armv6 hf targets)
 - #62907 (Initialize the MSP430 AsmParser)
 - #62956 (Implement slow-path for FirstSets::first)
 - #62963 (Allow lexer to recover from some homoglyphs)
 - #62970 (ci: gate toolstate repo pushes on the TOOLSTATE_PUBLISH envvar)
 - #62983 (Remove needless indirection through Rc)
 - #62985 (librustc_errors: Support ui-testing flag in annotate-snippet emitter)

Failed merges:

r? @ghost
Centril added a commit to Centril/rust that referenced this pull request Jul 26, 2019
Introduce `as_deref` to Option

This is re-submission for rust-lang#59628.
Renames `deref()` to `as_deref()` and adds `deref_mut()` impls and tests.

CC rust-lang#50264

r? @Kimundi
(I picked you as you're the previous reviewer.)
Centril added a commit to Centril/rust that referenced this pull request Jul 26, 2019
Introduce `as_deref` to Option

This is re-submission for rust-lang#59628.
Renames `deref()` to `as_deref()` and adds `deref_mut()` impls and tests.

CC rust-lang#50264

r? @Kimundi
(I picked you as you're the previous reviewer.)
bors added a commit that referenced this pull request Jul 26, 2019
Rollup of 22 pull requests

Successful merges:

 - #62084 (allow clippy::unreadable_literal in unicode tables)
 - #62120 (Add missing type links in documentation)
 - #62310 (Add missing doc links in boxed module)
 - #62421 (Introduce `as_deref` to Option)
 - #62583 (Implement Unpin for all raw pointers)
 - #62692 (rustc: precompute the largest Niche and store it in LayoutDetails.)
 - #62801 (Remove support for -Zlower-128bit-ops)
 - #62828 (Remove vector fadd/fmul reduction workarounds)
 - #62862 (code cleanup)
 - #62904 (Disable d32 on armv6 hf targets)
 - #62907 (Initialize the MSP430 AsmParser)
 - #62956 (Implement slow-path for FirstSets::first)
 - #62963 (Allow lexer to recover from some homoglyphs)
 - #62964 (clarify and unify some type test names)
 - #62970 (ci: gate toolstate repo pushes on the TOOLSTATE_PUBLISH envvar)
 - #62980 (std: Add more accessors for `Metadata` on Windows)
 - #62983 (Remove needless indirection through Rc)
 - #62985 (librustc_errors: Support ui-testing flag in annotate-snippet emitter)
 - #63002 (error_index_generator should output stdout/stderr when it panics.)
 - #63004 (Add test for issue-54062)
 - #63007 (ci: debug network failures while downloading awscli from PyPI)
 - #63009 (Remove redundant `mut` from variable declaration.)

Failed merges:

r? @ghost
@bors bors merged commit 59634bc into rust-lang:master Jul 26, 2019
@JohnTitor JohnTitor deleted the U007D-master branch July 27, 2019 02:48
@H2CO3
Copy link

H2CO3 commented Aug 16, 2019

An interesting problem this should somehow solve but doesn't is converting Option<&T> to Option<&<T as Deref>::Target>. E.g. the following doesn't compile with the error saying that it's expecting a str but got a String:

Playground link

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
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.

9 participants