Skip to content

Provide a const new for GlobalCache#155533

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
ChayimFriedman2:const-cache-new
Apr 20, 2026
Merged

Provide a const new for GlobalCache#155533
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
ChayimFriedman2:const-cache-new

Conversation

@ChayimFriedman2
Copy link
Copy Markdown
Contributor

This can help rust-analyzer a bit.

This can help rust-analyzer a bit.
@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. labels Apr 20, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 20, 2026

r? @ShoyuVanilla

rustbot has assigned @ShoyuVanilla.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler, types
  • compiler, types expanded to 72 candidates
  • Random selection from 16 candidates

Copy link
Copy Markdown
Member

@ShoyuVanilla ShoyuVanilla left a comment

Choose a reason for hiding this comment

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

r=me when the CI is green
(I'll do it if I'm available then but in case I'm not 😅)

View changes since this review

@@ -39,6 +39,11 @@ pub struct GlobalCache<X: Cx> {
}

impl<X: Cx> GlobalCache<X> {
#[inline]
pub const fn new() -> Self {
Copy link
Copy Markdown
Member

@ShoyuVanilla ShoyuVanilla Apr 20, 2026

Choose a reason for hiding this comment

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

As we already have unstable conditional const in Default impl for HashMap, I think Default impl for GlobalCache could also be constified after its stabilization

@ChayimFriedman2
Copy link
Copy Markdown
Contributor Author

@bors r=@ShoyuVanilla rollup

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 20, 2026

📌 Commit 5749fe8 has been approved by ShoyuVanilla

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-review Status: Awaiting review from the assignee but also interested parties. labels Apr 20, 2026
rust-bors bot pushed a commit that referenced this pull request Apr 20, 2026
…uwer

Rollup of 10 pull requests

Successful merges:

 - #155054 (constify `Index(Mut)`, `Deref(Mut)` for `Vec`)
 - #155264 (Add autocast support for `x86amx`)
 - #155507 (suggest expect instead of unwrap when arg provided)
 - #154664 (core/num: Implement feature `integer_cast_extras`)
 - #155238 (compiletest: add a new diff for compare-out-by-lines tests.)
 - #155474 (Rename incremental `cfail`/`cpass` revisions to `bfail`/`bpass`)
 - #155493 (docs(num): fix stale link to `mem::Alignment`)
 - #155529 (Remove `AttributeLintKind` variants - part 3)
 - #155531 (Tweak `is_ascii_punctuation()` docs wording)
 - #155533 (Provide a const new for `GlobalCache`)
rust-timer added a commit that referenced this pull request Apr 20, 2026
Rollup merge of #155533 - ChayimFriedman2:const-cache-new, r=ShoyuVanilla

Provide a const new for `GlobalCache`

This can help rust-analyzer a bit.
@rust-bors rust-bors bot merged commit d00c047 into rust-lang:main Apr 20, 2026
11 checks passed
@rustbot rustbot added this to the 1.97.0 milestone Apr 20, 2026
github-actions bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Apr 20, 2026
…uwer

Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#155054 (constify `Index(Mut)`, `Deref(Mut)` for `Vec`)
 - rust-lang/rust#155264 (Add autocast support for `x86amx`)
 - rust-lang/rust#155507 (suggest expect instead of unwrap when arg provided)
 - rust-lang/rust#154664 (core/num: Implement feature `integer_cast_extras`)
 - rust-lang/rust#155238 (compiletest: add a new diff for compare-out-by-lines tests.)
 - rust-lang/rust#155474 (Rename incremental `cfail`/`cpass` revisions to `bfail`/`bpass`)
 - rust-lang/rust#155493 (docs(num): fix stale link to `mem::Alignment`)
 - rust-lang/rust#155529 (Remove `AttributeLintKind` variants - part 3)
 - rust-lang/rust#155531 (Tweak `is_ascii_punctuation()` docs wording)
 - rust-lang/rust#155533 (Provide a const new for `GlobalCache`)
@ChayimFriedman2 ChayimFriedman2 deleted the const-cache-new branch April 20, 2026 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants