Skip to content

[EXPERIMENT] Destabilize vec::from_elem - #164053

Closed
ChrisDenton wants to merge 1 commit into
rust-lang:mainfrom
ChrisDenton:destabilize-vec-from_elem
Closed

ChrisDenton wants to merge 1 commit into
rust-lang:mainfrom
ChrisDenton:destabilize-vec-from_elem

Conversation

@ChrisDenton

@ChrisDenton ChrisDenton commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

@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 Oct 9, 2026
@ChrisDenton

Copy link
Copy Markdown
Member Author

@bors try

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Oct 9, 2026
@ChrisDenton

Copy link
Copy Markdown
Member Author

cc @clarfonthey as you've expressed an interest here. I'll do a crater run here if try is successful but I do feel very strongly that our internals should be internal so if there is a problem I'd at least like to #[deprecate] with an intent to make it properly unstable in the future.

@ChrisDenton

Copy link
Copy Markdown
Member Author

Hm, for some reason the try build isn't being picked up. Let me try again:

@bors try

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Oct 9, 2026
@rust-bors

rust-bors Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 67a539c (67a539cbdf2a0107837ce64f9069509a44da67b7)
Base parent: 69bccf0 (69bccf03c4733f57482f9691456efcd80f86a5f6)

@ChrisDenton

Copy link
Copy Markdown
Member Author

@craterbot check

@craterbot

Copy link
Copy Markdown
Collaborator

👌 Experiment pr-164053 created and queued.
🤖 Automatically detected try build 67a539c
🔍 You can check out the queue and this experiment's details.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added S-waiting-on-crater Status: Waiting on a crater run to be completed. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 9, 2026
@theemathas theemathas mentioned this pull request Oct 11, 2026
@theemathas

Copy link
Copy Markdown
Contributor

Crater rollup in #164148

@craterbot abort

@craterbot

Copy link
Copy Markdown
Collaborator

🗑️ Experiment pr-164053 deleted!

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-crater Status: Waiting on a crater run to be completed. labels Oct 11, 2026
@theemathas

Copy link
Copy Markdown
Contributor

@craterbot

Copy link
Copy Markdown
Collaborator

👌 Experiment pr-164053 created and queued.
🤖 Automatically detected try build 67a539c
🔍 You can check out the queue and this experiment's details.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added S-waiting-on-crater Status: Waiting on a crater run to be completed. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 18, 2026
@theemathas

Copy link
Copy Markdown
Contributor

The fontdue crate (dependency of miniquad and macroquad) uses vec::from_elem. https://github.com/mooman219/fontdue/blob/2924772fb4439b8aca40b1bffca70088acba5a1b/src/font.rs#L287

@clarfonthey

Copy link
Copy Markdown
Contributor

Yeah I mean, this is kind of what I expected to happen, although we'll see how many breakages there are.

@folkertdev

Copy link
Copy Markdown
Contributor

Opened mooman219/fontdue#173, may as well get that sorted out sooner rather than later. Luckily most users are on the latest patch release so will likely upgrade to a next patch release automatically.

mooman219 pushed a commit to mooman219/fontdue that referenced this pull request Oct 19, 2026
`std::vec::from_elem` is an undocument function that we intend to destabilize (see rust-lang/rust#164053). The `vec!` macro can be used instead, it has the exact same behavior.
@mooman219

Copy link
Copy Markdown

I assume this is going to need a #[deprecated] given there is usage of it. I've published the patch to omit my usage in the meantime.

I surfaced this API from using rust analyzer. It recommended the function at the time and it seemed to fit what I wanted. This was a long time ago at this point, and #[doc(hidden)] might have been less respected by RA.

@craterbot

Copy link
Copy Markdown
Collaborator

🚧 Experiment pr-164053 is now running

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot

Copy link
Copy Markdown
Collaborator

🎉 Experiment pr-164053 is completed!
📊 3583 regressed and 0 fixed (28882 total)
📊 999 spurious results on the retry-regressed-list.txt, consider a retry1 if this is a significant amount.
📰 Open the summary report.

⚠️ If you notice any spurious failure please add them to the denylist!
ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

Footnotes

  1. re-run the experiment with crates=https://crater-reports.s3.amazonaws.com/pr-164053/retry-regressed-list.txt ↩

@craterbot craterbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-crater Status: Waiting on a crater run to be completed. labels Oct 19, 2026
@clarfonthey

Copy link
Copy Markdown
Contributor

Yeah, as expected, will want at least a deprecation/FCW on this rather than immediate merging. 50 top-level crates is unfortunate but not unfixable and doesn't mean we can't remove it eventually, just, not right now.

@clarfonthey

Copy link
Copy Markdown
Contributor

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 20, 2026
@folkertdev

Copy link
Copy Markdown
Contributor

It's really mostly fontdue and then cryptoxide which I've also submitted a PR to. It's also a bunch of older versions for fontdue which based on crates.io get relatively few downloads. So, it's more nuanced than the raw number.

But yeah deprecating first does seem like the way to go.

@ChrisDenton

Copy link
Copy Markdown
Member Author

I think this experiment has served its purpose so I'll close this now. I'll put up a new PR deprecating vec::from_elem. We can revisit destabilization later.

@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 Oct 20, 2026
@ChrisDenton

Copy link
Copy Markdown
Member Author

See #164653

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

Labels

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.

7 participants