Skip to content

tests: add private RPITIT & exported_private_dependencies tests #144020

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mladedav
Copy link
Contributor

@mladedav mladedav commented Jul 16, 2025

Private RPITIT used to not be linted (#143531), but it became linted and in some cases a hard error in #143357.

This PR just adds tests so that this behavior does not go away though there is work to be done:

  • required methods lint only private_bounds, but provided methods also output E0446.
  • private dependency in public interface is linted twice for provided methods (and just once for required methods).
  • it points to {annon_assoc#0} instead of the method itself

@rustbot
Copy link
Collaborator

rustbot commented Jul 16, 2025

r? @fee1-dead

rustbot has assigned @fee1-dead.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 16, 2025
@mladedav mladedav marked this pull request as draft July 16, 2025 12:03
@rustbot rustbot 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 Jul 16, 2025
@mladedav
Copy link
Contributor Author

I converted this to a draft since I noticed that one of the errors is not a lint but a hard error, which I believe to be a mistake. So I think it would be better to figure that one out first and then pick this up again.

@rustbot label +S-waiting-on-author -S-waiting-on-review

@rust-log-analyzer

This comment has been minimized.

@mladedav mladedav changed the title tests: add private rpitit tests tests: add private RPITIT & exported_private_dependencies tests Jul 16, 2025
@cjgillot
Copy link
Contributor

@compiler-errors @petrochenkov the "bugfix" is accidental. As this causes a hard error, should we issue a warkaround to remove the error with a future-compat lint?

@compiler-errors
Copy link
Member

We could crater this to see the extent of the error, and T-lang nominate it with the suggestion that if the fallout is small or nonexistent then we could just make it a hard error directly?

@mladedav
Copy link
Contributor Author

mladedav commented Jul 17, 2025

I don't think this should produce a hard error. It doesn't error for RPIT outside traits, for required functions with RPITIT or provided functions with concrete private type.

It might not have been clear from the changes to the tests here, but the merged PR made some lints work regarding private types in interface (which is great), but I don't think the new hard error should apply here.

The error specifically talks only about associated types so it could be confusing to users as it seems to accidentally check the generated associated types which is just a compiler implementation detail and the message would probably be confusing to users. So if this is in fact desirable, it should probably have the message changed and it should be consistent with required functions in traits.

Playground

@mladedav mladedav force-pushed the dm/private-rpitit branch from 3936e12 to e78d086 Compare July 17, 2025 06:22
@bors
Copy link
Collaborator

bors commented Jul 17, 2025

☔ The latest upstream changes (presumably #144044) made this pull request unmergeable. Please resolve the merge conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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.

7 participants