Skip to content

ICE: "assertion failed: !deep_decl.is_glob_import()" in chumsky #150976

@graham-hardy

Description

@graham-hardy

Code

Contents of Cargo.toml:

[package]
name = "quack"
version = "0.1.0"
edition = "2024"

[profile.release]
lto = true
panic = "abort"
strip = true

[dependencies]
chumsky = { git = "http://github.com/zesterer/chumsky", features = ["nightly", "memoization", "extension", "pratt", "debug", "unstable", "lexical-numbers", "either", "regex", "serde", "bytes"] }

Contents of /src/main.rs:

use std::{borrow::Cow, io::stdin};

use chumsky::prelude::*;

fn string_parser<'src>()
-> impl Parser<'src, &'src str, Cow<'src, str>, extra::Err<Rich<'src, char>>> {
    let quote = just('"');
    let unescaped_character = none_of("\"\\");
    let basic = unescaped_character
        .repeated()
        .to_slice()
        .padded_by(quote)
        .map(Cow::Borrowed);
    let escaped = {
        let hex_digits = text::digits(16);
        let escape = just('\\');
        let byte = just('x')
            .ignore_then(hex_digits.exactly(2).to_slice())
            .try_map(|src, span| {
                u8::from_str_radix(src, 16)
                    .map(char::from)
                    .map_err(|parse_int_error| Rich::custom(span, parse_int_error))
            });
        let unicode = just('u')
            .ignore_then(
                hex_digits
                    .at_least(1)
                    .to_slice()
                    .delimited_by(just('{'), just('}')),
            )
            .try_map(|src, span| {
                let i = u32::from_str_radix(src, 16)
                    .map_err(|parse_int_error| Rich::custom(span, parse_int_error))?;
                char::from_u32(i).ok_or_else(|| {
                    Rich::custom(span, format!("`{src}` is not a valid Unicode character."))
                })
            });
        let escaped_character = escape.ignore_then(choice((
            one_of("\"\\"),
            just('n').to('\n'),
            just('r').to('\r'),
            unicode,
            byte,
        )));
        unescaped_character
            .or(escaped_character)
            .separated_by(escape.then(text::whitespace().at_least(1)).or_not())
            .allow_leading()
            .allow_trailing()
            .collect()
            .padded_by(quote)
            .map(Cow::Owned)
    };
    let delimited = {
        let delimiter = just('"').then(just("").configure(|cfg, ctx| cfg.seq(*ctx)));
        just('#')
            .repeated()
            .to_slice()
            .delimited_by(just('r'), just('"'))
            .ignore_with_ctx(
                any()
                    .and_is(delimiter.not())
                    .repeated()
                    .to_slice()
                    .then_ignore(delimiter),
            )
            .map(Cow::Borrowed)
    };
    choice((basic, escaped, delimited)).labelled("string")
}

fn main() {
    for input in stdin().lines().fuse().flatten() {
        let result = string_parser().parse(&input);
        for e in result.errors() {
            eprintln!("Error: {e}");
        }
        if let Some(output) = result.output() {
            match output {
                Cow::Borrowed(s) => println!("Zero-copy: {s}"),
                Cow::Owned(s) => println!("Owned: {s}"),
            }
        }
    }
}

Meta

rustc --version --verbose:

rustc 1.94.0-nightly (f57eac1bf 2026-01-10)
binary: rustc
commit-hash: f57eac1bf98cb5d578e3364b64365ec398c137df
commit-date: 2026-01-10
host: x86_64-pc-windows-msvc
release: 1.94.0-nightly
LLVM version: 21.1.8

Error output

thread 'rustc' (46792) panicked at /rustc-dev/f57eac1bf98cb5d578e3364b64365ec398c137df/compiler\rustc_resolve\src\imports.rs:378:13:
assertion failed: !deep_decl.is_glob_import()
Backtrace

   Compiling libm v0.2.15
   Compiling crc32fast v1.5.0
   Compiling simd-adler32 v0.3.8
   Compiling cfg-if v1.0.4
   Compiling log v0.4.29
   Compiling bytemuck v1.24.0
   Compiling shlex v1.3.0
   Compiling find-msvc-tools v0.1.7
   Compiling version_check v0.9.5
   Compiling adler2 v2.0.1
   Compiling static_assertions v1.1.0
   Compiling smallvec v1.15.1
   Compiling arrayvec v0.7.6
   Compiling memchr v2.7.6
   Compiling float-cmp v0.9.0
   Compiling proc-macro2 v1.0.105
   Compiling tinyvec_macros v0.1.1
   Compiling windows_x86_64_msvc v0.52.6
   Compiling unicode-ident v1.0.22
   Compiling quote v1.0.43
   Compiling arrayref v0.3.9
   Compiling lexical-util v0.8.5
   Compiling tinyvec v1.10.0
   Compiling miniz_oxide v0.8.9
   Compiling strict-num v0.1.1
   Compiling fdeflate v0.3.7
   Compiling unicode-bidi-mirroring v0.4.0
   Compiling unicode-script v0.5.8
   Compiling unicode-properties v0.1.4
   Compiling tiny-skia-path v0.11.4
   Compiling kurbo v0.11.3
   Compiling bitflags v2.10.0
   Compiling siphasher v1.0.1
   Compiling memmap2 v0.9.9
   Compiling bitflags v1.3.2
   Compiling slotmap v1.1.1
   Compiling unicode-ccc v0.4.0
   Compiling cc v1.2.52
   Compiling simplecss v0.2.2
   Compiling unicode-vo v0.1.0
   Compiling weezl v0.1.12
   Compiling object v0.32.2
   Compiling serde_core v1.0.228
   Compiling libc v0.2.180
   Compiling byteorder-lite v0.1.0
   Compiling imagesize v0.13.0
   Compiling color_quant v1.1.0
   Compiling unicode-bidi v0.3.18
   Compiling pico-args v0.5.0
   Compiling lexical-parse-integer v0.8.6
   Compiling flate2 v1.1.5
   Compiling lexical-write-integer v0.8.5
   Compiling data-url v0.3.2
   Compiling zune-core v0.4.12
   Compiling roxmltree v0.20.0
   Compiling quick-error v2.0.1
   Compiling base64 v0.22.1
   Compiling svgtypes v0.15.3
   Compiling xmlwriter v0.1.0
   Compiling lexical-write-float v0.8.5
   Compiling zune-jpeg v0.4.21
   Compiling image-webp v0.2.4
   Compiling lexical-parse-float v0.8.5
   Compiling png v0.17.16
   Compiling gif v0.13.3
   Compiling windows-targets v0.52.6
   Compiling rgb v0.8.52
   Compiling serde v1.0.228
   Compiling windows-sys v0.59.0
   Compiling syn v2.0.114
   Compiling regex-syntax v0.7.5
   Compiling allocator-api2 v0.2.21
   Compiling core_maths v0.1.1
   Compiling stacker v0.1.22
   Compiling unicode-width v0.2.2
   Compiling lexical-core v0.8.5
   Compiling foldhash v0.1.5
   Compiling ttf-parser v0.25.1
   Compiling equivalent v1.0.2
   Compiling aho-corasick v1.1.4
   Compiling lexical v6.1.1
   Compiling unicode-segmentation v1.12.0
   Compiling bytes v1.11.0
   Compiling either v1.15.0
   Compiling hashbrown v0.15.5
   Compiling tiny-skia v0.11.4
   Compiling serde_derive v1.0.228
   Compiling regex-automata v0.3.9
   Compiling ar_archive_writer v0.2.0
   Compiling fontdb v0.23.0
   Compiling rustybuzz v0.20.1
   Compiling psm v0.1.28
   Compiling usvg v0.45.1
   Compiling resvg v0.45.1
   Compiling railroad v0.3.3
   Compiling chumsky v0.13.0 (http://github.com/zesterer/chumsky#da922ff3)

thread 'rustc' (57940) panicked at /rustc-dev/f57eac1bf98cb5d578e3364b64365ec398c137df/compiler\rustc_resolve\src\imports.rs:378:13:
assertion failed: !deep_decl.is_glob_import()
stack backtrace:
   0: std::panicking::panic_handler
             at /rustc/f57eac1bf98cb5d578e3364b64365ec398c137df/library\std\src\panicking.rs:689
   1: core::panicking::panic_fmt
             at /rustc/f57eac1bf98cb5d578e3364b64365ec398c137df/library\core\src\panicking.rs:80
   2: core::panicking::panic
             at /rustc/f57eac1bf98cb5d578e3364b64365ec398c137df/library\core\src\panicking.rs:150
   3: core::slice::sort::stable::quicksort::quicksort::<(&str, &pulldown_cmark::parse::LinkDef), <[(&str, &pulldown_cmark::parse::LinkDef)]>::sort_by_key<&str, rustc_resolve::rustdoc::parse_links::{closure#1}>::{closure#0}>
   4: <hashbrown::raw::RawTable<(rustc_span::hygiene::LocalExpnId, ())>>::reserve_rehash::<hashbrown::map::make_hasher<rustc_span::hygiene::LocalExpnId, (), rustc_hash::FxBuildHasher>::{closure#0}>
   5: <hashbrown::raw::RawTable<(rustc_span::hygiene::LocalExpnId, ())>>::reserve_rehash::<hashbrown::map::make_hasher<rustc_span::hygiene::LocalExpnId, (), rustc_hash::FxBuildHasher>::{closure#0}>
   6: <hashbrown::raw::RawTable<(rustc_span::hygiene::LocalExpnId, ())>>::reserve_rehash::<hashbrown::map::make_hasher<rustc_span::hygiene::LocalExpnId, (), rustc_hash::FxBuildHasher>::{closure#0}>
   7: <hashbrown::raw::RawTable<(rustc_span::hygiene::LocalExpnId, ())>>::reserve_rehash::<hashbrown::map::make_hasher<rustc_span::hygiene::LocalExpnId, (), rustc_hash::FxBuildHasher>::{closure#0}>
   8: <hashbrown::raw::RawTable<(rustc_span::hygiene::LocalExpnId, ())>>::reserve_rehash::<hashbrown::map::make_hasher<rustc_span::hygiene::LocalExpnId, (), rustc_hash::FxBuildHasher>::{closure#0}>
   9: <rustc_resolve::Resolver as rustc_expand::base::ResolverExpand>::resolve_imports
  10: <rustc_expand::expand::MacroExpander>::fully_expand_fragment
  11: <rustc_expand::expand::MacroExpander>::expand_crate
  12: rustc_interface::proc_macro_decls::proc_macro_decls_static
  13: rustc_interface::passes::resolver_for_lowering_raw
  14: <rustc_lint::builtin::SpecialModuleName as rustc_lint::passes::EarlyLintPass>::check_crate
  15: rustc_query_impl::profiling_support::alloc_self_profile_query_strings
  16: RINvNtNtCs5P3H3drZr7k_18rustc_query_system5query8plumbing17try_execute_queryINtCsez81biN4khp_16rustc_query_impl13DynamicConfigINtNtB4_6caches11SingleCacheINtNtNtCs35hIyFdTHOr_12rustc_middle5query5erase6ErasedAhj10_EEKb0_KB3t_KB3t_ENtNtB1f_8plumbing9QueryCt
  17: rustc_query_impl::profiling_support::alloc_self_profile_query_strings
  18: <rustc_middle::ty::context::TyCtxt>::resolver_for_lowering
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: please make sure that you have updated to the latest nightly

note: please attach the file at `p:\.cargo\git\checkouts\chumsky-f75fa12f276e2bbf\da922ff\rustc-ice-2026-01-11T18_14_51-55972.txt` to your bug report

note: rustc 1.94.0-nightly (f57eac1bf 2026-01-10) running on x86_64-pc-windows-msvc

note: compiler flags: --crate-type lib -C opt-level=3 -C panic=abort -C linker-plugin-lto -C strip=symbols

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [resolver_for_lowering_raw] getting the resolver for lowering
end of query stack
error: could not compile `chumsky` (lib)

Caused by:
  process didn't exit successfully: `C:\Users\Graham\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\bin\rustc.exe --crate-name chumsky --edition=2021 p:\.cargo\git\checkouts\chumsky-f75fa12f276e2bbf\da922ff\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=119 --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C panic=abort -C linker-plugin-lto --cfg "feature=\"bytes\"" --cfg "feature=\"debug\"" --cfg "feature=\"default\"" --cfg "feature=\"either\"" --cfg "feature=\"extension\"" --cfg "feature=\"lexical\"" --cfg "feature=\"lexical-numbers\"" --cfg "feature=\"memoization\"" --cfg "feature=\"nightly\"" --cfg "feature=\"pratt\"" --cfg "feature=\"regex\"" --cfg "feature=\"serde\"" --cfg "feature=\"stacker\"" --cfg "feature=\"std\"" --cfg "feature=\"unstable\"" --check-cfg cfg(docsrs,test) --check-cfg "cfg(feature, values(\"_test_stable\", \"bytes\", \"debug\", \"default\", \"docsrs\", \"either\", \"extension\", \"lexical\", \"lexical-numbers\", \"memoization\", \"nightly\", \"pratt\", \"regex\", \"serde\", \"stacker\", \"std\", \"unstable\"))" -C metadata=e650041a508fe409 -C extra-filename=-11d91bbee8ee7a3d --out-dir p:\quack\target\release\deps -C strip=symbols -L dependency=p:\quack\target\release\deps --extern bytes=p:\quack\target\release\deps\libbytes-f528da0b3b2470a6.rmeta --extern either=p:\quack\target\release\deps\libeither-f3fc8e52b0dcbc5b.rmeta --extern hashbrown=p:\quack\target\release\deps\libhashbrown-8cd128a582f15986.rmeta --extern lexical=p:\quack\target\release\deps\liblexical-a308c2f3e59e0200.rmeta --extern railroad=p:\quack\target\release\deps\librailroad-d55278a241b4ee3e.rmeta --extern regex_automata=p:\quack\target\release\deps\libregex_automata-074cc1e86c70c31b.rmeta --extern serde=p:\quack\target\release\deps\libserde-e3bda5b9c7c80662.rmeta --extern stacker=p:\quack\target\release\deps\libstacker-f9bfda846abe18a0.rmeta --extern unicode_ident=p:\quack\target\release\deps\libunicode_ident-064c5846efa15a98.rmeta --extern unicode_segmentation=p:\quack\target\release\deps\libunicode_segmentation-e03e86d295490978.rmeta --cap-lints allow -L native=p:\quack\target\release\build\stacker-e6601898b7e8410b\out -L native=p:\quack\target\release\build\psm-387ed9509956ee0e\out -L "native=C:\Program Files\Microsoft Visual Studio\18\Community\VC\Tools\MSVC\14.50.35717\atlmfc\lib\x64" -L "native=C:\Program Files\Microsoft Visual Studio\18\Community\VC\Tools\MSVC\14.50.35717\atlmfc\lib\x64" -L native=p:\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\windows_x86_64_msvc-0.52.6\lib` (exit code: 101)

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions