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

use question mark operator in a few places. #69621

Merged
merged 1 commit into from
Mar 4, 2020
Merged

Conversation

matthiaskrgr
Copy link
Member

No description provided.

@rust-highfive
Copy link
Collaborator

r? @petrochenkov

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

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 1, 2020
@Centril
Copy link
Contributor

Centril commented Mar 1, 2020

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion

@bors
Copy link
Contributor

bors commented Mar 1, 2020

⌛ Trying commit a0db435 with merge 032ea12d466ad47682e98cb01bd3caa153b9df7a...

@matthiaskrgr
Copy link
Member Author

Interesting, is there a performance difference to be expected?
I tried to whip up a minimal godbolt example and the assembly seemed identical: for a? and if a.is_none() { return None; }

https://rust.godbolt.org/z/sXmqcP

@Centril
Copy link
Contributor

Centril commented Mar 1, 2020

The ? operator can be slower in some cases due to a lack of optimizations and inlining, so I'm just verifying that there are no regressions, although I don't necessarily expect that there will be any regressions.

@bors
Copy link
Contributor

bors commented Mar 2, 2020

☀️ Try build successful - checks-azure
Build commit: 032ea12d466ad47682e98cb01bd3caa153b9df7a (032ea12d466ad47682e98cb01bd3caa153b9df7a)

@rust-timer
Copy link
Collaborator

Queued 032ea12d466ad47682e98cb01bd3caa153b9df7a with parent beac68a, future comparison URL.

@petrochenkov
Copy link
Contributor

Perf looks very strange, a change like this shouldn't result in such speedups.

@petrochenkov
Copy link
Contributor

I'm not sure this increases readability, a?; looks a bit strange if the result is not assigned to anything (let b = a?;).

@petrochenkov
Copy link
Contributor

Eh, @bors r+ anyway, I guess.

@bors
Copy link
Contributor

bors commented Mar 2, 2020

📌 Commit a0db435 has been approved by petrochenkov

@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 Mar 2, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Mar 2, 2020
use question mark operator in a few places.
bors added a commit that referenced this pull request Mar 2, 2020
Rollup of 7 pull requests

Successful merges:

 - #69620 (doc(librustc_error_codes): add long error explanation for E0719)
 - #69621 (use question mark operator in a few places.)
 - #69626 (Toolstate: don't duplicate nightly tool list.)
 - #69633 (Update my mailmap entry)
 - #69634 (clean up E0378 explanation)
 - #69637 (Don't convert Results to Options just for matching.)
 - #69641 (Update books)

Failed merges:

r? @ghost
@bors
Copy link
Contributor

bors commented Mar 3, 2020

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

@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 Mar 3, 2020
@petrochenkov
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Mar 3, 2020

📌 Commit ecae6e4 has been approved by petrochenkov

@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 Mar 3, 2020
bors added a commit that referenced this pull request Mar 3, 2020
Rollup of 6 pull requests

Successful merges:

 - #69565 (miri engine: turn some debug_assert into assert)
 - #69621 (use question mark operator in a few places.)
 - #69650 (cleanup more iterator usages (and other things))
 - #69653 (use conditions directly)
 - #69665 (Invoke OptimizerLastEPCallbacks in PreLinkThinLTO)
 - #69670 (Add explanation for E0379)

Failed merges:

r? @ghost
@bors bors merged commit 2cfab73 into rust-lang:master Mar 4, 2020
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants