# compiler

**URL:** https://internals.rust-lang.org/c/compiler/20.md

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

---

## [About the compiler category](https://internals.rust-lang.org/t/about-the-compiler-category/2031)

<div class="topic-metadata">

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

</div>

Discussion about the compiler itself -- internal data structures and algorithms, optimizations, parsing, and so on. Home of the compiler subteam.

---

## [Interpreted MIR for faster dev cycle?](https://internals.rust-lang.org/t/interpreted-mir-for-faster-dev-cycle/24620)

<div class="topic-metadata">

**Author:** [@Ddystopia](https://internals.rust-lang.org/u/Ddystopia)\
**Replies:** 8\
**Last updated:** [September 27, 2026, 4:08pm UTC](https://internals.rust-lang.org/t/interpreted-mir-for-faster-dev-cycle/24620 "2026-09-27T16:08:45Z")

</div>

Main bottlenecks for fast iteration speed are the backend (cranelift/llvm) and linking. I wonder if there can be a compilation mode where all Rust dependencies are compiled down to MIR, maybe with some optimizations, and…

---

## [Patched rustc to fix why editing one generic method recompiles all 200 instantiations](https://internals.rust-lang.org/t/patched-rustc-to-fix-why-editing-one-generic-method-recompiles-all-200-instantiations/24595)

<div class="topic-metadata">

**Author:** [@Trigodil](https://internals.rust-lang.org/u/Trigodil)\
**Replies:** 16\
**Last updated:** [September 14, 2026, 3:36pm UTC](https://internals.rust-lang.org/t/patched-rustc-to-fix-why-editing-one-generic-method-recompiles-all-200-instantiations/24595 "2026-09-14T15:36:56Z")

</div>

So I was getting annoyed by slow incremental builds and ended up digging into rustc\_monomorphize::partitioning in the compiler . Found something interesting - every monomorphization of a generic function gets pooled into…

---

## [In Which Code The Parsing Of Function Happen In Rustc?](https://internals.rust-lang.org/t/in-which-code-the-parsing-of-function-happen-in-rustc/24576)

<div class="topic-metadata">

**Author:** [@fuji-184](https://internals.rust-lang.org/u/fuji-184)\
**Replies:** 9\
**Last updated:** [September 5, 2026, 9:25pm UTC](https://internals.rust-lang.org/t/in-which-code-the-parsing-of-function-happen-in-rustc/24576 "2026-09-05T21:25:10Z")

</div>

Hello, I'm trying to experiment Rust with semicolon inference. For now, it can handle this, except the handling of call function that has return value at the last code of function that does not has return type isn't inse…

---

## [Error Message Thoughts](https://internals.rust-lang.org/t/error-message-thoughts/24457)

<div class="topic-metadata">

**Author:** [@Dwarsloeper](https://internals.rust-lang.org/u/Dwarsloeper)\
**Replies:** 19\
**Last updated:** [July 13, 2026, 9:42am UTC](https://internals.rust-lang.org/t/error-message-thoughts/24457 "2026-07-13T09:42:35Z")

</div>

Colour Scheme I find dark blue a specially hard to read choice. If there’s an option to switch to a better contrasting colour, it is well hidden. If such an option is not planned, all output colours should have medium br…

---

## [\#\[do\_not\_recommend\] for traits themselves](https://internals.rust-lang.org/t/do-not-recommend-for-traits-themselves/24431)

<div class="topic-metadata">

**Author:** [@alice](https://internals.rust-lang.org/u/alice)\
**Replies:** 5\
**Last updated:** [July 8, 2026, 5:19am UTC](https://internals.rust-lang.org/t/do-not-recommend-for-traits-themselves/24431 "2026-07-08T05:19:05Z")

</div>

Currently you can only use #\[do\_not\_recommend\] with trait impls: #\[diagnostic::do\_not\_recommend\] impl Trait for i32 {} and this will not work: #\[diagnostic::do\_not\_recommend\] //~^WARN \`#\[diagnostic::do\_not\_recommend\]\`…

---

## [Support renames with \`link(name = "...", kind = "raw-dylib")\`](https://internals.rust-lang.org/t/support-renames-with-link-name-kind-raw-dylib/24415)

<div class="topic-metadata">

**Author:** [@davidhewitt](https://internals.rust-lang.org/u/davidhewitt)\
**Replies:** 10\
**Last updated:** [July 4, 2026, 6:56am UTC](https://internals.rust-lang.org/t/support-renames-with-link-name-kind-raw-dylib/24415 "2026-07-04T06:56:53Z")

</div>

The latest PyO3 version shipped changes to our windows builds to use the raw-dylib feature. I'm experiencing a fairly significant pain point with raw-dylib - it can't be "renamed" because raw-dylib isn't an accepted kin…

---

## [Pliron: MLIR, But Native Rust](https://internals.rust-lang.org/t/pliron-mlir-but-native-rust/22563)

<div class="topic-metadata">

**Author:** [@Sam\_S](https://internals.rust-lang.org/u/Sam_S)\
**Replies:** 7\
**Last updated:** [June 9, 2026, 9:44am UTC](https://internals.rust-lang.org/t/pliron-mlir-but-native-rust/22563 "2026-06-09T09:44:31Z")

</div>

Saw a reddit post on this but can't find anymore... This project's pretty cool, it's basically an IR (Intermediate Representation) framework for compilers, but instead of being a wrapper around MLIR or something like Me…

---

## [\[Pre-RFC\] Flow-Directed Monomorphization Collection in MIR](https://internals.rust-lang.org/t/pre-rfc-flow-directed-monomorphization-collection-in-mir/24366)

<div class="topic-metadata">

**Author:** [@naganohara-yoshino](https://internals.rust-lang.org/u/naganohara-yoshino)\
**Replies:** 2\
**Last updated:** [June 2, 2026, 4:38pm UTC](https://internals.rust-lang.org/t/pre-rfc-flow-directed-monomorphization-collection-in-mir/24366 "2026-06-02T16:38:59Z")

</div>

Summary This RFC proposes a MIR-level analysis for flow-directed monomorphization, based on The Simple Essence of Monomorphization. The paper formulates monomorphization as a type-flow problem: collect constraints τ ⊑ α,…

---

## [Wasm32: Rust should not spill v128 function params into shadow stack](https://internals.rust-lang.org/t/wasm32-rust-should-not-spill-v128-function-params-into-shadow-stack/24344)

<div class="topic-metadata">

**Author:** [@AngelicosPhosphoros](https://internals.rust-lang.org/u/AngelicosPhosphoros)\
**Replies:** 5\
**Last updated:** [May 31, 2026, 10:23am UTC](https://internals.rust-lang.org/t/wasm32-rust-should-not-spill-v128-function-params-into-shadow-stack/24344 "2026-05-31T10:23:41Z")

</div>

Rust has support for v128 type from WebAssembly spec. It is represented in Rust by core::arch::wasm32::v128 type. Web Assembly treats it as primitive type and you can pass and return it by value, e.g. (func $add7\_to\_v12…

---

## [Warning users when lacking a Clone impl due to imperfect derive](https://internals.rust-lang.org/t/warning-users-when-lacking-a-clone-impl-due-to-imperfect-derive/23635)

<div class="topic-metadata">

**Author:** [@OptimisticPeach](https://internals.rust-lang.org/u/OptimisticPeach)\
**Replies:** 3\
**Last updated:** [May 29, 2026, 4:36pm UTC](https://internals.rust-lang.org/t/warning-users-when-lacking-a-clone-impl-due-to-imperfect-derive/23635 "2026-05-29T16:36:29Z")

</div>

It's well known that the following: #\[derive(Clone)\] struct Foo\<T\>(PhantomData\<T\>); Yields: impl\<T: Clone\> Clone for Foo\<T\> { /\* \*/ } Instead of impl\<T\> Clone for Foo\<T\> where PhantomData\<T\>: Clone { /\* \*/ } And th…

---

## [Where the beta compiler(maybe stage0?) come from?](https://internals.rust-lang.org/t/where-the-beta-compiler-maybe-stage0-come-from/24304)

<div class="topic-metadata">

**Author:** [@curtainp](https://internals.rust-lang.org/u/curtainp)\
**Replies:** 2\
**Last updated:** [May 15, 2026, 11:08am UTC](https://internals.rust-lang.org/t/where-the-beta-compiler-maybe-stage0-come-from/24304 "2026-05-15T11:08:49Z")

</div>

Hello everyone, I'm new here, when I follow the rustc guide to setup my local environment and notice there's a beta compiler which called stage0 compiler, I'm curious about where it come from, I discover that there is a…

---

## [Type inference failure when accessing a value before its type is resolved](https://internals.rust-lang.org/t/type-inference-failure-when-accessing-a-value-before-its-type-is-resolved/24232)

<div class="topic-metadata">

**Author:** [@rxdiscovery](https://internals.rust-lang.org/u/rxdiscovery)\
**Replies:** 8\
**Last updated:** [May 10, 2026, 2:36pm UTC](https://internals.rust-lang.org/t/type-inference-failure-when-accessing-a-value-before-its-type-is-resolved/24232 "2026-05-10T14:36:45Z")

</div>

Hello, I noticed that the compiler / Rust Analyzer behaves unexpectedly. Type inference fails if a value is accessed before the point where its type is ultimately inferred, as if the inference context is lost. I will p…

---

## [Mutation/Creation of HIR](https://internals.rust-lang.org/t/mutation-creation-of-hir/24214)

<div class="topic-metadata">

**Author:** [@dlangusr](https://internals.rust-lang.org/u/dlangusr)\
**Replies:** 10\
**Last updated:** [May 5, 2026, 5:03pm UTC](https://internals.rust-lang.org/t/mutation-creation-of-hir/24214 "2026-05-05T17:03:01Z")

</div>

I was looking into the compiler API for rustc\_drivers and I saw that there exists a MutVisitor trait one can implement to mutate different language items/expressions when working with the AST. This trait also exits for t…

---

## [Regression 1.94.0](https://internals.rust-lang.org/t/regression-1-94-0/24185)

<div class="topic-metadata">

**Author:** [@Sagebati](https://internals.rust-lang.org/u/Sagebati)\
**Replies:** 3\
**Last updated:** [April 21, 2026, 8:37am UTC](https://internals.rust-lang.org/t/regression-1-94-0/24185 "2026-04-21T08:37:47Z")

</div>

Hi, Our project stopped compiling after updating to 1.94.0 with an \[E0275\] that wasn't there before. I couldn't find an existing issue on the rust-lang repo. I've run cargo-bisect-rustc — is this worth opening as a rust…

---

## [Code bloat caused by lack of nounwind attr on \`drop\_in\_place\`](https://internals.rust-lang.org/t/code-bloat-caused-by-lack-of-nounwind-attr-on-drop-in-place/24173)

<div class="topic-metadata">

**Author:** [@kornel](https://internals.rust-lang.org/u/kornel)\
**Replies:** 7\
**Last updated:** [April 16, 2026, 2:33pm UTC](https://internals.rust-lang.org/t/code-bloat-caused-by-lack-of-nounwind-attr-on-drop-in-place/24173 "2026-04-16T14:33:33Z")

</div>

As far as I can tell, rustc doesn't mark functions as NoUnwind/NEVER\_UNWIND, apart from a handful of broad generalizations like panic=abort or extern "not \*-unwind". I saw some scan of function bodies for coroutines, but…

---

## [Lshaz: possible useful tool for development?](https://internals.rust-lang.org/t/lshaz-possible-useful-tool-for-development/24108)

<div class="topic-metadata">

**Author:** [@clin1234](https://internals.rust-lang.org/u/clin1234)\
**Replies:** 0\
**Last updated:** [March 24, 2026, 12:25am UTC](https://internals.rust-lang.org/t/lshaz-possible-useful-tool-for-development/24108 "2026-03-24T00:25:34Z")

</div>

I’ve come across this tool: GitHub - abokhalill/lshaz: Find the microarchitectural performance bugs hiding in your C++ code · GitHub It claims to detect latency hazards at compile-time: struct layouts that span cache li…

---

## [Idea: adding Zmij for faster float-to-string parsing?](https://internals.rust-lang.org/t/idea-adding-zmij-for-faster-float-to-string-parsing/24106)

<div class="topic-metadata">

**Author:** [@clin1234](https://internals.rust-lang.org/u/clin1234)\
**Replies:** 3\
**Last updated:** [March 22, 2026, 10:19pm UTC](https://internals.rust-lang.org/t/idea-adding-zmij-for-faster-float-to-string-parsing/24106 "2026-03-22T22:19:32Z")

</div>

From these two sites: vitaut/zmij: A double-to-string conversion algorithm based on Schubfach and yy in C and C++ and dtolnay/zmij: Fast floating point to string conversion in pure Rust, they claim to be the fastest floa…

---

## [Could borrow checking with origins unblock sound specialization](https://internals.rust-lang.org/t/could-borrow-checking-with-origins-unblock-sound-specialization/24079)

<div class="topic-metadata">

**Author:** [@Serhii](https://internals.rust-lang.org/u/Serhii)\
**Replies:** 7\
**Last updated:** [March 16, 2026, 2:21pm UTC](https://internals.rust-lang.org/t/could-borrow-checking-with-origins-unblock-sound-specialization/24079 "2026-03-16T14:21:39Z")

</div>

A while ago I posted a question about whether Niko's borrow checking without lifetimes could help with specialization soundness. After some pondering, I believe the origins model could lead to a sound specialization impl…

---

## [Bounds checking optimizations](https://internals.rust-lang.org/t/bounds-checking-optimizations/24021)

<div class="topic-metadata">

**Author:** [@fmayer](https://internals.rust-lang.org/u/fmayer)\
**Replies:** 10\
**Last updated:** [February 18, 2026, 7:22am UTC](https://internals.rust-lang.org/t/bounds-checking-optimizations/24021 "2026-02-18T07:22:19Z")

</div>

Hey! I have been working on optimizing bound checks for C++ in LLVM (especially -fsanitize=array-bounds) and have been checking whether some of my work translates to Rust as well. Some time ago I did an optimization in…

---

## [New target triple for wasm builtins?](https://internals.rust-lang.org/t/new-target-triple-for-wasm-builtins/24009)

<div class="topic-metadata">

**Author:** [@ottoville](https://internals.rust-lang.org/u/ottoville)\
**Replies:** 6\
**Last updated:** [February 15, 2026, 8:12am UTC](https://internals.rust-lang.org/t/new-target-triple-for-wasm-builtins/24009 "2026-02-15T08:12:39Z")

</div>

Should rust have a new target triple for wasm builtins? Until now wasm targets have not been able to have any assumption of runtime host, that’s why wasm32-unknown-unknown target exists which does not make any assumptio…

---

## [Async/await optimizations could make language even more powerful](https://internals.rust-lang.org/t/async-await-optimizations-could-make-language-even-more-powerful/23973)

<div class="topic-metadata">

**Author:** [@gmarcosb](https://internals.rust-lang.org/u/gmarcosb)\
**Replies:** 4\
**Last updated:** [February 6, 2026, 7:28am UTC](https://internals.rust-lang.org/t/async-await-optimizations-could-make-language-even-more-powerful/23973 "2026-02-06T07:28:31Z")

</div>

I realize rust has many benefits with borrow checker, but I hope it's clear that the true power rust brings is async/await As you probably know, the way this is done in C++ is terrible (usually with hacky callbacks) - I…

---

## [repr(C) AIX Struct Alignment](https://internals.rust-lang.org/t/repr-c-aix-struct-alignment/21594)

<div class="topic-metadata">

**Author:** [@mustartt](https://internals.rust-lang.org/u/mustartt)\
**Replies:** 63\
**Last updated:** [January 28, 2026, 3:41pm UTC](https://internals.rust-lang.org/t/repr-c-aix-struct-alignment/21594 "2026-01-28T15:41:05Z")

</div>

On PowerPC AIX, there are special layout alignment rules for structs not represented by the repr(C) attribute in Rust. Specifically, the layout of the following struct is misaligned: #\[repr(C)\] #\[derive(Copy, Clone)\] pu…

---

## [Extend LateLintPass by \`check\_trait\_item\_post\`](https://internals.rust-lang.org/t/extend-latelintpass-by-check-trait-item-post/23961)

<div class="topic-metadata">

**Author:** [@mrdgo](https://internals.rust-lang.org/u/mrdgo)\
**Replies:** 0\
**Last updated:** [January 28, 2026, 12:45pm UTC](https://internals.rust-lang.org/t/extend-latelintpass-by-check-trait-item-post/23961 "2026-01-28T12:45:24Z")

</div>

I really don't know what categories to pick, so I'm happy to change them. I am working on a source-to-source compiler for rust. There are check\_item/check\_item\_post and check\_impl\_item/check\_impl\_item\_post pairs. But fo…

---

## [Make all rustc lints part of at least one group](https://internals.rust-lang.org/t/make-all-rustc-lints-part-of-at-least-one-group/23951)

<div class="topic-metadata">

**Author:** [@philomathic\_life](https://internals.rust-lang.org/u/philomathic_life)\
**Replies:** 15\
**Last updated:** [January 27, 2026, 1:54am UTC](https://internals.rust-lang.org/t/make-all-rustc-lints-part-of-at-least-one-group/23951 "2026-01-27T01:54:17Z")

</div>

Clippy adds every lint to at least one group which makes it easy to blanket allow/deny/expect/forbid/warn lints and override lints as you see fit. I realize this can be problematic, so Clippy has the warn-by-default blan…

---

## [Allow impossible values of slice length to be used as enum discriminant](https://internals.rust-lang.org/t/allow-impossible-values-of-slice-length-to-be-used-as-enum-discriminant/23933)

<div class="topic-metadata">

**Author:** [@Ruttie](https://internals.rust-lang.org/u/Ruttie)\
**Replies:** 3\
**Last updated:** [January 17, 2026, 10:52pm UTC](https://internals.rust-lang.org/t/allow-impossible-values-of-slice-length-to-be-used-as-enum-discriminant/23933 "2026-01-17T22:52:10Z")

</div>

For non-ZST slices, the length of the slice is required to be \<= isize::MAX. Currently, enums containing slices like: enum Example\<'a\> { Variant1(&'a \[u8\]), Variant2, Variant3 } Have a size of 24 bytes. G…

---

## [Bridging the Gap Between Rust's Theoretical IR Advantages and Real-World Performance](https://internals.rust-lang.org/t/bridging-the-gap-between-rusts-theoretical-ir-advantages-and-real-world-performance/23927)

<div class="topic-metadata">

**Author:** [@gaowujie2004](https://internals.rust-lang.org/u/gaowujie2004)\
**Replies:** 6\
**Last updated:** [January 16, 2026, 5:43pm UTC](https://internals.rust-lang.org/t/bridging-the-gap-between-rusts-theoretical-ir-advantages-and-real-world-performance/23927 "2026-01-16T17:43:55Z")

</div>

Bridging the Gap Between Rust's Theoretical IR Advantages and Real-World Performance Hi everyone, I’ve been diving deep into the LLVM IR generated by rustc and comparing it with the output from Clang for equivalent C/C+…

---

## [Naming GPU things in the Rust Compiler and Standard Library](https://internals.rust-lang.org/t/naming-gpu-things-in-the-rust-compiler-and-standard-library/23833)

<div class="topic-metadata">

**Author:** [@Flakebi](https://internals.rust-lang.org/u/Flakebi)\
**Replies:** 18\
**Last updated:** [January 4, 2026, 11:34am UTC](https://internals.rust-lang.org/t/naming-gpu-things-in-the-rust-compiler-and-standard-library/23833 "2026-01-04T11:34:09Z")

</div>

As compiling Rust for GPU targets is progressing, we’re more often hitting the problem that we want a name that describes a GPU feature in a concise and clear way. There are a couple of existing APIs for GPUs that are u…

---

## [Sum of 1..=n optimization](https://internals.rust-lang.org/t/sum-of-1-n-optimization/23851)

<div class="topic-metadata">

**Author:** [@RedDocMD](https://internals.rust-lang.org/u/RedDocMD)\
**Replies:** 5\
**Last updated:** [December 26, 2025, 6:21pm UTC](https://internals.rust-lang.org/t/sum-of-1-n-optimization/23851 "2025-12-26T18:21:03Z")

</div>

Following Matt's last AoC video I decided to check out if the same optimization worked in Rust, namely the sum of the first N natural numbers being reduced to the formula N \* (N + 1) / 1. And it does! Here's the Godbol…

---

## [\[Pre-RFC\] Emit Retags in Codegen](https://internals.rust-lang.org/t/pre-rfc-emit-retags-in-codegen/23706)

<div class="topic-metadata">

**Author:** [@icmccorm](https://internals.rust-lang.org/u/icmccorm)\
**Replies:** 7\
**Last updated:** [December 16, 2025, 8:20am UTC](https://internals.rust-lang.org/t/pre-rfc-emit-retags-in-codegen/23706 "2025-12-16T08:20:32Z")

</div>

I'm working on BorrowSanitizer: an LLVM based instrumentation tool for finding Rust-specific undefined behavior in multilanguage applications. Our tool depends on changes to the compiler, which we eventually want to have…

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