-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
convert 99.9% of try!
s to ?
s
#32390
convert 99.9% of try!
s to ?
s
#32390
Conversation
r? @pnkfelix (rust_highfive has picked a reviewer for you, use r? to override) |
This is, approximately, all the
The tool can't/won't convert |
base, | ||
&file_path, | ||
&relative_file_path, | ||
tests)); | ||
tests)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The automatic conversion breaks alignment in multi-line statements such as this. Should this be addressed in other PRs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should be in this one directly. Otherwise we'll certainly have multiple PRs to fix local broken alignments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, can untry
be extended to warn about cases like this, to ease the process of detecting them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, can untry be extended to warn about cases like this, to ease the process of detecting them?
Yeah, it shouldn't be that hard. (famous last words)
The automatic conversion breaks alignment in multi-line statements such as this. Should this be addressed in other PRs?
Once we get a good way to detect all these cases (with the warn feature @pnkfelix mentioned above) it should easy to fix all these in a single PR; it doesn't have to be done in this one though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Abandoning the style, which causes such problems is not an option?
rubber stamping... (leaving the fixes to indentation to later PR's) |
@bors r+ |
📌 Commit 1316ad4 has been approved by |
☔ The latest upstream changes (presumably #32156) made this pull request unmergeable. Please resolve the merge conflicts. |
|
@bors: r=pnkfelix |
📌 Commit 10ed4f6 has been approved by |
☔ The latest upstream changes (presumably #32204) made this pull request unmergeable. Please resolve the merge conflicts. |
Automated conversion using the untry tool [1] and the following command: ``` $ find -name '*.rs' -type f | xargs untry ``` at the root of the Rust repo. [1]: https://github.com/japaric/untry
@japaric, FYI:
Or with
|
Rebased and pushed a commit that enables the question_mark feature gate in the recently added rustc_borrowck crate. @bors: r=pnkfelix |
📌 Commit c548eda has been approved by |
⌛ Testing commit c548eda with merge e2e5795... |
💔 Test failed - auto-linux-64-x-android-t |
I deleted an @bors: r=pnkfelix |
📌 Commit c063c51 has been approved by |
convert 99.9% of `try!`s to `?`s The first commit is an automated conversion using the [untry] tool and the following command: ``` $ find -name '*.rs' -type f | xargs untry ``` at the root of the Rust repo. [untry]: https://github.com/japaric/untry cc @rust-lang/lang @alexcrichton @brson
si.hStdInput = stdin.raw(); | ||
si.hStdOutput = stdout.raw(); | ||
si.hStdError = stderr.raw(); | ||
|
||
try!(unsafe { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now I'm not sure if ?
was actually an improvement in cases like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
should probably just go inside the unsafe block.
The first commit is an automated conversion using the untry tool and the following command:
at the root of the Rust repo.
cc @rust-lang/lang @alexcrichton @brson