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

Handle more cases in cfg_accessible #97391

Merged
merged 5 commits into from
Jun 5, 2022
Merged

Conversation

Urgau
Copy link
Member

@Urgau Urgau commented May 25, 2022

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

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

This comment has been minimized.

@Urgau Urgau force-pushed the cfg_accessible branch from bc049c1 to b040a20 Compare May 25, 2022 11:50
@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 May 25, 2022
@Urgau Urgau force-pushed the cfg_accessible branch from b040a20 to e704700 Compare May 25, 2022 14:27
@Urgau
Copy link
Member Author

Urgau commented May 25, 2022

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

@rustbot ready

@rustbot rustbot 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
@Urgau Urgau force-pushed the cfg_accessible branch from e704700 to 8610703 Compare May 25, 2022 14:39
@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 May 25, 2022
@Urgau Urgau force-pushed the cfg_accessible branch 2 times, most recently from fc9dc1a to a6156ca Compare May 25, 2022 18:09
@Urgau
Copy link
Member Author

Urgau commented May 25, 2022

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

@rustbot ready

@rustbot rustbot 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.

@Urgau Urgau force-pushed the cfg_accessible branch from a6156ca to f63c2b7 Compare May 25, 2022 18:24
@petrochenkov petrochenkov removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 25, 2022
@petrochenkov petrochenkov 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 Urgau force-pushed the cfg_accessible branch from f63c2b7 to 63705cb Compare May 30, 2022 15:08
@Urgau
Copy link
Member Author

Urgau commented May 30, 2022

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

@rustbot rustbot 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
compiler/rustc_resolve/src/ident.rs Outdated Show resolved Hide resolved
trait TraitAlias = std::fmt::Debug + Send;

// FIXME: Currently shows "cannot determine" but should be `false`
#[cfg_accessible(unresolved)] //~ ERROR cannot determine
Copy link
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
Member Author

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.

@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 Jun 2, 2022
@Urgau Urgau force-pushed the cfg_accessible branch from 57f03cc to b76d112 Compare June 3, 2022 09:43
@Urgau
Copy link
Member Author

Urgau commented Jun 3, 2022

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

@rustbot rustbot 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
Contributor

Thanks!
@bors r+

@bors
Copy link
Contributor

bors commented Jun 4, 2022

📌 Commit b76d112 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 Jun 4, 2022
@bors
Copy link
Contributor

bors commented Jun 5, 2022

⌛ Testing commit b76d112 with merge 656eec8...

@bors
Copy link
Contributor

bors commented Jun 5, 2022

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jun 5, 2022
@bors bors merged commit 656eec8 into rust-lang:master Jun 5, 2022
@rustbot rustbot added this to the 1.63.0 milestone Jun 5, 2022
@rust-timer
Copy link
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
mean1 max count2
Regressions 😿
(primary)
N/A N/A 0
Regressions 😿
(secondary)
3.3% 3.3% 1
Improvements 🎉
(primary)
N/A N/A 0
Improvements 🎉
(secondary)
-3.8% -4.4% 2
All 😿🎉 (primary) N/A N/A 0

Cycles

Results
  • Primary benchmarks: 😿 relevant regressions found
  • Secondary benchmarks: no relevant changes found
mean1 max count2
Regressions 😿
(primary)
3.6% 3.8% 2
Regressions 😿
(secondary)
N/A N/A 0
Improvements 🎉
(primary)
N/A N/A 0
Improvements 🎉
(secondary)
N/A N/A 0
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 change 2

  2. number of relevant changes 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant 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