Suggest the [const] Destruct bound for type parameters in const functions when missing#155013
Suggest the [const] Destruct bound for type parameters in const functions when missing#155013jakubadamw wants to merge 3 commits into
[const] Destruct bound for type parameters in const functions when missing#155013Conversation
|
Some changes occurred to constck cc @fee1-dead Some changes occurred to the CTFE machinery |
|
r? @wesleywiser rustbot has assigned @wesleywiser. Use Why was this reviewer chosen?The reviewer was selected based on:
|
[const] Destruct bound for type parameters in const functions[const] Destruct bound for type parameters in const functions when missing
|
thanks for the contribution, but this is experimental syntax which means syntax may change in future, so I think it should be held until stabilization |
|
Reminder, once the PR becomes ready for a review, use |
This comment has been minimized.
This comment has been minimized.
…ctions When a const function drops a value whose type is a type parameter, suggest adding a `[const] Destruct` bound so the destructor can be evaluated at compile-time.
The suggested bound requires the unstable `const_destruct` feature, so it is not actionable on a stable compiler. Add a run-make test that verifies the suggestion is only emitted on nightly.
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
@wesleywiser, thank you, I made the suggestion trigger on nightly only. 🙂 |
|
The job Click to see the possible cause of the failure (guessed by this bot) |
When a const function drops a value whose type is a type parameter without a
[const] Destructbound, suggest adding it so that the destructor can be evaluated at compile-time.Closes #103270.
Example:
Before:
After:
No new tests as the existing ones had their results updated with the new suggestion.