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

std::run: Use Result instead of condition #10654

Closed
wants to merge 1 commit into from
Closed

Conversation

klutzy
Copy link
Contributor

@klutzy klutzy commented Nov 25, 2013

Previously std::run::Process::new() raised a io_error condition then
tried to unwrap None, so it caused assertion failure.

This fixes the problem by returning Result instead of raising
condition.

This also fixes rustc ICE on nonexistent --linker.

Previously `std::run::Process::new()` raised a io_error condition then
tried to unwrap `None`, so it caused assertion failure.

This fixes the problem by returning Result instead of raising
condition.

This also fixes rustc ICE on nonexistent `--linker`.
@alexcrichton
Copy link
Member

I'm cancelling the build because I do not believe that this is the correct way to go about this today. We haven't yet removed conditions, and having one and only one I/O interface use Result isn't very symmetric with everything else.

I do believe that this fixes a bug in the meantime, but I don't think that using Result is a good solution to the problem. If there is an unwrap in some of the std::run code, then it should become unwrap_or_else in case the condition is handled.

@klutzy
Copy link
Contributor Author

klutzy commented Nov 26, 2013

@alexcrichton Will #10449 change all io_error to IoResult? Then I would close this and just file an issue, since it will fix (or at least provide a good way to fix) the issue correctly.

However I think the main issue can't be easily fixed with unwrap_or_else, because std::run::Process::new() currently must return something (Process or ProcessOutput) though process creation got failed.

@klutzy
Copy link
Contributor Author

klutzy commented Dec 1, 2013

Closing since it'll be good to fix after #10449 lands. Instead I've reported two issues I wanted to fix: #10754, #10755.

@klutzy klutzy closed this Dec 1, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request May 5, 2023
Add configuration for `semicolon_block` lints

Does exactly what it says on the tin, suggests moving a block's final semicolon inside if it's multiline and outside if it's singleline.

I don't really like how this is implemented so I'm not too sure if this is ready yet. Alas, it might be ok.

---

fixes rust-lang#10654

changelog: Enhancement: [`semicolon_inside_block`]: Added `semicolon-inside-block-ignore-singleline` as a new config value.
[rust-lang#10656](rust-lang/rust-clippy#10656)
changelog: Enhancement: [`semicolon_outside_block`]: Added `semicolon-outside-block-ignore-multiline` as a new config value.
[rust-lang#10656](rust-lang/rust-clippy#10656)
<!-- changelog_checked -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants