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

Soft-destabilize RustcEncodable & RustcDecodable, remove from prelude in next edition #116016

Merged
merged 2 commits into from
Mar 27, 2024

Conversation

jhpratt
Copy link
Member

@jhpratt jhpratt commented Sep 21, 2023

cc rust-lang/libs-team#272

Any use of RustcEncodable and RustcDecodable now triggers a deny-by-default lint. The derives have been removed from the 2024 prelude. I specifically chose not to document this in the module-level documentation, as the presence in existing preludes is not documented (which I presume is intentional).

This does not implement the proposed change for rustfix, which I will be looking into shortly.

With regard to the items in the preludes being stable, this should not be an issue because #15702 has been resolved.

r? libs-api

@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. T-libs Relevant to the library team, which will review and decide on the PR/issue. A-edition-2024 Area: The 2024 edition T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. and removed T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Sep 21, 2023
@rust-cloud-vms rust-cloud-vms bot force-pushed the kill-rustc-serialize branch 2 times, most recently from 796201f to 7e07fa8 Compare September 21, 2023 05:45
@rust-log-analyzer

This comment has been minimized.

@rust-cloud-vms rust-cloud-vms bot force-pushed the kill-rustc-serialize branch 2 times, most recently from f105bad to 1a752d3 Compare September 21, 2023 07:12
@rust-log-analyzer

This comment has been minimized.

| ^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #64266 <https://github.com/rust-lang/rust/issues/64266>
Copy link
Member

Choose a reason for hiding this comment

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

Would it be worth making this warning show up in cargo's future-compat reports? Not all future-compat warnings show up there, unfortunately. It needs to have reason: FutureIncompatibilityReason::FutureReleaseErrorReportNow. Maybe soft_unstable should get that flag?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think that would be worthwhile, but in a separate PR as it's only tangentially related to this.

@ehuss
Copy link
Contributor

ehuss commented Feb 10, 2024

@Amanieu Do you know what the status of this PR is? Has the libs team discussed this change?

We would like to conclude the set of edition changes, and we'd like to know if this will be included.

@dtolnay
Copy link
Member

dtolnay commented Feb 10, 2024

@rust-lang/libs-api:
@rfcbot fcp merge

In 2015–2021 edition code, derive(RustcEncodable) and derive(RustcDecodable) will fail with a deny-by-default lint which can be suppressed with #![allow(soft_unstable)]. The deny-by-default does not break dependencies pulled from crates.io and built by Cargo, because Cargo uses --cap-lints=allow for those. A future incompat warning would be shown in that case instead, with cargo report future-incompatibilities to examine the situation.

In 2024 edition code, derive(RustcEncodable) and derive(RustcDecodable) fail as these derive macros are no longer in the 2024 edition prelude. You can import them e.g. with use core::prelude::rust_2021::RustcEncodable; to get the soft unstable lint behavior.

@rfcbot
Copy link

rfcbot commented Feb 10, 2024

Team member @dtolnay has proposed to merge this. The next step is review by the rest of the tagged team members:

No concerns currently listed.

Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

See this document for info about what commands tagged team members can give me.

@rfcbot rfcbot added proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. labels Feb 10, 2024
@jhpratt
Copy link
Member Author

jhpratt commented Feb 10, 2024

^^ migration code will be done separately if approved.

@bors
Copy link
Contributor

bors commented Feb 19, 2024

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

@rfcbot rfcbot added the final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. label Feb 28, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Mar 23, 2024
…olnay

Soft-destabilize `RustcEncodable` & `RustcDecodable`, remove from prelude in next edition

cc rust-lang/libs-team#272

Any use of `RustcEncodable` and `RustcDecodable` now triggers a deny-by-default lint. The derives have been removed from the 2024 prelude. I specifically chose **not** to document this in the module-level documentation, as the presence in existing preludes is not documented (which I presume is intentional).

This does not implement the proposed change for `rustfix`, which I will be looking into shortly.

With regard to the items in the preludes being stable, this should not be an issue because rust-lang#15702 has been resolved.

r? libs-api
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 23, 2024
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#116016 (Soft-destabilize `RustcEncodable` & `RustcDecodable`, remove from prelude in next edition)
 - rust-lang#121281 (regression test for rust-lang#103626)
 - rust-lang#122168 (Fix validation on substituted callee bodies in MIR inliner)
 - rust-lang#122217 (Handle str literals written with `'` lexed as lifetime)
 - rust-lang#122379 (transmute: caution against int2ptr transmutation)
 - rust-lang#122907 (Uniquify `ReError` on input mode in canonicalizer)
 - rust-lang#122942 (Add test in higher ranked subtype)
 - rust-lang#122943 (add a couple more ice tests)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 23, 2024
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#116016 (Soft-destabilize `RustcEncodable` & `RustcDecodable`, remove from prelude in next edition)
 - rust-lang#121281 (regression test for rust-lang#103626)
 - rust-lang#122168 (Fix validation on substituted callee bodies in MIR inliner)
 - rust-lang#122217 (Handle str literals written with `'` lexed as lifetime)
 - rust-lang#122379 (transmute: caution against int2ptr transmutation)
 - rust-lang#122907 (Uniquify `ReError` on input mode in canonicalizer)
 - rust-lang#122942 (Add test in higher ranked subtype)
 - rust-lang#122943 (add a couple more ice tests)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 24, 2024
@jhpratt
Copy link
Member Author

jhpratt commented Mar 24, 2024

Should I allow both the soft_unstable and deprecated lints? The error isn't particularly surprising, as this is the exact situation the soft destabilization is intended to exclude.

@dtolnay
Copy link
Member

dtolnay commented Mar 24, 2024

The failure is in https://github.com/rust-lang/cargo/blob/77506e57392d94450bb3ed52cf75e3263bbb2792/tests/testsuite/check.rs#L222-L285 which is a 7 year old test for rust-lang/cargo#3419, which is from 2 days after the initial implementation of cargo check landed in nightly Cargo in rust-lang/cargo#3296.

I would recommend just deleting the test from Cargo. The implementation of cargo check has matured enough since then and I don't see anything useful in that test.

bors added a commit to rust-lang/cargo that referenced this pull request Mar 25, 2024
Remove unnecessary test

This removes a test that is blocking rust-lang/rust#116016 from landing. `@dtolnay` suggested removing the test rather than allowing the relevant lints ([comment](rust-lang/rust#116016 (comment))).

> The failure is in https://github.com/rust-lang/cargo/blob/77506e57392d94450bb3ed52cf75e3263bbb2792/tests/testsuite/check.rs#L222-L285 which is a 7 year old test for [#3419](#3419), which is from 2 days after the initial implementation of `cargo check` landed in nightly Cargo in [#3296](#3296).
>
> I would recommend just deleting the test from Cargo. The implementation of `cargo check` has matured enough since then and I don't see anything useful in that test.
@jhpratt
Copy link
Member Author

jhpratt commented Mar 25, 2024

The test in question has been removed. After the next sync with the rust-lang/cargo repo, this PR should be good to go.

@ehuss
Copy link
Contributor

ehuss commented Mar 26, 2024

Cargo should be updated via #123040.

@bors r+

@bors
Copy link
Contributor

bors commented Mar 26, 2024

📌 Commit fbf21c5 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 26, 2024
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Mar 26, 2024
Soft-destabilize `RustcEncodable` & `RustcDecodable`, remove from prelude in next edition

cc rust-lang/libs-team#272

Any use of `RustcEncodable` and `RustcDecodable` now triggers a deny-by-default lint. The derives have been removed from the 2024 prelude. I specifically chose **not** to document this in the module-level documentation, as the presence in existing preludes is not documented (which I presume is intentional).

This does not implement the proposed change for `rustfix`, which I will be looking into shortly.

With regard to the items in the preludes being stable, this should not be an issue because rust-lang#15702 has been resolved.

r? libs-api
@bors
Copy link
Contributor

bors commented Mar 27, 2024

⌛ Testing commit fbf21c5 with merge 0dcc130...

@bors
Copy link
Contributor

bors commented Mar 27, 2024

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Mar 27, 2024
@bors bors merged commit 0dcc130 into rust-lang:master Mar 27, 2024
12 checks passed
@rustbot rustbot added this to the 1.79.0 milestone Mar 27, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (0dcc130): comparison URL.

Overall result: ❌ regressions - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.3% [0.3%, 0.3%] 1
Regressions ❌
(secondary)
0.1% [0.1%, 0.1%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.3% [0.3%, 0.3%] 1

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.7% [-3.9%, -0.6%] 12
Improvements ✅
(secondary)
-3.1% [-4.4%, -2.1%] 32
All ❌✅ (primary) -1.7% [-3.9%, -0.6%] 12

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
2.6% [2.6%, 2.6%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.6% [2.6%, 2.6%] 1

Binary size

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

Bootstrap: 669.488s -> 669.238s (-0.04%)
Artifact size: 315.76 MiB -> 315.79 MiB (0.01%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-edition-2024 Area: The 2024 edition disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. finished-final-comment-period The final comment period is finished for this PR / Issue. 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-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet