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(toml): Report _ fied variants (e.g. dev_dependencies) as deprecated #13783

Merged
merged 10 commits into from
Apr 22, 2024

Conversation

epage
Copy link
Contributor

@epage epage commented Apr 19, 2024

What does this PR try to resolve?

This is prep for removing them in the 2024 Edition and is part of rust-lang/rust#123754 and #13629

This doesn't include 2024 Edition work because there is a risk of conflict with other work going on these areas.

This changes us from

  • When using - and _ variants: deprecated, will error some time
  • Otherwise, nothing

To

  • When using - and _ variants: unused field warning
  • When using only _: deprecation, will be removed in 2024

I decided to model this as an unused field warning because that is what this is and that is how any other use of _ works. We might hard error during a transition period but I'd eventually want these to just make the code act like anything else in the end.

How should we test and review this PR?

Additional information

@rustbot
Copy link
Collaborator

rustbot commented Apr 19, 2024

r? @ehuss

rustbot has assigned @ehuss.
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 A-manifest Area: Cargo.toml issues S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 19, 2024
@epage epage force-pushed the underscore branch 2 times, most recently from 938cec9 to d1f0247 Compare April 22, 2024 15:18
@ehuss
Copy link
Contributor

ehuss commented Apr 22, 2024

Thanks!
The cargo team discussed this in the 2024-04-16 meeting as a part of the 2024 deprecation sweep.
@bors r+

@bors
Copy link
Contributor

bors commented Apr 22, 2024

📌 Commit d1f0247 has been approved by ehuss

It is now in the queue for this repository.

@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 Apr 22, 2024
@bors
Copy link
Contributor

bors commented Apr 22, 2024

⌛ Testing commit d1f0247 with merge d29ad67...

@bors
Copy link
Contributor

bors commented Apr 22, 2024

☀️ Test successful - checks-actions
Approved by: ehuss
Pushing d29ad67 to master...

1 similar comment
@bors
Copy link
Contributor

bors commented Apr 22, 2024

☀️ Test successful - checks-actions
Approved by: ehuss
Pushing d29ad67 to master...

@bors bors merged commit d29ad67 into rust-lang:master Apr 22, 2024
19 checks passed
@bors
Copy link
Contributor

bors commented Apr 22, 2024

👀 Test was successful, but fast-forwarding failed: 422 Changes must be made through a pull request.

@epage epage deleted the underscore branch April 22, 2024 17:03
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 24, 2024
Update cargo

7 commits in 80d5b607dde6ef97dfff4e23923822c01d2bb036..c9392675917adc2edab269eea27c222b5359c637
2024-04-19 18:39:22 +0000 to 2024-04-23 19:35:19 +0000
- fix(install): Don't respect MSRV for non-local installs (rust-lang/cargo#13790)
- gate some libc usages under cfg(unix), drop os_info features (rust-lang/cargo#13782)
- feat(resolver): Add default Edition2024 to resolver v3 (rust-lang/cargo#13785)
- Fix 2 tests for offline execution (rust-lang/cargo#13789)
- fix(toml): Report `_` fied variants (e.g. `dev_dependencies`) as deprecated (rust-lang/cargo#13783)
- feat(resolver): Add v3 resolver for MSRV-aware resolving (rust-lang/cargo#13776)
- Unused dependencies cleanup (rust-lang/cargo#13778)

r? ghost
@rustbot rustbot added this to the 1.79.0 milestone Apr 24, 2024
epage added a commit to epage/cargo that referenced this pull request Apr 24, 2024
During rust-lang#13783, I had considered making the 2024 edition behavior a
"unused key" warning.  However, I'm being too lazy in piping the data
through correctly (and a hard error might be better to help users
transition).
bors added a commit that referenced this pull request Apr 24, 2024
fix(toml): Be more forceful with underscore/dash redundancy

### What does this PR try to resolve?

This is prep for removing them in the 2024 Edition and is part of rust-lang/rust#123754 and #13629

During #13783, I had considered making the 2024 edition behavior a "unused key" warning.  However, the work and code mess to pipe the data through correctly handle the two fields in all cases didn't seem worth it (and a hard error might be better to help users transition).

### How should we test and review this PR?

### Additional information
dburgener added a commit to dburgener/cascade that referenced this pull request May 2, 2024
The _ variants of several Cargo fields will be deprecated in the 2024
edition.  Switch to the recommended - variants.

rust-lang/cargo#13783
dburgener added a commit to dburgener/lalrpop that referenced this pull request May 2, 2024
The _ variants of several Cargo fields will be deprecated in the 2024 edition.  Switch to the recommended - variants.

rust-lang/cargo#13783
dburgener added a commit to dburgener/cascade that referenced this pull request May 2, 2024
The _ variants of several Cargo fields will be deprecated in the 2024
edition.  Switch to the recommended - variants.

rust-lang/cargo#13783
github-merge-queue bot pushed a commit to lalrpop/lalrpop that referenced this pull request May 3, 2024
The _ variants of several Cargo fields will be deprecated in the 2024 edition.  Switch to the recommended - variants.

rust-lang/cargo#13783
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-manifest Area: Cargo.toml issues 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.

4 participants