Skip to content

Handle more cases in cfg_accessible - #97391

Merged
bors merged 5 commits into
rust-lang:masterfrom
Urgau:cfg_accessible
Jun 5, 2022
Merged

Handle more cases in cfg_accessible#97391
bors merged 5 commits into
rust-lang:masterfrom
Urgau:cfg_accessible

Conversation

@Urgau

Copy link
Copy Markdown
Member

This PR tries to handle more cases in the cfg_accessible implementation by only emitting a "not sure" error only if we have partially resolved a path.

This PR also adds many tests for the "not sure" cases and for private items.

r? @petrochenkov

@rustbotrustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label May 25, 2022
@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 25, 2022
@Urgau
Urgauforce-pushed the cfg_accessible branch 2 times, most recently from 806b00c to bc049c1CompareMay 25, 2022 11:29
@rust-log-analyzer

This comment has been minimized.

Comment threadsrc/test/ui/conditional-compilation/cfg_accessible.rs Outdated
Comment threadsrc/test/ui/conditional-compilation/cfg_accessible-not_sure.rs Outdated
Comment threadsrc/test/ui/conditional-compilation/cfg_accessible-not_sure.rs Outdated
Comment threadsrc/test/ui/conditional-compilation/cfg_accessible-not_sure.rs Outdated
Comment threadsrc/test/ui/conditional-compilation/cfg_accessible.rs Outdated
Comment threadcompiler/rustc_resolve/src/macros.rs Outdated
@petrochenkovpetrochenkov 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 May 25, 2022
@Urgau

Copy link
Copy Markdown
MemberAuthor

I've address the review comments. This is ready for another review.

@rustbot ready

@rustbotrustbot 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 May 25, 2022
Comment threadcompiler/rustc_resolve/src/macros.rs Outdated
Comment threadsrc/test/ui/conditional-compilation/cfg_accessible-bugs.rs Outdated
Comment threadsrc/test/ui/conditional-compilation/cfg_accessible.rs Outdated
Comment threadsrc/test/ui/conditional-compilation/cfg_accessible-not_sure.rs Outdated
@petrochenkovpetrochenkov 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 May 25, 2022
@Urgau
Urgauforce-pushed the cfg_accessible branch 2 times, most recently from fc9dc1a to a6156caCompareMay 25, 2022 18:09
@Urgau

Copy link
Copy Markdown
MemberAuthor

I've addressed all review comments expect #97391 (comment) for which I put a message describing the situation.

@rustbot ready

@rustbotrustbot 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 May 25, 2022
@rust-log-analyzer

This comment has been minimized.

Comment threadsrc/test/ui/conditional-compilation/cfg_accessible-bugs.rs Outdated
Comment threadcompiler/rustc_resolve/src/macros.rs Outdated
@petrochenkovpetrochenkov removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 25, 2022
@petrochenkovpetrochenkov added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label May 25, 2022
@Urgau

Copy link
Copy Markdown
MemberAuthor

I've addressed the review comments: removed known-bug and added the requested modification in rustc_resolve. I'm not fully sure about the last one and there are some diagnostics regression. But I want your opinion on it and it's ready for another review.

@rustbot ready

@rustbotrustbot 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 May 30, 2022
Comment threadcompiler/rustc_resolve/src/ident.rs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is not a bug, if the compiler says "cannot determine" (rather than "not sure") then it's legitimately stuck, and it's unlikely we can do anything here.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

The problem here is that we return an error instead of false (ie it is unresolvable).
The error message is irrelevant to the bug.

@petrochenkovpetrochenkov 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 Jun 2, 2022
@Urgau

Urgau commented Jun 3, 2022

Copy link
Copy Markdown
MemberAuthor

I've reverted the failed -> NonModule change as requested; I've posted the patch here https://gist.github.com/Urgau/7356282bc688ea3ab71b94412e86a2d1. I also responded to the last comment.

@rustbot ready

@rustbotrustbot 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 Jun 3, 2022
@petrochenkov

Copy link
Copy Markdown
Contributor

Thanks!
@bors r+

@bors

bors commented Jun 4, 2022

Copy link
Copy Markdown
Collaborator

📌 Commit b76d112 has been approved by petrochenkov

@borsbors 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 4, 2022
@bors

bors commented Jun 5, 2022

Copy link
Copy Markdown
Collaborator

⌛ Testing commit b76d112 with merge 656eec8...

@bors

bors commented Jun 5, 2022

Copy link
Copy Markdown
Collaborator

☀️ Test successful - checks-actions
Approved by: petrochenkov
Pushing 656eec8 to master...

@borsbors added the merged-by-bors This PR was explicitly merged by bors. label Jun 5, 2022
@bors
bors merged commit 656eec8 into rust-lang:masterJun 5, 2022
@rustbotrustbot added this to the 1.63.0 milestone Jun 5, 2022
@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (656eec8): comparison url.

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results
  • Primary benchmarks: no relevant changes found
  • Secondary benchmarks: mixed results
mean1maxcount2
Regressions 😿
(primary)
N/AN/A0
Regressions 😿
(secondary)
3.3%3.3%1
Improvements 🎉
(primary)
N/AN/A0
Improvements 🎉
(secondary)
-3.8%-4.4%2
All 😿🎉 (primary)N/AN/A0

Cycles

Results
  • Primary benchmarks: 😿 relevant regressions found
  • Secondary benchmarks: no relevant changes found
mean1maxcount2
Regressions 😿
(primary)
3.6%3.8%2
Regressions 😿
(secondary)
N/AN/A0
Improvements 🎉
(primary)
N/AN/A0
Improvements 🎉
(secondary)
N/AN/A0
All 😿🎉 (primary)3.6%3.8%2

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

@rustbot label: -perf-regression

Footnotes

  1. the arithmetic mean of the percent change2

  2. number of relevant changes2

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-borsThis PR was explicitly merged by bors.S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants

@Urgau@rust-log-analyzer@petrochenkov@bors@rust-timer@est31@jackh726@rust-highfive@rustbot