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

fix: improve message for inactive weak optional feature with edition2024 #14019

Closed
wants to merge 2 commits into from

Conversation

linyihai
Copy link
Contributor

@linyihai linyihai commented Jun 6, 2024

What does this PR try to resolve?

This will improve the message for inactive weak optional feature with edition2024.

This doesn't distinguish whether the dependency had set, which needs to get the dependency from origin that will make more complex.

Fixes #14015

How should we test and review this PR?

one commit add the test, one commit fix and update the test

Additional information

@rustbot
Copy link
Collaborator

rustbot commented Jun 6, 2024

r? @weihanglo

rustbot has assigned @weihanglo.
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 the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 6, 2024
@@ -221,7 +221,7 @@ Caused by:
error: failed to parse manifest at `[ROOT]/foo/Cargo.toml`

Caused by:
feature `feat` includes `dep?/feat`, but `dep` is not a dependency
feature `feat` includes `dep?/feat`, activate it in a feature with `dep:dep` if `dep` is an enabled dependency
Copy link
Contributor

Choose a reason for hiding this comment

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

if dep is an enabled dependency

I feel the wording could be improved here. To help in coming up with ideas, could you expand on what you are trying to convey

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, the messge need to include the cases that dependency inactive and dependency missing, if dep is an enabled dependency means the former.

#14026 is another PR to distinguish these. And this PR may require more detailed wording to address both cases.

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 suggest keep this PR to polish the message unless #14026 is merged

Comment on lines 190 to 191
Caused by:
feature `feat` includes `dep?/feat`, but `dep` is not a dependency
feature `feat` includes `dep?/feat`, activate it in a feature with `dep:dep` if `dep` is an enabled dependency
Copy link
Contributor

Choose a reason for hiding this comment

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

This feels like a regression for us to be telling people to add dep:dep when they also need to add the dependency itself.

@bors
Copy link
Collaborator

bors commented Jun 7, 2024

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

@linyihai
Copy link
Contributor Author

Close this in favor of #14026

@linyihai linyihai closed this Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bad error message when a weak dep features's depedency is an unused optional dependency
5 participants