Skip to content

ICE: triggered when initializing an empty ParseSess #138990

@KittyBorgX

Description

@KittyBorgX

Code

#![feature(rustc_private)]

extern crate rustc_session;
extern crate rustc_driver;
fn main() {
    let parse_sess = rustc_session::parse::ParseSess::new(vec![]);
}

Meta

rustc --version --verbose:

rustc 1.87.0-nightly (43f0014ef 2025-03-25)
binary: rustc
commit-hash: 43f0014ef0f242418674f49052ed39b70f73bc1c
commit-date: 2025-03-25
host: aarch64-apple-darwin
release: 1.87.0-nightly
LLVM version: 20.1.1

Error output

thread 'main' panicked at /rust/deps/scoped-tls-1.0.1/src/lib.rs:168:9:
cannot access a scoped thread local variable without calling `set` first
Backtrace

thread 'main' panicked at /rust/deps/scoped-tls-1.0.1/src/lib.rs:168:9:
cannot access a scoped thread local variable without calling `set` first
stack backtrace:
   0: std::panicking::begin_panic
   1: <rustc_session::parse::ParseSess>::with_dcx
   2: <rustc_session::parse::ParseSess>::new
   3: testcrash::main
             at ./src/main.rs:6:22
   4: core::ops::function::FnOnce::call_once
             at /Users/me/.rustup/toolchains/nightly-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/ops/function.rs:250:5

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.requires-internal-featuresThis issue requires the use of internal features.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions