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

Remove use of unwrap() from save-analysis #69422

Merged
merged 3 commits into from
Mar 8, 2020

Conversation

JohnTitor
Copy link
Member

Fix #69409, fix #69416

@rust-highfive
Copy link
Collaborator

r? @davidtwco

(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 Feb 24, 2020
@Xanewok
Copy link
Member

Xanewok commented Feb 24, 2020

r? @Xanewok

@rust-highfive rust-highfive assigned Xanewok and unassigned davidtwco Feb 24, 2020
Copy link
Member

@Xanewok Xanewok left a comment

Choose a reason for hiding this comment

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

This brings it in line with other usages and is safe to do, left some further comments

span,
ref_id: id_from_def_id(variant.fields[index].did),
}));
if let Some(index) = self.tcx.find_field_index(ident, variant) {
Copy link
Member

Choose a reason for hiding this comment

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

Could we use map here? Since we indent by a level anyway and to avoid trailing None

Copy link
Member Author

Choose a reason for hiding this comment

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

Addressed via a211a82.

@@ -1,3 +1,5 @@
// compile-flags: -Zsave-analysis
Copy link
Member

Choose a reason for hiding this comment

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

I think we should have a dedicated regression test in src/test/ui/save-analysis and not rely on this flag in general src/test/ui directory

cc @Centril on test layout

Copy link
Contributor

Choose a reason for hiding this comment

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

My general sentiment is that we should not have files at all in src/test/ui, only directories. I have a question though... is the purpose of this test just for save-analysis? If not, then it doesn't seem fit for a save-analysis/ folder, which I would expect to be targeted specifically at testing save-analysis as opposed to some other aspect (and save analysis being incidentally also tested).

Copy link
Member Author

Choose a reason for hiding this comment

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

Left comments to clarify and moved assign-to-method.rs to ui/methods.

@@ -1,3 +1,5 @@
// compile-flags: -Zsave-analysis
Copy link
Member

Choose a reason for hiding this comment

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

Ditto

@JohnTitor
Copy link
Member Author

Friendly ping @Xanewok, addressed your reviews, how about?

@Xanewok
Copy link
Member

Xanewok commented Mar 7, 2020

Sorry, forgot about this! Thanks =)

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Mar 7, 2020

📌 Commit 5307edc has been approved by Xanewok

@bors
Copy link
Contributor

bors commented Mar 7, 2020

🌲 The tree is currently closed for pull requests below priority 1000, this pull request will be tested once the tree is reopened

@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 Mar 7, 2020
Centril added a commit to Centril/rust that referenced this pull request Mar 8, 2020
bors added a commit that referenced this pull request Mar 8, 2020
Rollup of 8 pull requests

Successful merges:

 - #69422 (Remove use of `unwrap()` from save-analysis)
 - #69548 (Turn trailing tokens in `assert!()` into hard errors)
 - #69561 (Clean up unstable book)
 - #69599 (check_binding_alt_eq_ty: improve precision wrt. `if let`)
 - #69641 (Update books)
 - #69776 (Fix & test leak of some BTreeMap nodes on panic during `into_iter`)
 - #69805 (resolve: Modernize some naming)
 - #69810 (test(bindings_after_at): add dynamic drop tests for bindings_after_at)

Failed merges:

r? @ghost
@bors bors merged commit f459d2e into rust-lang:master Mar 8, 2020
@JohnTitor JohnTitor deleted the remove-unwrap branch March 8, 2020 14:53
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.

ICE -Zsave-analysis issue-3763.rs ICE -Zsave-analysis: ./ui/assign-to-method.rs
6 participants