Skip to content

Create definitions for promoted constants.#155898

Draft
cjgillot wants to merge 15 commits intorust-lang:mainfrom
cjgillot:feed-promoted
Draft

Create definitions for promoted constants.#155898
cjgillot wants to merge 15 commits intorust-lang:mainfrom
cjgillot:feed-promoted

Conversation

@cjgillot
Copy link
Copy Markdown
Contributor

@cjgillot cjgillot commented Apr 28, 2026

View all comments

Reopening #111693

The current handling of promoted carries an Option<Promoted> everywhere to disambiguate the normal item from the constant.

This PR replaces the promoted constants by new definitions with new DefKind::Promoted.
This method allows to unify borrow-checking with the code path for inline consts.

Requires #155777 if we want decent perf

@rustbot rustbot added PG-exploit-mitigations Project group: Exploit mitigations S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Apr 28, 2026
@rust-log-analyzer

This comment has been minimized.

@cjgillot
Copy link
Copy Markdown
Contributor Author

@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 Apr 29, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Apr 29, 2026
Create definitions for promoted constants.
@rust-log-analyzer

This comment has been minimized.

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 29, 2026

☀️ Try build successful (CI)
Build commit: 13cee97 (13cee972aafa0cc63bf6617e687d98bc208ca4b3, parent: 37d85e592f9ae5f20f7d9a9f99785246fa7298da)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (13cee97): comparison URL.

Overall result: ❌✅ regressions and improvements - 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
@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)
29.7% [0.2%, 250.7%] 174
Regressions ❌
(secondary)
17.8% [0.0%, 121.9%] 122
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.4% [-0.9%, -0.1%] 18
All ❌✅ (primary) 29.7% [0.2%, 250.7%] 174

Max RSS (memory usage)

Results (primary 24.4%, secondary 15.4%)

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

mean range count
Regressions ❌
(primary)
25.0% [2.8%, 74.0%] 125
Regressions ❌
(secondary)
18.7% [2.7%, 75.7%] 69
Improvements ✅
(primary)
-2.1% [-2.8%, -1.1%] 3
Improvements ✅
(secondary)
-2.2% [-3.4%, -1.1%] 13
All ❌✅ (primary) 24.4% [-2.8%, 74.0%] 128

Cycles

Results (primary 50.7%, secondary 27.9%)

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

mean range count
Regressions ❌
(primary)
50.7% [2.0%, 327.8%] 127
Regressions ❌
(secondary)
29.7% [2.3%, 150.6%] 86
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.6% [-4.1%, -1.8%] 5
All ❌✅ (primary) 50.7% [2.0%, 327.8%] 127

Binary size

Results (primary 0.1%, secondary 22.0%)

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

mean range count
Regressions ❌
(primary)
0.6% [0.0%, 1.9%] 61
Regressions ❌
(secondary)
63.2% [0.0%, 319.4%] 25
Improvements ✅
(primary)
-0.5% [-1.0%, -0.1%] 48
Improvements ✅
(secondary)
-0.9% [-2.0%, -0.2%] 45
All ❌✅ (primary) 0.1% [-1.0%, 1.9%] 109

Bootstrap: 486.76s -> 490.092s (0.68%)
Artifact size: 393.43 MiB -> 393.71 MiB (0.07%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Apr 29, 2026
@rust-bors

This comment has been minimized.

@cjgillot
Copy link
Copy Markdown
Contributor Author

cjgillot commented May 1, 2026

@bors try @rust-timer queue

@cjgillot cjgillot closed this May 1, 2026
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label May 1, 2026
@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 May 1, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request May 1, 2026
Create definitions for promoted constants.
@cjgillot cjgillot reopened this May 1, 2026
@rustbot rustbot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label May 1, 2026
@rust-log-analyzer

This comment has been minimized.

@cjgillot
Copy link
Copy Markdown
Contributor Author

cjgillot commented May 1, 2026

@bors try @rust-timer queue

@rust-timer
Copy link
Copy Markdown
Collaborator

This pull request is already queued and waiting for a try build to finish.

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request May 1, 2026
Create definitions for promoted constants.
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 1, 2026

💔 Test for f43dad3 failed: CI. Failed job:

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@cjgillot
Copy link
Copy Markdown
Contributor Author

cjgillot commented May 1, 2026

Hahaha if I want the fed information to be accessible to the next execution, it needs to be stored somewhere on-disk 🤣

@rust-bors

This comment has been minimized.

@cjgillot cjgillot force-pushed the feed-promoted branch 2 times, most recently from 2d38287 to 78f8cb7 Compare May 3, 2026 15:51
@rust-log-analyzer
Copy link
Copy Markdown
Collaborator

The job aarch64-gnu-llvm-21-2 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
##[endgroup]
Executing "/scripts/stage_2_test_set2.sh"
+ /scripts/stage_2_test_set2.sh
+ '[' 1 == 1 ']'
+ echo 'PR_CI_JOB set; skipping tidy'
+ SKIP_TIDY='--skip tidy'
+ ../x.py --stage 2 test --skip tidy --skip tests --skip coverage-map --skip coverage-run --skip library --skip tidyselftest
PR_CI_JOB set; skipping tidy
##[group]Building bootstrap
    Finished `dev` profile [unoptimized] target(s) in 0.04s
##[endgroup]

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 3, 2026

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

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

Labels

A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-rustc-dev-guide Area: rustc-dev-guide perf-regression Performance regression. PG-exploit-mitigations Project group: Exploit mitigations S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. S-waiting-on-perf Status: Waiting on a perf run to be completed. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants