Skip to content

save_analysis: better handle paths and functions signature #73155

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 4 commits into from
Jun 11, 2020

Conversation

marmeladema
Copy link
Contributor

This should improve slightly some possible regressions due to hir rework.

r? @Xanewok

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 8, 2020
unsafety: hir::Unsafety::Unsafe,
// functions in extern block cannot be const
constness: hir::Constness::NotConst,
abi: self.tcx.hir().get_foreign_abi(item.hir_id),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I managed to get the real abi of the extern block using get_foreign_abi. I don't think we should change the hir to store a FnHeader in ForeignItem::Fn. I tried it locally, it works, but its really invasive and somehow orthogonal to this change.

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 you're right, let's stick with what we have. Thanks!

@marmeladema marmeladema force-pushed the save-analysis-various-fixes branch from 664db1b to 5bfa7f0 Compare June 9, 2020 22:09
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.

Thanks!

unsafety: hir::Unsafety::Unsafe,
// functions in extern block cannot be const
constness: hir::Constness::NotConst,
abi: self.tcx.hir().get_foreign_abi(item.hir_id),
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 you're right, let's stick with what we have. Thanks!

@Xanewok
Copy link
Member

Xanewok commented Jun 9, 2020

@bors r+

@bors
Copy link
Collaborator

bors commented Jun 9, 2020

📌 Commit 5bfa7f0 has been approved by Xanewok

@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 Jun 9, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 11, 2020
Rollup of 11 pull requests

Successful merges:

 - rust-lang#72380 (Fix `is_const_context`, update `check_for_cast`)
 - rust-lang#72941 (Ensure stack when building MIR for matches)
 - rust-lang#72976 (Clean up E0642 explanation)
 - rust-lang#73080 (doc/rustdoc: Fix incorrect external_doc feature flag)
 - rust-lang#73155 (save_analysis: better handle paths and functions signature)
 - rust-lang#73164 (Add new E0762 error code)
 - rust-lang#73172 (Fix more clippy warnings)
 - rust-lang#73181 (Automatically prioritize unsoundness issues)
 - rust-lang#73183 (Support proc macros in intra doc link resolution)
 - rust-lang#73208 (Fix doctest template)
 - rust-lang#73219 (x.py: with --json-output, forward cargo's JSON)

Failed merges:

r? @ghost
@bors bors merged commit b4af874 into rust-lang:master Jun 11, 2020
@marmeladema marmeladema deleted the save-analysis-various-fixes branch June 11, 2020 16:03
@est31
Copy link
Member

est31 commented Jun 11, 2020

Thanks @marmeladema for fixing the bug! I've thought that with rls around the corner it would never be fixed.

@marmeladema
Copy link
Contributor Author

I am actually using save-analysis issues as a way to learn more about the compiler 👍
save-analysis / rls might not stay around for long because rust-analyzer is kind of its successor i believe but in the mean time, if solving old issues can help some people then its not totally a lost cause i guess

# for free to join this conversation on GitHub. Already have an account? # 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.

6 participants