Skip to content

check_consts: fix error requesting feature gate when that gate is not actually needed - #132992

Merged
bors merged 1 commit into
rust-lang:masterfrom
RalfJung:check-consts-feature-gate
Nov 15, 2024
Merged

check_consts: fix error requesting feature gate when that gate is not actually needed#132992
bors merged 1 commit into
rust-lang:masterfrom
RalfJung:check-consts-feature-gate

Conversation

@RalfJung

Copy link
Copy Markdown
Member

When working on rust-lang/hashbrown#586 I noticed that the compiler asks for the rustc_private feature to be enabled if one forgets to set rustc_const_stable_indirect on a function -- but enabling rustc_private would not actually help. This fixes the diagnostics.

r? @compiler-errors

@rustbotrustbot 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. labels Nov 13, 2024
@rustbot

Copy link
Copy Markdown
Collaborator

Some changes occurred to the CTFE machinery

cc @rust-lang/wg-const-eval

//@ compile-flags: -Zforce-unstable-if-unmarked
//@ edition: 2021
#![feature(const_async_blocks, rustc_attrs, rustc_private)]
#![feature(const_async_blocks, rustc_attrs)]

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Without this PR, removing rustc_private here would have completely changed the output. So the point of the PR is that even without rustc_private, the output here is as before: suggesting rustc_const_stable_indirect on the callee.

@compiler-errors

Copy link
Copy Markdown
Contributor

@bors r+ rollup

@bors

bors commented Nov 15, 2024

Copy link
Copy Markdown
Collaborator

📌 Commit 9760983 has been approved by compiler-errors

It is now in the queue for this repository.

@borsbors 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 15, 2024
@bors

bors commented Nov 15, 2024

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 9760983 with merge ce40196...

@bors

bors commented Nov 15, 2024

Copy link
Copy Markdown
Collaborator

☀️ Test successful - checks-actions
Approved by: compiler-errors
Pushing ce40196 to master...

@borsbors added the merged-by-bors This PR was explicitly merged by bors. label Nov 15, 2024
@bors
bors merged commit ce40196 into rust-lang:masterNov 15, 2024
@rustbotrustbot added this to the 1.84.0 milestone Nov 15, 2024
@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (ce40196): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

This is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

meanrangecount
Regressions ❌
(primary)
--0
Regressions ❌
(secondary)
--0
Improvements ✅
(primary)
-0.0%[-0.0%, -0.0%]1
Improvements ✅
(secondary)
-0.1%[-0.1%, -0.1%]1
All ❌✅ (primary)-0.0%[-0.0%, -0.0%]1

Max RSS (memory usage)

Results (primary -5.1%)

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.

meanrangecount
Regressions ❌
(primary)
--0
Regressions ❌
(secondary)
--0
Improvements ✅
(primary)
-5.1%[-6.9%, -3.3%]2
Improvements ✅
(secondary)
--0
All ❌✅ (primary)-5.1%[-6.9%, -3.3%]2

Cycles

Results (primary -2.1%, secondary -1.8%)

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.

meanrangecount
Regressions ❌
(primary)
--0
Regressions ❌
(secondary)
--0
Improvements ✅
(primary)
-2.1%[-2.2%, -2.0%]2
Improvements ✅
(secondary)
-1.8%[-2.1%, -1.5%]2
All ❌✅ (primary)-2.1%[-2.2%, -2.0%]2

Binary size

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

Bootstrap: 786.926s -> 786.906s (-0.00%)
Artifact size: 335.38 MiB -> 335.30 MiB (-0.02%)

@RalfJung
RalfJung deleted the check-consts-feature-gate branch November 16, 2024 08:06
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-borsThis PR was explicitly merged by bors.S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@RalfJung@rustbot@compiler-errors@bors@rust-timer