Skip to content

constify vec![1, 2, 3] macro#155795

Open
Lars-Schumann wants to merge 1 commit into
rust-lang:mainfrom
Lars-Schumann:const-vec-macro
Open

constify vec![1, 2, 3] macro#155795
Lars-Schumann wants to merge 1 commit into
rust-lang:mainfrom
Lars-Schumann:const-vec-macro

Conversation

@Lars-Schumann

@Lars-Schumann Lars-Schumann commented Apr 25, 2026

Copy link
Copy Markdown
Contributor

Tracking issues:
const_heap: #79597

makes all the parts needed for non-empty vec![] macros const:

alloc::boxed::box_assume_init_into_vec_unsafe
alloc::boxed::Box::assume_init
alloc::boxed::Box::into_raw_with_allocator
alloc::boxed::Box::new_uninit
alloc::slice::[T]::into_vec

Note that this does not allow for the use of the vec![(); 4] arm of this macro to be used in const-eval, since that uses specialization (spec and const traits don't really like each other so I didn't want to touch any of that in this).

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Apr 25, 2026
@rust-log-analyzer

This comment has been minimized.

@Lars-Schumann Lars-Schumann marked this pull request as ready for review July 14, 2026 13:13
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 14, 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 Jul 14, 2026
@rustbot

rustbot commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

r? @TaKO8Ki

rustbot has assigned @TaKO8Ki.
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
  • compiler expanded to 75 candidates
  • Random selection from 21 candidates

@rustbot

This comment has been minimized.

@rustbot

This comment has been minimized.

@rust-bors

This comment has been minimized.

@rustbot

rustbot commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

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.

@Lars-Schumann

Copy link
Copy Markdown
Contributor Author

r? @rust-lang/wg-const-eval

@rustbot rustbot assigned lcnr and unassigned TaKO8Ki Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library 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