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 try{} in try_fold to decouple iterators in the library from Try details #77877

Merged
merged 2 commits into from
Oct 19, 2020

Conversation

scottmcm
Copy link
Member

@scottmcm scottmcm commented Oct 12, 2020

I'd like to experiment with changing the ?/try desugaring and correspondingly the Try trait (see #42327 for discussions about the suboptimalities of the current one) and this change would keep from needing any cfg(bootstrap) in iterator things.

This will be lowered to the same thing, so shouldn't cause any perf issues:

/// Desugar `try { <stmts>; <expr> }` into `{ <stmts>; ::std::ops::Try::from_ok(<expr>) }`,
/// `try { <stmts>; }` into `{ <stmts>; ::std::ops::Try::from_ok(()) }`

But I'll trigger I've triggered a perf run just in case.

EDIT: changed to a draft because of the rustfmt-only syntax error. zulip thread about it: https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/New.20bootstrap.20rustfmt.20doesn't.20support.20syntax.20from.20sept.3F/near/213098097

EDIT: This now includes a rustfmt version bump to get through tidy.

@rust-highfive
Copy link
Collaborator

r? @shepmaster

(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 Oct 12, 2020
@scottmcm scottmcm marked this pull request as draft October 13, 2020 00:18
@jyn514 jyn514 added T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. A-iterators Area: Iterators labels Oct 13, 2020
scottmcm added a commit to scottmcm/rustfmt that referenced this pull request Oct 13, 2020
They failed to parse in rustfmt on me in rust-lang/rust#77877, which looks like it's since been fixed, but I figured I'd send in some tests anyway.
To pick up rust-lang/rustfmt#4461
So that rustfmt has the parsing fix from rust-lang#76274

...and do a reformat that it wants.
@scottmcm scottmcm marked this pull request as ready for review October 13, 2020 15:58
@scottmcm
Copy link
Member Author

@bors try
@rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion

@bors
Copy link
Contributor

bors commented Oct 13, 2020

⌛ Trying commit 8374c17 with merge 2c067c5235e779cd75e9f0cdfe572c64f1a12b9b...

@bors
Copy link
Contributor

bors commented Oct 13, 2020

☀️ Try build successful - checks-actions, checks-azure
Build commit: 2c067c5235e779cd75e9f0cdfe572c64f1a12b9b (2c067c5235e779cd75e9f0cdfe572c64f1a12b9b)

@rust-timer
Copy link
Collaborator

Queued 2c067c5235e779cd75e9f0cdfe572c64f1a12b9b with parent d65c08e, future comparison URL.

calebcartwright pushed a commit to rust-lang/rustfmt that referenced this pull request Oct 14, 2020
They failed to parse in rustfmt on me in rust-lang/rust#77877, which looks like it's since been fixed, but I figured I'd send in some tests anyway.
@rust-timer
Copy link
Collaborator

Finished benchmarking try commit (2c067c5235e779cd75e9f0cdfe572c64f1a12b9b): comparison url.

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying rollup- to bors.

Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up.

@bors rollup=never

@scottmcm
Copy link
Member Author

Perf results look essentially unchanged to me, as expected.

@shepmaster
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Oct 19, 2020

📌 Commit 8374c17 has been approved by shepmaster

@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 Oct 19, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 19, 2020
…laumeGomez

Rollup of 4 pull requests

Successful merges:

 - rust-lang#77877 (Use `try{}` in `try_fold` to decouple iterators in the library from `Try` details)
 - rust-lang#78089 (Fix issue with specifying generic arguments for primitive types)
 - rust-lang#78099 (Add missing punctuation)
 - rust-lang#78103 (Add link to rustdoc book in rustdoc help popup)

Failed merges:

r? `@ghost`
@bors bors merged commit a6919ef into rust-lang:master Oct 19, 2020
@rustbot rustbot added this to the 1.49.0 milestone Oct 19, 2020
@scottmcm scottmcm deleted the fewer-try-trait-method-references branch October 19, 2020 22:03
calebcartwright pushed a commit to calebcartwright/rustfmt that referenced this pull request Oct 30, 2020
They failed to parse in rustfmt on me in rust-lang/rust#77877, which looks like it's since been fixed, but I figured I'd send in some tests anyway.
calebcartwright pushed a commit to rust-lang/rustfmt that referenced this pull request Nov 3, 2020
They failed to parse in rustfmt on me in rust-lang/rust#77877, which looks like it's since been fixed, but I figured I'd send in some tests anyway.
BoredApe8461 added a commit to BoredApe8461/rustfmt that referenced this pull request Aug 12, 2024
They failed to parse in rustfmt on me in rust-lang/rust#77877, which looks like it's since been fixed, but I figured I'd send in some tests anyway.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-iterators Area: Iterators S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants