Skip to content

Suggest using map_or when Option<&T>::unwrap_or where T: Deref fails #127629

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 5 commits into from
Jul 16, 2024

Conversation

tesuji
Copy link
Contributor

@tesuji tesuji commented Jul 11, 2024

Fix #127545

Split from #127596 (review)

@rustbot
Copy link
Collaborator

rustbot commented Jul 11, 2024

r? @wesleywiser

rustbot has assigned @wesleywiser.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 11, 2024
@bors
Copy link
Collaborator

bors commented Jul 12, 2024

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

@tesuji tesuji force-pushed the suggest-option-ref-unwrap_or branch from b5ee095 to be13cc5 Compare July 12, 2024 08:16
@rust-log-analyzer

This comment has been minimized.

@tesuji tesuji force-pushed the suggest-option-ref-unwrap_or branch from be13cc5 to 5e1cabe Compare July 12, 2024 08:43
@rustbot rustbot assigned estebank and unassigned wesleywiser Jul 12, 2024
@estebank
Copy link
Contributor

r? @estebank

@estebank estebank added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jul 12, 2024
@tesuji tesuji force-pushed the suggest-option-ref-unwrap_or branch from 3d85271 to 9e35b9a Compare July 13, 2024 01:18
@tesuji
Copy link
Contributor Author

tesuji commented Jul 13, 2024

@rustbot label -S-waiting-on-author

@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jul 13, 2024
@tesuji tesuji force-pushed the suggest-option-ref-unwrap_or branch from 9e35b9a to bdc9df2 Compare July 15, 2024 12:55
@estebank
Copy link
Contributor

@bors r+

@bors
Copy link
Collaborator

bors commented Jul 15, 2024

📌 Commit bdc9df2 has been approved by estebank

It is now in the queue for this repository.

@bors bors removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 15, 2024
@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jul 15, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jul 15, 2024
…r, r=estebank

Suggest using `map_or` when `Option<&T>::unwrap_or where T: Deref` fails

Fix rust-lang#127545

Split from rust-lang#127596 (review)
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jul 15, 2024
…r, r=estebank

Suggest using `map_or` when `Option<&T>::unwrap_or where T: Deref` fails

Fix rust-lang#127545

Split from rust-lang#127596 (review)
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 15, 2024
…iaskrgr

Rollup of 5 pull requests

Successful merges:

 - rust-lang#120990 (Suggest a borrow when using dbg)
 - rust-lang#127047 (fix least significant digits of f128 associated constants)
 - rust-lang#127629 (Suggest using `map_or` when `Option<&T>::unwrap_or where T: Deref` fails)
 - rust-lang#127770 (Update books)
 - rust-lang#127780 (Make sure trait def ids match before zipping args in `note_function_argument_obligation`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors
Copy link
Collaborator

bors commented Jul 15, 2024

⌛ Testing commit bdc9df2 with merge cae4a84...

@bors
Copy link
Collaborator

bors commented Jul 16, 2024

☀️ Test successful - checks-actions
Approved by: estebank
Pushing cae4a84 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jul 16, 2024
@bors bors merged commit cae4a84 into rust-lang:master Jul 16, 2024
7 checks passed
@rustbot rustbot added this to the 1.81.0 milestone Jul 16, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (cae4a84): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.1% [-0.1%, -0.1%] 1
All ❌✅ (primary) - - 0

Max RSS (memory usage)

This benchmark run did not return any relevant results for this metric.

Cycles

Results (secondary 0.2%)

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.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.8% [2.8%, 2.8%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.4% [-2.4%, -2.4%] 1
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 700.249s -> 700.582s (0.05%)
Artifact size: 328.65 MiB -> 328.68 MiB (0.01%)

@tesuji tesuji deleted the suggest-option-ref-unwrap_or branch July 16, 2024 04:19
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve compile errors for type mismatch when encoutering unwrap_or
7 participants