Skip to content

use question mark operator in a few places. - #69621

Merged
bors merged 1 commit into
rust-lang:masterfrom
matthiaskrgr:q
Mar 4, 2020
Merged

use question mark operator in a few places.#69621
bors merged 1 commit into
rust-lang:masterfrom
matthiaskrgr:q

Conversation

@matthiaskrgr

Copy link
Copy Markdown
Member

No description provided.

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @petrochenkov

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

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

Copy link
Copy Markdown
Contributor

@bors try @rust-timer queue

@rust-timer

Copy link
Copy Markdown
Collaborator

Awaiting bors try build completion

@bors

bors commented Mar 1, 2020

Copy link
Copy Markdown
Collaborator

⌛ Trying commit a0db435 with merge 032ea12d466ad47682e98cb01bd3caa153b9df7a...

@matthiaskrgr

Copy link
Copy Markdown
MemberAuthor

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
Copy Markdown
Contributor

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

bors commented Mar 2, 2020

Copy link
Copy Markdown
Collaborator

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

@rust-timer

Copy link
Copy Markdown
Collaborator

Queued 032ea12d466ad47682e98cb01bd3caa153b9df7a with parent beac68a, future comparison URL.

@petrochenkov

Copy link
Copy Markdown
Contributor

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

@petrochenkov

Copy link
Copy Markdown
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
Copy Markdown
Contributor

Eh, @bors r+ anyway, I guess.

@bors

bors commented Mar 2, 2020

Copy link
Copy Markdown
Collaborator

📌 Commit a0db435 has been approved by petrochenkov

@borsbors 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

bors commented Mar 3, 2020

Copy link
Copy Markdown
Collaborator

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

@borsbors 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
Copy Markdown
Contributor

@bors r+

@bors

bors commented Mar 3, 2020

Copy link
Copy Markdown
Collaborator

📌 Commit ecae6e4 has been approved by petrochenkov

@borsbors 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:masterMar 4, 2020
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: 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.

6 participants

@matthiaskrgr@rust-highfive@Centril@rust-timer@bors@petrochenkov