Segfault on Rust 1.97.0

solecist1 pts0 comments

segfault on Rust 1.97.0 · Issue #159035 · rust-lang/rust · GitHub

//voltron/issues_fragments/issue_layout" data-turbo-transient="true" />

u32 { mat...">

Skip to content

You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.

Dismiss alert

{{ message }}

Uh oh!

There was an error while loading. Please reload this page.

rust-lang

rust

Public

Uh oh!

There was an error while loading. Please reload this page.

Notifications<br>You must be signed in to change notification settings

Fork<br>15.3k

Star<br>115k

segfault on Rust 1.97.0 #159035

New issue<br>Copy link

New issue<br>Copy link

Open

Open<br>segfault on Rust 1.97.0#159035

Copy link

Labels<br>A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-bugCategory: This is a bug.Category: This is a bug.I-miscompileIssue: Correct Rust code lowers to incorrect machine codeIssue: Correct Rust code lowers to incorrect machine codeO-x86_64Target: x86-64 processors (like x86_64-*) (also known as amd64 and x64)Target: x86-64 processors (like x86_64-*) (also known as amd64 and x64)P-criticalCritical priorityCritical priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.

Description

yonipeleg33<br>opened on Jul 9, 2026

Issue body actions

I tried this code:

u32 {<br>match self {<br>Checksum::X(h) => match h.inner { Inner::A(s) => s, Inner::B(s) => s },<br>Checksum::Y(s) => (u32::from(s.b) ) -> Option {<br>c.map(|c| c.finalize())<br>fn main() { println!("{:?}", run(black_box(None))); }">use std::hint::black_box;<br>enum Inner { A(u32), B(u32) }<br>struct Big { _pad: u64, inner: Inner }<br>struct Small { a: u16, b: u16, _f: fn() }<br>enum Checksum { X(Big), Y(Small) }<br>impl Checksum {<br>fn finalize(self) -> u32 {<br>match self {<br>Checksum::X(h) => match h.inner { Inner::A(s) => s, Inner::B(s) => s },<br>Checksum::Y(s) => (u32::from(s.b) 16) | u32::from(s.a),<br>#[inline(never)]<br>fn run(c: OptionChecksum>) -> Optionu32> {<br>c.map(|c| c.finalize())<br>fn main() { println!("{:?}", run(black_box(None))); }

Command:

rustup run rustc -O minimal.rs -o minimal && ./minimal

With toolchain being either 1.97.0 or 1.96.1.

I expected to see this happen: Exit code 0, None printed

Instead, this happened: [1] 112371 segmentation fault (core dumped) ./minimal

Meta

rustc --version --verbose:

rustc --version --verbose<br>rustc 1.97.0 (2d8144b78 2026-07-07)<br>binary: rustc<br>commit-hash: 2d8144b7880597b6e6d3dfd63a9a9efae3f533d3<br>commit-date: 2026-07-07<br>host: x86_64-unknown-linux-gnu<br>release: 1.97.0<br>LLVM version: 22.1.6

I checked beta (1.98.0) and nightly (1.99.0) - same result

Reactions are currently unavailable

Metadata<br>Metadata<br>Assignees

No one assigned

Labels

A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-bugCategory: This is a bug.Category: This is a bug.I-miscompileIssue: Correct Rust code lowers to incorrect machine codeIssue: Correct Rust code lowers to incorrect machine codeO-x86_64Target: x86-64 processors (like x86_64-*) (also known as amd64 and x64)Target: x86-64 processors (like x86_64-*) (also known as amd64 and x64)P-criticalCritical priorityCritical priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions<br>Open in GitHub Copilot app

You can’t perform that action at this time.

rust code issue from inner correctness

Related Articles