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

Replace error callback with Result #63286

Merged
merged 2 commits into from
Aug 6, 2019

Conversation

Mark-Simulacrum
Copy link
Member

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 5, 2019
} else {
Ok((path, res))
match self.resolve_ast_path_inner(&path, is_value) {
Ok(res) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Ok(res) => {
Ok(res) if res != Res::Err => {

Although, I'd rather remove this condition (and then use ?).
If the function returns Res, then rustdoc should be ready to deal with Res::Err as well.

@petrochenkov petrochenkov 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-review Status: Awaiting review from the assignee but also interested parties. labels Aug 5, 2019
@Mark-Simulacrum
Copy link
Member Author

Removed the condition, mostly by uplifting it into rustdoc. I'm not sure if those changes are a correct handling of this -- the code looks a bit questionable to me -- but I don't think this is quite the place to refactor rustdoc's resolution too much :) Happy to do so if you disagree, though!

@Mark-Simulacrum Mark-Simulacrum added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 5, 2019
@petrochenkov
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Aug 6, 2019

📌 Commit 3cd7f08 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 Aug 6, 2019
Centril added a commit to Centril/rust that referenced this pull request Aug 6, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
…trochenkov

Replace error callback with Result

r? @petrochenkov
Centril added a commit to Centril/rust that referenced this pull request Aug 6, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
…trochenkov

Replace error callback with Result

r? @petrochenkov
bors added a commit that referenced this pull request Aug 6, 2019
Rollup of 6 pull requests

Successful merges:

 - #62459 (Use internal iteration in the Sum and Product impls of Result and Option)
 - #62821 (Not listed methods)
 - #62837 (Fix theme picker blur handler: always hide instead of switching)
 - #63286 (Replace error callback with Result)
 - #63296 (Deduplicate rustc_demangle in librustc_codegen_llvm)
 - #63298 (assume_init: warn about valid != safe)

Failed merges:

r? @ghost
@bors bors merged commit 3cd7f08 into rust-lang:master Aug 6, 2019
}

/// Like `resolve_ast_path`, but takes a callback in case there was an error.
// FIXME(eddyb) use `Result` or something instead of callbacks.
fn resolve_ast_path_cb<F>(
fn resolve_ast_path_inner(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment wasn't updated. But other than that I'm really happy the callback is gone!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it was lost in a rebase. I've added to my todo list to check if it's been removed after some of the resolver refactorings land so I don't cause merge conflicts and such.

@Mark-Simulacrum Mark-Simulacrum deleted the resolve-no-cb branch August 10, 2019 12:02
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

5 participants