# Uncategorized

**URL:** https://internals.rust-lang.org/c/uncategorized/1.md

[Latest](https://internals.rust-lang.org/latest.md) · [Categories](https://internals.rust-lang.org/categories.md)

---

## [Welcome to the Rust Programming Language Internals Forum](https://internals.rust-lang.org/t/welcome-to-the-rust-programming-language-internals-forum/6)

<div class="topic-metadata">

**Author:** [@system](https://internals.rust-lang.org/u/system)\
**Replies:** 0\
**Last updated:** [June 25, 2014, 2:47pm UTC](https://internals.rust-lang.org/t/welcome-to-the-rust-programming-language-internals-forum/6 "2014-06-25T14:47:32Z")

</div>

Here is the hub for discussing everything related to the implementation and design of the Rust programming language. This is not a support forum. Questions or requests for support using Rust should be directed to the us…

---

## [Cargo / crate statistics on nixpkgs of 2300 rust projects](https://internals.rust-lang.org/t/cargo-crate-statistics-on-nixpkgs-of-2300-rust-projects/24647)

<div class="topic-metadata">

**Author:** [@qknight](https://internals.rust-lang.org/u/qknight)\
**Replies:** 2\
**Last updated:** [October 19, 2026, 11:48pm UTC](https://internals.rust-lang.org/t/cargo-crate-statistics-on-nixpkgs-of-2300-rust-projects/24647 "2026-10-19T23:48:49Z")

</div>

i've been doing a study on the rust/cargo and therefore crate usage of 2300 rust projects in nixpkgs you might want to look at: (it is framed for libnix usage but the statistics are actually independent of this and ar…

---

## [Quick Rust Improvement Ideas — Language & Std (Community Brainstorm)](https://internals.rust-lang.org/t/quick-rust-improvement-ideas-language-std-community-brainstorm/24617)

<div class="topic-metadata">

**Author:** [@fuji-184](https://internals.rust-lang.org/u/fuji-184)\
**Replies:** 84\
**Last updated:** [October 7, 2026, 5:07am UTC](https://internals.rust-lang.org/t/quick-rust-improvement-ideas-language-std-community-brainstorm/24617 "2026-10-07T05:07:03Z")

</div>

A dedicated thread for quick improvement ideas for Rust, whether it's the language itself or the standard library. No idea is too small, if you think something could be better, drop it here. After an idea is clear, feel …

---

## [VecDeque should expose head via head\_index() (or similarly named)](https://internals.rust-lang.org/t/vecdeque-should-expose-head-via-head-index-or-similarly-named/24652)

<div class="topic-metadata">

**Author:** [@d0sboots](https://internals.rust-lang.org/u/d0sboots)\
**Replies:** 15\
**Last updated:** [October 9, 2026, 6:18pm UTC](https://internals.rust-lang.org/t/vecdeque-should-expose-head-via-head-index-or-similarly-named/24652 "2026-10-09T18:18:51Z")

</div>

VecDeque (sensibly) uses indexing to index in queue order, so deque.get(0) is always identical to deque.front(). However, this makes it almost impossible to index consistently into the physical buffer - if you wish to ke…

---

## [Why does dyn UnsafeTrait auto-implement UnsafeTrait?](https://internals.rust-lang.org/t/why-does-dyn-unsafetrait-auto-implement-unsafetrait/24650)

<div class="topic-metadata">

**Author:** [@ProgramCrafter](https://internals.rust-lang.org/u/ProgramCrafter)\
**Replies:** 14\
**Last updated:** [October 6, 2026, 5:14pm UTC](https://internals.rust-lang.org/t/why-does-dyn-unsafetrait-auto-implement-unsafetrait/24650 "2026-10-06T17:14:21Z")

</div>

The compiler cannot guarantee the safety contract of UnsafeTrait when implementing it for dyn UnsafeTrait type (because it doesn't see it at the very least - it's in the comment), especially if it's something like: /// …

---

## [Final associated constants?](https://internals.rust-lang.org/t/final-associated-constants/24655)

<div class="topic-metadata">

**Author:** [@nazar-pc](https://internals.rust-lang.org/u/nazar-pc)\
**Replies:** 2\
**Last updated:** [October 6, 2026, 6:21am UTC](https://internals.rust-lang.org/t/final-associated-constants/24655 "2026-10-06T06:21:38Z")

</div>

Tracking issue for RFC 3678: Trait method impl restrictions (\`final\` methods) · Issue #131179 · rust-lang/rust · GitHub is about final methods, but I think it might be equally valuable for associated constants. For exam…

---

## [Aliasing-xor-mutation WITHOUT borrow-checker](https://internals.rust-lang.org/t/aliasing-xor-mutation-without-borrow-checker/24596)

<div class="topic-metadata">

**Author:** [@F001](https://internals.rust-lang.org/u/F001)\
**Replies:** 96\
**Last updated:** [October 5, 2026, 10:17am UTC](https://internals.rust-lang.org/t/aliasing-xor-mutation-without-borrow-checker/24596 "2026-10-05T10:17:12Z")

</div>

Hi, Rust experts! I've been pondering a question for a long time: is the borrow checker the only solution for achieving "aliasing XOR mutation" ? After years of exploration, I personally feel there might be other solutio…

---

## [CoercePointee for types that hold metadata with something else aside a ptr](https://internals.rust-lang.org/t/coercepointee-for-types-that-hold-metadata-with-something-else-aside-a-ptr/24649)

<div class="topic-metadata">

**Author:** [@izagawd](https://internals.rust-lang.org/u/izagawd)\
**Replies:** 1\
**Last updated:** [October 1, 2026, 7:56pm UTC](https://internals.rust-lang.org/t/coercepointee-for-types-that-hold-metadata-with-something-else-aside-a-ptr/24649 "2026-10-01T19:56:43Z")

</div>

I noticed that CoercePointee only works for pointers, but I have been thinking that it could be beneficial if it allowed other types aside pointers. I believe that this example would be a good use case for it: // The …

---

## [How to do an in-place mapping of values in containers from a T to a newtype wrapper of T?](https://internals.rust-lang.org/t/how-to-do-an-in-place-mapping-of-values-in-containers-from-a-t-to-a-newtype-wrapper-of-t/24607)

<div class="topic-metadata">

**Author:** [@Sawyer47](https://internals.rust-lang.org/u/Sawyer47)\
**Replies:** 24\
**Last updated:** [September 23, 2026, 3:49pm UTC](https://internals.rust-lang.org/t/how-to-do-an-in-place-mapping-of-values-in-containers-from-a-t-to-a-newtype-wrapper-of-t/24607 "2026-09-23T15:49:35Z")

</div>

Hi! I wonder how to map a container in-place from type T to a repr(transparent) wrapper of T that establishes some invariant - purely as an optimization so that I do not need to rewrite the entire container into a new …

---

## [Nudging users off 2015 edition](https://internals.rust-lang.org/t/nudging-users-off-2015-edition/24559)

<div class="topic-metadata">

**Author:** [@kornel](https://internals.rust-lang.org/u/kornel)\
**Replies:** 41\
**Last updated:** [September 20, 2026, 6:05pm UTC](https://internals.rust-lang.org/t/nudging-users-off-2015-edition/24559 "2026-09-20T18:05:04Z")

</div>

There are real costs to having 2015-edition Rust source code, and arguably no benefits. I think rustc and Cargo should start warning about crates still using the 2015 edition and encourage moving to a newer edition. u…

---

## [Pre-RFC: defining globals in global\_asm!](https://internals.rust-lang.org/t/pre-rfc-defining-globals-in-global-asm/24558)

<div class="topic-metadata">

**Author:** [@alice](https://internals.rust-lang.org/u/alice)\
**Replies:** 1\
**Last updated:** [August 27, 2026, 8:03am UTC](https://internals.rust-lang.org/t/pre-rfc-defining-globals-in-global-asm/24558 "2026-08-27T08:03:32Z")

</div>

Rust's asm story currently has some big limitations related to defining globals from asm blocks. Specifically, there are two limitations: You have to pick the symbol name yourself. You cannot ask the compiler to pick a…

---

## [My Idea to buff no\_std](https://internals.rust-lang.org/t/my-idea-to-buff-no-std/24554)

<div class="topic-metadata">

**Author:** [@t4ce](https://internals.rust-lang.org/u/t4ce)\
**Replies:** 8\
**Last updated:** [August 26, 2026, 5:40pm UTC](https://internals.rust-lang.org/t/my-idea-to-buff-no-std/24554 "2026-08-26T17:40:12Z")

</div>

Hello People i don't have the immediate need for this but maybe some time in the future such a concept may be useful do somebody, maybe. However i am still very interested in what the other souls think towards this Ide…

---

## [How would specialisation (if a sound implementation was ever found) prevent itself from allowing negative trait reasoning?](https://internals.rust-lang.org/t/how-would-specialisation-if-a-sound-implementation-was-ever-found-prevent-itself-from-allowing-negative-trait-reasoning/24553)

<div class="topic-metadata">

**Author:** [@miro](https://internals.rust-lang.org/u/miro)\
**Replies:** 1\
**Last updated:** [August 25, 2026, 7:20pm UTC](https://internals.rust-lang.org/t/how-would-specialisation-if-a-sound-implementation-was-ever-found-prevent-itself-from-allowing-negative-trait-reasoning/24553 "2026-08-25T19:20:33Z")

</div>

from my (very limited) understanding of specialisation something like the following should be allowed by it: trait Baz {} trait Foo { fn bar(); } impl\<T\> Foo for T { fn bar() { // slow path } } im…

---

## [Clarification on conditional assignment](https://internals.rust-lang.org/t/clarification-on-conditional-assignment/24490)

<div class="topic-metadata">

**Author:** [@justinefication](https://internals.rust-lang.org/u/justinefication)\
**Replies:** 3\
**Last updated:** [July 25, 2026, 7:48pm UTC](https://internals.rust-lang.org/t/clarification-on-conditional-assignment/24490 "2026-07-25T19:48:51Z")

</div>

Hi everyone! I hope I don't come of as oblivious. I'm currently following the Interactive Rust Book and one of the quizzes presented in the topic of Control Flow in Rust is this: let x; if cond { x = 1; } else { …

---

## [Idea : Explicit And More Flexible Lifetime Annotation And Thread's At Exit Hook](https://internals.rust-lang.org/t/idea-explicit-and-more-flexible-lifetime-annotation-and-threads-at-exit-hook/24473)

<div class="topic-metadata">

**Author:** [@fuji-184](https://internals.rust-lang.org/u/fuji-184)\
**Replies:** 14\
**Last updated:** [July 18, 2026, 4:03pm UTC](https://internals.rust-lang.org/t/idea-explicit-and-more-flexible-lifetime-annotation-and-threads-at-exit-hook/24473 "2026-07-18T16:03:02Z")

</div>

Hello, I have this idea that can make memory management more flexible and still zero cost Here is the specs and example : fn a() -\> (String, String) { ( String::from("Hello"), String::from("Hello 2"…

---

## [Print build profile options](https://internals.rust-lang.org/t/print-build-profile-options/24460)

<div class="topic-metadata">

**Author:** [@kpcyrd](https://internals.rust-lang.org/u/kpcyrd)\
**Replies:** 1\
**Last updated:** [July 10, 2026, 3:47pm UTC](https://internals.rust-lang.org/t/print-build-profile-options/24460 "2026-07-10T15:47:53Z")

</div>

Hello! There's currently some ongoing discussion about the build flags Arch Linux wants to use, I want to compare this with the current upstream default options/profile but it seems there's no way to do so. There's a p…

---

## [Reflecting on reactions to build probes & cfg-gating features](https://internals.rust-lang.org/t/reflecting-on-reactions-to-build-probes-cfg-gating-features/24450)

<div class="topic-metadata">

**Author:** [@MusicalNinjaDad](https://internals.rust-lang.org/u/MusicalNinjaDad)\
**Replies:** 3\
**Last updated:** [July 9, 2026, 4:10pm UTC](https://internals.rust-lang.org/t/reflecting-on-reactions-to-build-probes-cfg-gating-features/24450 "2026-07-09T16:10:31Z")

</div>

I recently started a thread which branched over to a discussion on build scripts, and particularly feature probes. I was quite taken aback by the visceral reaction this topic caused and, given that I keep thinking about …

---

## [Code compiles on playground but fails when passed via stdin to rustc](https://internals.rust-lang.org/t/code-compiles-on-playground-but-fails-when-passed-via-stdin-to-rustc/24393)

<div class="topic-metadata">

**Author:** [@MusicalNinjaDad](https://internals.rust-lang.org/u/MusicalNinjaDad)\
**Replies:** 41\
**Last updated:** [July 2, 2026, 5:21pm UTC](https://internals.rust-lang.org/t/code-compiles-on-playground-but-fails-when-passed-via-stdin-to-rustc/24393 "2026-07-02T17:21:33Z")

</div>

I've run into the following very strange behaviour and am unsure whether it's some kind of weird bug that I should report or a subtle mistake on my part. The following code compiles and runs fine on playground (as does …

---

## [Why is strict\_div implemented in terms of overflowing\_div for signed integers?](https://internals.rust-lang.org/t/why-is-strict-div-implemented-in-terms-of-overflowing-div-for-signed-integers/24387)

<div class="topic-metadata">

**Author:** [@QuaternionsRock](https://internals.rust-lang.org/u/QuaternionsRock)\
**Replies:** 3\
**Last updated:** [June 28, 2026, 2:39pm UTC](https://internals.rust-lang.org/t/why-is-strict-div-implemented-in-terms-of-overflowing-div-for-signed-integers/24387 "2026-06-28T14:39:58Z")

</div>

I was unable to find a satisfying answer to this question, so I thought I'd ask here. strict\_div is currently implemented as follows for signed integers: pub const fn strict\_div(self, rhs: Self) -\> Self { let (a, b)…

---

## [Should \`.into()\` disrupt coercion?](https://internals.rust-lang.org/t/should-into-disrupt-coercion/24406)

<div class="topic-metadata">

**Author:** [@ItsNovaHere](https://internals.rust-lang.org/u/ItsNovaHere)\
**Replies:** 7\
**Last updated:** [June 27, 2026, 7:48am UTC](https://internals.rust-lang.org/t/should-into-disrupt-coercion/24406 "2026-06-27T07:48:43Z")

</div>

Currently, references are allowed to be coerced to pointers, and the docs for std::convert::Into says Into is reflexive, which means that Into\<T\> for T is implemented. I'm running into an issue where calling .into() whe…

---

## [\[Pre-RFC\] target-glibc: Proposal to add native support for GLIBC versions for the -gnu targets](https://internals.rust-lang.org/t/pre-rfc-target-glibc-proposal-to-add-native-support-for-glibc-versions-for-the-gnu-targets/24225)

<div class="topic-metadata">

**Author:** [@nikkon-dev](https://internals.rust-lang.org/u/nikkon-dev)\
**Replies:** 17\
**Last updated:** [June 25, 2026, 8:05pm UTC](https://internals.rust-lang.org/t/pre-rfc-target-glibc-proposal-to-add-native-support-for-glibc-versions-for-the-gnu-targets/24225 "2026-06-25T20:05:55Z")

</div>

Summary Add first-class support to rustc and cargo for declaring a binary's glibc deployment target — the oldest glibc release the binary is required to run on. Users opt in via either a target-tuple suffix (--target x86…

---

## [Should PGO automatically compile hot code O3 and cold code Oz?](https://internals.rust-lang.org/t/should-pgo-automatically-compile-hot-code-o3-and-cold-code-oz/24401)

<div class="topic-metadata">

**Author:** [@gmatht](https://internals.rust-lang.org/u/gmatht)\
**Replies:** 6\
**Last updated:** [June 24, 2026, 8:33am UTC](https://internals.rust-lang.org/t/should-pgo-automatically-compile-hot-code-o3-and-cold-code-oz/24401 "2026-06-24T08:33:06Z")

</div>

For example, by manually splitting the hot code of a simple benchmark into a library and compiling it at O3 while compiling the rest as Oz we end up with a binary that is strictly better than both Oz and O3... smaller th…

---

## [Compiling rust app with relibc](https://internals.rust-lang.org/t/compiling-rust-app-with-relibc/24375)

<div class="topic-metadata">

**Author:** [@Fiedzia](https://internals.rust-lang.org/u/Fiedzia)\
**Replies:** 1\
**Last updated:** [June 7, 2026, 9:49am UTC](https://internals.rust-lang.org/t/compiling-rust-app-with-relibc/24375 "2026-06-07T09:49:16Z")

</div>

There are ways to use rust std with musl. I am looking into using relibc instead (on Linux). Is there any atm, and if not, what would I need to do to get it done? Looking at std source, there are references to musl, doe…

---

## [Possibility of a "global time source" for wasm targets](https://internals.rust-lang.org/t/possibility-of-a-global-time-source-for-wasm-targets/24370)

<div class="topic-metadata">

**Author:** [@hukasu](https://internals.rust-lang.org/u/hukasu)\
**Replies:** 4\
**Last updated:** [June 3, 2026, 8:21pm UTC](https://internals.rust-lang.org/t/possibility-of-a-global-time-source-for-wasm-targets/24370 "2026-06-03T20:21:10Z")

</div>

My idea is having something like the #\[global\_allocator\] macro but for a "time source", and have std::time::Instant::now() use it. Right now whenever we need to use time on wasm we replace uses of std::time::Instant for…

---

## [Include racy reads in Rust memory model with \`MaybeInvalid\<T\>\`](https://internals.rust-lang.org/t/include-racy-reads-in-rust-memory-model-with-maybeinvalid-t/24289)

<div class="topic-metadata">

**Author:** [@wyfo](https://internals.rust-lang.org/u/wyfo)\
**Replies:** 49\
**Last updated:** [June 2, 2026, 6:47pm UTC](https://internals.rust-lang.org/t/include-racy-reads-in-rust-memory-model-with-maybeinvalid-t/24289 "2026-06-02T18:47:58Z")

</div>

Disclaimer: This post has nothing to do with previous post mentioning MaybeInvalid. Unsafe code guidelines contains a deliberate UB section mentioning the SeqLock issue, i.e. SeqLock algorithm isn’t compatible with Rust…

---

## [Pre-RFC improved ergonomics for \`!\`](https://internals.rust-lang.org/t/pre-rfc-improved-ergonomics-for/24336)

<div class="topic-metadata">

**Author:** [@MusicalNinjaDad](https://internals.rust-lang.org/u/MusicalNinjaDad)\
**Replies:** 19\
**Last updated:** [May 27, 2026, 5:23pm UTC](https://internals.rust-lang.org/t/pre-rfc-improved-ergonomics-for/24336 "2026-05-27T17:23:01Z")

</div>

I would love to gather your feedback to the following idea. When I posted this on zulip the comments I received were: "Foo\<!\> might be inhabited" - I think this proposal works with that consideration "show more about w…

---

## [Another Experiment To Make Unsafe Rust Safer: Preventing UB In MaybeUninit With Compile Time Error](https://internals.rust-lang.org/t/another-experiment-to-make-unsafe-rust-safer-preventing-ub-in-maybeuninit-with-compile-time-error/24352)

<div class="topic-metadata">

**Author:** [@fuji-184](https://internals.rust-lang.org/u/fuji-184)\
**Replies:** 15\
**Last updated:** [May 24, 2026, 6:56am UTC](https://internals.rust-lang.org/t/another-experiment-to-make-unsafe-rust-safer-preventing-ub-in-maybeuninit-with-compile-time-error/24352 "2026-05-24T06:56:51Z")

</div>

Hello, I'm doing this experiment. What do you guys think? :\] use std::mem::MaybeUninit; use std::marker::PhantomData; pub struct Uninit; pub struct Init; pub struct UninitStorage\<T\>(MaybeUninit\<T\>); pub struct InitSt…

---

## [Reducing Raw Pointer Footguns: Preventing Reference Aliasing Violations at Compile Time](https://internals.rust-lang.org/t/reducing-raw-pointer-footguns-preventing-reference-aliasing-violations-at-compile-time/24301)

<div class="topic-metadata">

**Author:** [@fuji-184](https://internals.rust-lang.org/u/fuji-184)\
**Replies:** 41\
**Last updated:** [May 21, 2026, 3:22pm UTC](https://internals.rust-lang.org/t/reducing-raw-pointer-footguns-preventing-reference-aliasing-violations-at-compile-time/24301 "2026-05-21T15:22:33Z")

</div>

Hello, I am currently experimenting with building a tool to make the experience of using raw pointers safer. The primary goal is to provide compile time errors if there is a reference aliasing violation. My tests were su…

---

## [Rustc lexer diagnostics feature request: Color highlight acceptable characters](https://internals.rust-lang.org/t/rustc-lexer-diagnostics-feature-request-color-highlight-acceptable-characters/24227)

<div class="topic-metadata">

**Author:** [@peter-lyons-kehl](https://internals.rust-lang.org/u/peter-lyons-kehl)\
**Replies:** 2\
**Last updated:** [May 11, 2026, 1:52pm UTC](https://internals.rust-lang.org/t/rustc-lexer-diagnostics-feature-request-color-highlight-acceptable-characters/24227 "2026-05-11T13:52:36Z")

</div>

Hi. This applies probably to macro\_rules/macro v.2 only (correct me otherwise). When the lexer/tokenizer reports errors like error: \`$r#trait:ty\` is followed by \`(\`, which is not allowed for \`ty\` fragments --\> src/li…

---

## [More granual \`build.rs\` companion: \`links.rs\`](https://internals.rust-lang.org/t/more-granual-build-rs-companion-links-rs/24176)

<div class="topic-metadata">

**Author:** [@dhm](https://internals.rust-lang.org/u/dhm)\
**Replies:** 6\
**Last updated:** [April 20, 2026, 6:09pm UTC](https://internals.rust-lang.org/t/more-granual-build-rs-companion-links-rs/24176 "2026-04-20T18:09:46Z")

</div>

The problem ▶ Click to fold Palliatives / working around it with the current tools ▶ Click to see The suggested solution Would be for Cargo to fully acknowledge and embrace this package.links with a companion build script (…

[Next page](https://internals.rust-lang.org/c/uncategorized/1.md?page=1)
