# language design

**URL:** https://internals.rust-lang.org/c/language-design/21.md

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

---

## [About the language design category](https://internals.rust-lang.org/t/about-the-language-design-category/2032)

<div class="topic-metadata">

**Author:** [@nikomatsakis](https://internals.rust-lang.org/u/nikomatsakis)\
**Replies:** 0\
**Last updated:** [May 14, 2015, 2:21pm UTC](https://internals.rust-lang.org/t/about-the-language-design-category/2032 "2015-05-14T14:21:52Z")

</div>

Discussion on designs for new language features and other user-facing language changes. Home of the language design team.

---

## [Could we get guarantee that all pointer-like types have the same representation?](https://internals.rust-lang.org/t/could-we-get-guarantee-that-all-pointer-like-types-have-the-same-representation/24677)

<div class="topic-metadata">

**Author:** [@Kixunil](https://internals.rust-lang.org/u/Kixunil)\
**Replies:** 2\
**Last updated:** [October 14, 2026, 10:38pm UTC](https://internals.rust-lang.org/t/could-we-get-guarantee-that-all-pointer-like-types-have-the-same-representation/24677 "2026-10-14T22:38:44Z")

</div>

I think this code ought to be sound but I couldn't find a good resource to prove so: #\[repr(C)\] pub struct Foo\<B\> { payload: B, version: u8, } impl\<'a\> Borrow\<Foo\<&'a \[u8\]\>\> for Foo\<Box\<\[u8\]\>\> { fn borrow(&s…

---

## [Adding retain\_unsorted or similar](https://internals.rust-lang.org/t/adding-retain-unsorted-or-similar/24591)

<div class="topic-metadata">

**Author:** [@APT37](https://internals.rust-lang.org/u/APT37)\
**Replies:** 11\
**Last updated:** [October 13, 2026, 7:13am UTC](https://internals.rust-lang.org/t/adding-retain-unsorted-or-similar/24591 "2026-10-13T07:13:31Z")

</div>

Just thought it was odd that there was no retain equivalent that uses swap\_remove under the hood. Why not add something like this? fn retain\_unordered\<T, F\>(vec: &mut Vec\<T\>, mut keep: F) where F: FnMut(&T) -\> bool,…

---

## [Add a formatting specifier to limit the max length displayed of collections](https://internals.rust-lang.org/t/add-a-formatting-specifier-to-limit-the-max-length-displayed-of-collections/24661)

<div class="topic-metadata">

**Author:** [@dead-claudia](https://internals.rust-lang.org/u/dead-claudia)\
**Replies:** 5\
**Last updated:** [October 11, 2026, 12:16pm UTC](https://internals.rust-lang.org/t/add-a-formatting-specifier-to-limit-the-max-length-displayed-of-collections/24661 "2026-10-11T12:16:21Z")

</div>

Initially copy/pasted from Add a formatting specifier to limit the max length displayed of collections · Issue #906 · rust-lang/libs-team · GitHub, but with some minor changes. Sometimes, collections get super long, a…

---

## [Pre-RFC: Compile-time conditional branching on trait implementations](https://internals.rust-lang.org/t/pre-rfc-compile-time-conditional-branching-on-trait-implementations/24623)

<div class="topic-metadata">

**Author:** [@amidukr](https://internals.rust-lang.org/u/amidukr)\
**Replies:** 31\
**Last updated:** [October 5, 2026, 7:32am UTC](https://internals.rust-lang.org/t/pre-rfc-compile-time-conditional-branching-on-trait-implementations/24623 "2026-10-05T07:32:17Z")

</div>

Pre-RFC: Compile-time conditional branching on trait implementations I'd like to propose a way for generic Rust code to conditionally compile branches depending on whether a type implements a trait. The idea is superfic…

---

## [Pre-RFC: Cromulent Copy Closure Captures](https://internals.rust-lang.org/t/pre-rfc-cromulent-copy-closure-captures/24627)

<div class="topic-metadata">

**Author:** [@Jules-Bertholet](https://internals.rust-lang.org/u/Jules-Bertholet)\
**Replies:** 13\
**Last updated:** [October 1, 2026, 6:37pm UTC](https://internals.rust-lang.org/t/pre-rfc-cromulent-copy-closure-captures/24627 "2026-10-01T18:37:00Z")

</div>

RFC posted: Cromulent \`Copy\` closure captures by Jules-Bertholet · Pull Request #4011 · rust-lang/rfcs · GitHub Characteristic cognomen: cromulent\_copy\_closure\_captures Calendrical commencement: TBD CCC (Call Concerni…

---

## [Pre-RFC: Anonymous Trait Impls](https://internals.rust-lang.org/t/pre-rfc-anonymous-trait-impls/24648)

<div class="topic-metadata">

**Author:** [@RealRTTV](https://internals.rust-lang.org/u/RealRTTV)\
**Replies:** 8\
**Last updated:** [October 1, 2026, 12:12pm UTC](https://internals.rust-lang.org/t/pre-rfc-anonymous-trait-impls/24648 "2026-10-01T12:12:10Z")

</div>

Hey there, I was just talking briefly in the Rust discord about ideas for an anonymous trait impl concept, here's what we have so far. Sample syntaxes actively in-debate: fn create\_trait(id: u32) -\> impl Trait { re…

---

## [Pre-RFC: Another attempt to re-design the Try trait - Try::Kind and TryAs](https://internals.rust-lang.org/t/pre-rfc-another-attempt-to-re-design-the-try-trait-try-kind-and-tryas/24618)

<div class="topic-metadata">

**Author:** [@camsteffen](https://internals.rust-lang.org/u/camsteffen)\
**Replies:** 6\
**Last updated:** [September 28, 2026, 3:39pm UTC](https://internals.rust-lang.org/t/pre-rfc-another-attempt-to-re-design-the-try-trait-try-kind-and-tryas/24618 "2026-09-28T15:39:25Z")

</div>

This is an attempt to re-design the Try and Residual traits to be simpler while generally maintaining functionality. I call it "fat try" because it stuffs most everything into Try instead of breaking it up into several t…

---

## [New keyword idea](https://internals.rust-lang.org/t/new-keyword-idea/24629)

<div class="topic-metadata">

**Author:** [@cheese\_space](https://internals.rust-lang.org/u/cheese_space)\
**Replies:** 4\
**Last updated:** [September 27, 2026, 6:13pm UTC](https://internals.rust-lang.org/t/new-keyword-idea/24629 "2026-09-27T18:13:30Z")

</div>

(note this is my first new feature proposal feedback WOULD be appreciated) syntax $vis\_quantifier wrapper $new\_type\_name wraps $type\_it\_wraps; purpose makes it easier to make a 'new type'. While this is a more basic ex…

---

## [Does rust abstract file operations incorrectly?](https://internals.rust-lang.org/t/does-rust-abstract-file-operations-incorrectly/24560)

<div class="topic-metadata">

**Author:** [@Hummmmmmmmus](https://internals.rust-lang.org/u/Hummmmmmmmus)\
**Replies:** 80\
**Last updated:** [September 21, 2026, 7:31pm UTC](https://internals.rust-lang.org/t/does-rust-abstract-file-operations-incorrectly/24560 "2026-09-21T19:31:11Z")

</div>

Introduction I recently got into building a wayland client in rust on linux to get a feel for both linux windowing and rust IPC. I ended up getting stuck on step #1 which was to open a unix socket to a wayland compositor…

---

## [Suggestion on implementation of floating-point computations with different rounding mode](https://internals.rust-lang.org/t/suggestion-on-implementation-of-floating-point-computations-with-different-rounding-mode/24594)

<div class="topic-metadata">

**Author:** [@azalea\_99](https://internals.rust-lang.org/u/azalea_99)\
**Replies:** 10\
**Last updated:** [September 15, 2026, 12:42pm UTC](https://internals.rust-lang.org/t/suggestion-on-implementation-of-floating-point-computations-with-different-rounding-mode/24594 "2026-09-15T12:42:43Z")

</div>

Hello everyone! Some FPUs support different rounding mode, so if the floating-point operation yields a value that cannot be represented exactly, it is rounded according to the rounding mode. As far as I understand, the …

---

## [Pre-RFC: global\_generic — crate-level type parameters](https://internals.rust-lang.org/t/pre-rfc-global-generic-crate-level-type-parameters/24589)

<div class="topic-metadata">

**Author:** [@hashim-not-found-404](https://internals.rust-lang.org/u/hashim-not-found-404)\
**Replies:** 9\
**Last updated:** [September 14, 2026, 11:59am UTC](https://internals.rust-lang.org/t/pre-rfc-global-generic-crate-level-type-parameters/24589 "2026-09-14T11:59:44Z")

</div>

Pre-RFC: global\_generic — crate-level type parameters Summary Add a global\_generic declaration that lets a crate expose a type parameter which is bound exactly once, in main.rs, and then used anywhere in the dependency g…

---

## [Safe unions and error types](https://internals.rust-lang.org/t/safe-unions-and-error-types/24597)

<div class="topic-metadata">

**Author:** [@alrz](https://internals.rust-lang.org/u/alrz)\
**Replies:** 1\
**Last updated:** [September 12, 2026, 8:04pm UTC](https://internals.rust-lang.org/t/safe-unions-and-error-types/24597 "2026-09-12T20:04:45Z")

</div>

Currently there's some workarounds to deal with multiple error types other than creating a sum type, like dyn or anyhow. The idea here is to make the compiler generate this sum type and allow transparent construction an…

---

## [\#!\[restrict(unsafe, modules = "platform::win")\] (bikesheddable)](https://internals.rust-lang.org/t/restrict-unsafe-modules-platform-win-bikesheddable/24577)

<div class="topic-metadata">

**Author:** [@MusicalNinjaDad](https://internals.rust-lang.org/u/MusicalNinjaDad)\
**Replies:** 3\
**Last updated:** [September 11, 2026, 7:14am UTC](https://internals.rust-lang.org/t/restrict-unsafe-modules-platform-win-bikesheddable/24577 "2026-09-11T07:14:09Z")

</div>

I've recently found myself creating a library which includes some platform-specific ffi usage as well as some much higher-level functionality, which I'd really rather not split into 2 crates. This means I cannot #!\[forb…

---

## [\[generic\_const\_exprs\] Support for basic field access for structs and tuples](https://internals.rust-lang.org/t/generic-const-exprs-support-for-basic-field-access-for-structs-and-tuples/24584)

<div class="topic-metadata">

**Author:** [@blockmath](https://internals.rust-lang.org/u/blockmath)\
**Replies:** 1\
**Last updated:** [September 9, 2026, 11:17am UTC](https://internals.rust-lang.org/t/generic-const-exprs-support-for-basic-field-access-for-structs-and-tuples/24584 "2026-09-09T11:17:00Z")

</div>

The following situation happens often: I have a wrapper type around a multidimensional array. I want to make the type generic over the specific dimensions. I want to pack all dimensions into one parameter, so that larg…

---

## [Generic statics within generic functions](https://internals.rust-lang.org/t/generic-statics-within-generic-functions/24575)

<div class="topic-metadata">

**Author:** [@jacobrgreen114](https://internals.rust-lang.org/u/jacobrgreen114)\
**Replies:** 20\
**Last updated:** [September 5, 2026, 5:09pm UTC](https://internals.rust-lang.org/t/generic-statics-within-generic-functions/24575 "2026-09-05T17:09:57Z")

</div>

First off, please forgive my ignorance towards the current implementation and limitations of the compiler. The following may or may not be reasonably feasible. I'm not currently advocating for global generic statics as …

---

## [\[Pre-pre-RFC\] "splatting" for named arguments and function overloading](https://internals.rust-lang.org/t/pre-pre-rfc-splatting-for-named-arguments-and-function-overloading/24012)

<div class="topic-metadata">

**Author:** [@Nadrieril](https://internals.rust-lang.org/u/Nadrieril)\
**Replies:** 44\
**Last updated:** [September 2, 2026, 10:10pm UTC](https://internals.rust-lang.org/t/pre-pre-rfc-splatting-for-named-arguments-and-function-overloading/24012 "2026-09-02T22:10:38Z")

</div>

While discussing C++ overloading on Zulip, a bunch of us (re?)discovered a pretty cute idea, which I'm taking the liberty to flesh out here. This RFC comes from the realization that "we have named arguments at home" a…

---

## [Add maximum and minimum and other functions](https://internals.rust-lang.org/t/add-maximum-and-minimum-and-other-functions/24545)

<div class="topic-metadata">

**Author:** [@BennyLi](https://internals.rust-lang.org/u/BennyLi)\
**Replies:** 5\
**Last updated:** [August 29, 2026, 8:33am UTC](https://internals.rust-lang.org/t/add-maximum-and-minimum-and-other-functions/24545 "2026-08-29T08:33:01Z")

</div>

There should be a convenience way to get the maximum of an array or a set. Which would work like this. assert\_eq!(\[1,2,3\].maximum(), 3); assert\_eq!(\[1,2,3\].minimum(), 1);

---

## [SAFETY documentation may be inconsistent with soundness verification specifications](https://internals.rust-lang.org/t/safety-documentation-may-be-inconsistent-with-soundness-verification-specifications/24539)

<div class="topic-metadata">

**Author:** [@Evian-Zhang](https://internals.rust-lang.org/u/Evian-Zhang)\
**Replies:** 80\
**Last updated:** [August 28, 2026, 2:04pm UTC](https://internals.rust-lang.org/t/safety-documentation-may-be-inconsistent-with-soundness-verification-specifications/24539 "2026-08-28T14:04:25Z")

</div>

I recently read about the concept of library-level invariants and language-level invariants. It happens to me that there may be some gaps between the SAFETY requirements and how verification community writes their specif…

---

## [Another approach to the nonzero macro](https://internals.rust-lang.org/t/another-approach-to-the-nonzero-macro/24549)

<div class="topic-metadata">

**Author:** [@TGODiamond](https://internals.rust-lang.org/u/TGODiamond)\
**Replies:** 10\
**Last updated:** [August 27, 2026, 12:55pm UTC](https://internals.rust-lang.org/t/another-approach-to-the-nonzero-macro/24549 "2026-08-27T12:55:47Z")

</div>

Initialization of a nonzero number, where assertion happens at compile time: // Using macro\_rules for performant compilation, tested to work in stable Rust #\[macro\_export\] macro\_rules! nonzero { ($n:expr) =\> { …

---

## [Make beta Unicode versions available in Nightly?](https://internals.rust-lang.org/t/make-beta-unicode-versions-available-in-nightly/24102)

<div class="topic-metadata">

**Author:** [@clin1234](https://internals.rust-lang.org/u/clin1234)\
**Replies:** 7\
**Last updated:** [August 27, 2026, 6:29am UTC](https://internals.rust-lang.org/t/make-beta-unicode-versions-available-in-nightly/24102 "2026-08-27T06:29:17Z")

</div>

Source: Beta Review Status Given that the version's Beta review ends in early July, where the version's character data and other UCD files are released then, would it not be useful to make it available at least on the n…

---

## [The bypass for sandboxing wasm build.rs](https://internals.rust-lang.org/t/the-bypass-for-sandboxing-wasm-build-rs/24552)

<div class="topic-metadata">

**Author:** [@RelunSec](https://internals.rust-lang.org/u/RelunSec)\
**Replies:** 2\
**Last updated:** [August 25, 2026, 5:06pm UTC](https://internals.rust-lang.org/t/the-bypass-for-sandboxing-wasm-build-rs/24552 "2026-08-25T17:06:53Z")

</div>

Hi, i'm RelunSec from InsiteTech.jp to be clear that not fix the issue, sandboxing build.rs and proc macros do not work an attacker can use .cargo/config.toml basically \[target.'cfg(all())'\] runner = "echo 'PWNED'" o…

---

## [Permissive Borrows](https://internals.rust-lang.org/t/permissive-borrows/24542)

<div class="topic-metadata">

**Author:** [@ais523](https://internals.rust-lang.org/u/ais523)\
**Replies:** 21\
**Last updated:** [August 25, 2026, 12:36pm UTC](https://internals.rust-lang.org/t/permissive-borrows/24542 "2026-08-25T12:36:06Z")

</div>

cc @RalfJung, who asked me to write up my thoughts on a new aliasing model I've spent a lot of time recently working on a new aliasing model, which I call Permissive Borrows. This post is meant to introduce the model. …

---

## [\`const fn\` specialization](https://internals.rust-lang.org/t/const-fn-specialization/24488)

<div class="topic-metadata">

**Author:** [@nazar-pc](https://internals.rust-lang.org/u/nazar-pc)\
**Replies:** 11\
**Last updated:** [August 25, 2026, 8:14am UTC](https://internals.rust-lang.org/t/const-fn-specialization/24488 "2026-08-25T08:14:39Z")

</div>

I've been re-reading Tracking Issue for const\_eval\_select · Issue #124625 · rust-lang/rust · GitHub today because I wanted to make a function that currently uses intrinsics const fn. There is Tracking Issue for constify…

---

## [Pre-RFC: Orthogonal Discriminants](https://internals.rust-lang.org/t/pre-rfc-orthogonal-discriminants/24543)

<div class="topic-metadata">

**Author:** [@scottmcm](https://internals.rust-lang.org/u/scottmcm)\
**Replies:** 26\
**Last updated:** [August 25, 2026, 1:10am UTC](https://internals.rust-lang.org/t/pre-rfc-orthogonal-discriminants/24543 "2026-08-25T01:10:32Z")

</div>

Summary Right now the layout algorithm is mixed up with the type of the discriminant. This RFC splits those up better for more flexibilty and new functionality. Motivation Quick! What's the difference between #\[repr(Ru…

---

## [Idea: Shared Mutable References (\`&shr mut T\`)](https://internals.rust-lang.org/t/idea-shared-mutable-references-shr-mut-t/24537)

<div class="topic-metadata">

**Author:** [@frank-king](https://internals.rust-lang.org/u/frank-king)\
**Replies:** 3\
**Last updated:** [August 20, 2026, 6:54am UTC](https://internals.rust-lang.org/t/idea-shared-mutable-references-shr-mut-t/24537 "2026-08-20T06:54:46Z")

</div>

Motivation &T and &mut T literally mean immutable references and mutable references, but more exactly, shared references and exclusive references. &mut T is mutable, also exclusive (assuming that we are not talking about…

---

## [Freezing uninitialized values (freeze loads)](https://internals.rust-lang.org/t/freezing-uninitialized-values-freeze-loads/24495)

<div class="topic-metadata">

**Author:** [@honzasp](https://internals.rust-lang.org/u/honzasp)\
**Replies:** 47\
**Last updated:** [August 19, 2026, 6:15pm UTC](https://internals.rust-lang.org/t/freezing-uninitialized-values-freeze-loads/24495 "2026-08-19T18:15:59Z")

</div>

tl;dr I would like to add the following function to the language and the standard library: // in \`core::ptr\` pub unsafe fn read\_freeze\<T\>(ptr: \*const T) -\> T; This function works like core::ptr::read(), but if the valu…

---

## [Pre-RFC: Consider statically-enabled target-features when deciding if calling #\[target\_feature(enable = "foo")\] requires unsafe](https://internals.rust-lang.org/t/pre-rfc-consider-statically-enabled-target-features-when-deciding-if-calling-target-feature-enable-foo-requires-unsafe/24536)

<div class="topic-metadata">

**Author:** [@hsivonen](https://internals.rust-lang.org/u/hsivonen)\
**Replies:** 4\
**Last updated:** [August 17, 2026, 7:44pm UTC](https://internals.rust-lang.org/t/pre-rfc-consider-statically-enabled-target-features-when-deciding-if-calling-target-feature-enable-foo-requires-unsafe/24536 "2026-08-17T19:44:54Z")

</div>

Summary Currently, calling a function annotated with #\[target\_feature(enable = "foo")\] requires the function making the call also to be annotated with #\[target\_feature(enable = "foo")\] in order for the call not to requir…

---

## [What is source of provenance for locals of async blocks?](https://internals.rust-lang.org/t/what-is-source-of-provenance-for-locals-of-async-blocks/24532)

<div class="topic-metadata">

**Author:** [@ProgramCrafter](https://internals.rust-lang.org/u/ProgramCrafter)\
**Replies:** 9\
**Last updated:** [August 17, 2026, 6:23pm UTC](https://internals.rust-lang.org/t/what-is-source-of-provenance-for-locals-of-async-blocks/24532 "2026-08-17T18:23:22Z")

</div>

I was looking on conditions which allow a reference to escape its block syntactically, as in the example below. // Subscription adds the reference to static BTreeMap\<usize, &'static mut u32\> // new\_event() increments al…

---

## [Idea: Alias as a common abstraction over Share and Reborrow](https://internals.rust-lang.org/t/idea-alias-as-a-common-abstraction-over-share-and-reborrow/24528)

<div class="topic-metadata">

**Author:** [@viktorlott](https://internals.rust-lang.org/u/viktorlott)\
**Replies:** 9\
**Last updated:** [August 17, 2026, 10:25am UTC](https://internals.rust-lang.org/t/idea-alias-as-a-common-abstraction-over-share-and-reborrow/24528 "2026-08-17T10:25:05Z")

</div>

I have been thinking about the relationship between the proposed Reborrow work and the recent Share/cheap-clone ideas. I think there may be a useful common abstraction above them: (Updated full design here) unsafe auto…

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