Skip to content

Add Forget trait feature gate - #165376

Open
jdonszelmann wants to merge 2 commits into
rust-lang:mainfrom
jdonszelmann:forget-trait-feature-gate
Open

jdonszelmann wants to merge 2 commits into
rust-lang:mainfrom
jdonszelmann:forget-trait-feature-gate

Conversation

@jdonszelmann

@jdonszelmann jdonszelmann commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

View all comments

r? jonathanbrouwer

Add an unstable feature gate for the Forget trait. Creating the feature gate allows experimentation with its implementation. Note that this does not commit to anything w.r.t. stabilization of the forget trait. A feature gate can be removed at any time.

Part of #165370

@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. labels Nov 2, 2026
@rust-log-analyzer

This comment has been minimized.

Comment thread library/core/src/marker.rs Resolved
@jdonszelmann
jdonszelmann force-pushed the forget-trait-feature-gate branch from 5f088b4 to eab4fb5 Compare November 2, 2026 23:37
@rust-log-analyzer

This comment has been minimized.

@jdonszelmann
jdonszelmann force-pushed the forget-trait-feature-gate branch from eab4fb5 to 44352d9 Compare November 2, 2026 23:57
@rust-log-analyzer

This comment has been minimized.

@jdonszelmann
jdonszelmann force-pushed the forget-trait-feature-gate branch from 44352d9 to b9bb2ee Compare November 3, 2026 00:39
@rust-log-analyzer

This comment has been minimized.

@jdonszelmann
jdonszelmann force-pushed the forget-trait-feature-gate branch from b9bb2ee to e6ae420 Compare November 3, 2026 08:39

@JonathanBrouwer JonathanBrouwer left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@rust-bors

rust-bors Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

📌 Commit e6ae420 has been tentatively approved by JonathanBrouwer

It will be put into the queue for this repository once PR CI succeeds.

@rust-bors rust-bors Bot 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 Nov 3, 2026
@rust-log-analyzer

This comment has been minimized.

@rust-bors rust-bors Bot 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 Nov 3, 2026
@rust-bors

rust-bors Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

❌ Commit e6ae420 has been unapproved due to PR CI failure. Reapprove it with @bors r+ force if you want to ignore the failure.

@jdonszelmann

Copy link
Copy Markdown
Contributor Author

sigh, that makes sense, should've checked that. I'll fix it in a bit

@JonathanBrouwer

Copy link
Copy Markdown
Member

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Nov 3, 2026
rust-bors Bot pushed a commit that referenced this pull request Nov 3, 2026
@rust-bors

This comment has been minimized.

@jdonszelmann
jdonszelmann force-pushed the forget-trait-feature-gate branch from e6ae420 to 124af59 Compare November 3, 2026 09:37
@rustbot rustbot added the T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. label Nov 3, 2026
@jdonszelmann

Copy link
Copy Markdown
Contributor Author

This should fix it for the time being. Enabling forget will cost the extra 10% though so it's not ideal when actually landing forget trait but at least without the feature enabled this handles it gracefully

@jdonszelmann

Copy link
Copy Markdown
Contributor Author

Local benchmarks show that this indeed solves the issue fyi

@fmease

fmease commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

The "auto trait finder" that uses the old solver sucks; under the next solver we use a much faster but more limited one. In the future, when everything is more settled, adding new auto traits should hopefully not regress doc build times as much (inevitably tho, it'll regress HTML artifact size)

@rust-log-analyzer

This comment has been minimized.

@jdonszelmann

Copy link
Copy Markdown
Contributor Author

@fmease yea I figured. However, this is fine as a temporary solution right?

@jdonszelmann
jdonszelmann force-pushed the forget-trait-feature-gate branch from 1dda39f to b70d2a2 Compare November 3, 2026 14:02
@fmease

fmease commented Nov 3, 2026

Copy link
Copy Markdown
Member

Yea, absolutely fine!

@rust-bors

rust-bors Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 1167d71 (1167d715d42f42542c2dc76efa80a34e061bba9d)
Base parent: 6a98084 (6a98084e4a21b04504c034dfc640e35e32ab9854)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (1167d71): comparison URL.

Overall result: ❌ regressions - please read:

Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf.

Next, please: If you can, justify the regressions found in this try perf run in writing along with @rustbot label: +perf-regression-triaged. If not, fix the regressions and do another perf run. Neutral or positive results will clear the label automatically.

@bors rollup=never rustc-perf
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.4% [0.2%, 0.7%] 10
Regressions ❌
(secondary)
0.5% [0.2%, 1.1%] 6
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.4% [0.2%, 0.7%] 10

Max RSS (memory usage)

Results (secondary -3.4%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.4% [-6.3%, -1.6%] 3
All ❌✅ (primary) - - 0

Cycles

Results (primary -2.8%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

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

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 482.475s -> 482.923s (0.09%)
Artifact size: 406.38 MiB -> 406.39 MiB (0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Nov 3, 2026
@jdonszelmann

Copy link
Copy Markdown
Contributor Author

ok, @fmease or @rust-lang/rustdoc do you agree that 1% regressions on rustdoc are acceptable for this kind of change? I've looked and it's all just in html emitting basically, which is to be expected. We're likely going to do another change like it soon with Move.

@GuillaumeGomez

Copy link
Copy Markdown
Member

Sounds acceptable. 👍

@jdonszelmann

Copy link
Copy Markdown
Contributor Author

@JonathanBrouwer

@JonathanBrouwer JonathanBrouwer left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@rust-bors

rust-bors Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

📌 Commit b70d2a2 has been approved by JonathanBrouwer

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 Nov 4, 2026
@JonathanBrouwer

JonathanBrouwer commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

@bors rollup=iffy
perf

JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Nov 4, 2026
…gate, r=JonathanBrouwer

Add `Forget` trait feature gate

r? jonathanbrouwer

Add an unstable feature gate for the `Forget` trait. Creating the feature gate allows experimentation with its implementation. Note that this does not commit to anything w.r.t. stabilization of the forget trait. A feature gate can be removed at any time.

Part of rust-lang#165370
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Nov 4, 2026
…gate, r=JonathanBrouwer

Add `Forget` trait feature gate

r? jonathanbrouwer

Add an unstable feature gate for the `Forget` trait. Creating the feature gate allows experimentation with its implementation. Note that this does not commit to anything w.r.t. stabilization of the forget trait. A feature gate can be removed at any time.

Part of rust-lang#165370
rust-bors Bot pushed a commit that referenced this pull request Nov 4, 2026
…uwer

Rollup of 7 pull requests

Successful merges:

 - #164752 (Apply the Cortex-A53 843419 CC mitigation to aarch64 targets )
 - #165376 (Add `Forget` trait feature gate)
 - #165257 (Revert FCW on lint attributes on macro calls)
 - #165364 (Update books)
 - #165424 (Update amdgpu datalayout for LLVM 24)
 - #165443 (Add `Discriminant::ord`)
 - #165445 (Add an unstable option to increase the chain depth of the next solver overflow FCW)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Nov 4, 2026
…gate, r=JonathanBrouwer

Add `Forget` trait feature gate

r? jonathanbrouwer

Add an unstable feature gate for the `Forget` trait. Creating the feature gate allows experimentation with its implementation. Note that this does not commit to anything w.r.t. stabilization of the forget trait. A feature gate can be removed at any time.

Part of rust-lang#165370
rust-bors Bot pushed a commit that referenced this pull request Nov 4, 2026
…uwer

Rollup of 17 pull requests

Successful merges:

 - #164752 (Apply the Cortex-A53 843419 CC mitigation to aarch64 targets )
 - #165011 (std: Clean up and improve errors for `is_*_feature_detected` macros)
 - #165376 (Add `Forget` trait feature gate)
 - #164482 (Remove the label starting with 0 in the test binary_asm_labels_allowed.rs)
 - #165201 (Move a bunch of methods out of `AttributeExt`)
 - #165268 (Fix constant-pattern  equality suggestion spans in macros)
 - #165318 (Fix explicit destructor-call suggestion spans in macros)
 - #164440 ([Outreachy] alloc: Add test coverage for try_clone_from_ref_in (Box, Arc, Rc))
 - #165001 (Document allocator swap in BinaryHeap::append)
 - #165257 (Revert FCW on lint attributes on macro calls)
 - #165330 (Impl read_le/read_be for f16 and f128)
 - #165364 (Update books)
 - #165414 (Remove unusued query key impl)
 - #165424 (Update amdgpu datalayout for LLVM 24)
 - #165440 (docker: bump node to v24.22.2 in shared script)
 - #165443 (Add `Discriminant::ord`)
 - #165445 (Add an unstable option to increase the chain depth of the next solver overflow FCW)
rust-bors Bot pushed a commit that referenced this pull request Nov 4, 2026
…uwer

Rollup of 17 pull requests

Successful merges:

 - #164752 (Apply the Cortex-A53 843419 CC mitigation to aarch64 targets )
 - #165011 (std: Clean up and improve errors for `is_*_feature_detected` macros)
 - #165376 (Add `Forget` trait feature gate)
 - #164482 (Remove the label starting with 0 in the test binary_asm_labels_allowed.rs)
 - #165201 (Move a bunch of methods out of `AttributeExt`)
 - #165268 (Fix constant-pattern  equality suggestion spans in macros)
 - #165318 (Fix explicit destructor-call suggestion spans in macros)
 - #164440 ([Outreachy] alloc: Add test coverage for try_clone_from_ref_in (Box, Arc, Rc))
 - #165001 (Document allocator swap in BinaryHeap::append)
 - #165257 (Revert FCW on lint attributes on macro calls)
 - #165330 (Impl read_le/read_be for f16 and f128)
 - #165364 (Update books)
 - #165414 (Remove unusued query key impl)
 - #165424 (Update amdgpu datalayout for LLVM 24)
 - #165440 (docker: bump node to v24.22.2 in shared script)
 - #165443 (Add `Discriminant::ord`)
 - #165445 (Add an unstable option to increase the chain depth of the next solver overflow FCW)
rust-bors Bot pushed a commit that referenced this pull request Nov 4, 2026
…uwer

Rollup of 17 pull requests

Successful merges:

 - #164752 (Apply the Cortex-A53 843419 CC mitigation to aarch64 targets )
 - #165011 (std: Clean up and improve errors for `is_*_feature_detected` macros)
 - #165376 (Add `Forget` trait feature gate)
 - #164482 (Remove the label starting with 0 in the test binary_asm_labels_allowed.rs)
 - #165201 (Move a bunch of methods out of `AttributeExt`)
 - #165268 (Fix constant-pattern  equality suggestion spans in macros)
 - #165318 (Fix explicit destructor-call suggestion spans in macros)
 - #164440 ([Outreachy] alloc: Add test coverage for try_clone_from_ref_in (Box, Arc, Rc))
 - #165001 (Document allocator swap in BinaryHeap::append)
 - #165257 (Revert FCW on lint attributes on macro calls)
 - #165330 (Impl read_le/read_be for f16 and f128)
 - #165364 (Update books)
 - #165414 (Remove unusued query key impl)
 - #165424 (Update amdgpu datalayout for LLVM 24)
 - #165440 (docker: bump node to v24.22.2 in shared script)
 - #165443 (Add `Discriminant::ord`)
 - #165445 (Add an unstable option to increase the chain depth of the next solver overflow FCW)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) perf-regression Performance regression. 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. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants