Skip to content

[ICE]: DefId::expect_local: DefId(33:83 ~ iroh_io[705b]::AsyncStreamReader::read::L) isn't local #164432

Closed as duplicate

Description

@matheus23

Code

Sorry, I don't have a minimal verifiable example. minimal example in the comment below

We ran across this bug in our CI that uses nightly in the sendme repository, on the tasks that pull latest rustc nightly: n0-computer/sendme#149

Meta

$ rustup toolchain install nightly --target x86_64-unknown-linux-gnu --profile minimal --no-self-update
  info: syncing channel updates for nightly-x86_64-unknown-linux-gnu
  info: latest update on 2026-10-15 for version 1.101.0-nightly (7df81381d 2026-10-14)
  info: downloading 3 components
  
    nightly-x86_64-unknown-linux-gnu installed - rustc 1.101.0-nightly (7df81381d 2026-10-14)

The bug doesn't appear in the stable and beta versions of the compiler.

Error output

DefId::expect_local: `DefId(33:83 ~ iroh_io[705b]::AsyncStreamReader::read::L)` isn't local
Backtrace

thread 'rustc' (23228) panicked at /rustc-dev/7df81381d027710708209f36b98d11b1c88f8d2e/compiler/rustc_hir_analysis/src/check/compare_impl_item.rs:2144:64:
DefId::expect_local: `DefId(33:83 ~ iroh_io[705b]::AsyncStreamReader::read::L)` isn't local
stack backtrace:
   0: __rustc::rust_begin_unwind
   1: core::panicking::panic_fmt
   2: rustc_hir_analysis::check::compare_impl_item::compare_const_generic_param_types
   3: rustc_hir_analysis::check::compare_impl_item::compare_impl_item
      [... omitted 1 frame ...]
   4: rustc_hir_analysis::check::check::check_impl_items_against_trait
   5: rustc_hir_analysis::check::check::check_item_type
   6: rustc_hir_analysis::check::wfcheck::check_well_formed
      [... omitted 1 frame ...]
   7: rustc_hir_analysis::check::wfcheck::check_type_wf
      [... omitted 1 frame ...]
   8: rustc_hir_analysis::check_crate
   9: rustc_interface::passes::analysis
  10: rustc_query_impl::execution::try_execute_query::<rustc_middle::query::caches::SingleCache<rustc_middle::query::erase::ErasedData<[u8; 0]>>, false>
  11: rustc_interface::passes::create_and_enter_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::compiler_entrypoint::{closure#0}::{closure#1}>
  12: rustc_interface::interface::run_compiler::<(), rustc_driver_impl::compiler_entrypoint::{closure#0}>::{closure#2}

Activity

  1. added
    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.
    C-bugCategory: This is a bug.
    on Oct 16, 2026
  2. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Oct 16, 2026
  3. changed the title [-][ICE]: `DefId::expect_local: `DefId(33:83 ~ iroh_io[705b]::AsyncStreamReader::read::L)` isn't local`[/-] [+][ICE]: DefId::expect_local: `DefId(33:83 ~ iroh_io[705b]::AsyncStreamReader::read::L)` isn't local[/+] on Oct 16, 2026
  4. added and removed
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Oct 16, 2026
  5. added
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Oct 16, 2026
  6. matheus23 commented on Oct 16, 2026

    @matheus23
    Author

    I've let an AI produce a minimal example, supposedly:

    AI-generated minimal example

    Minimal reproducer for #164432

    No Cargo dependencies are needed. The trait and its implementation are compiled
    as separate crates.

    dependency.rs:

    pub trait Reader {
        fn read<const N: usize>() -> impl Sized;
    }

    repro.rs:

    pub struct Reader;
    
    impl dependency::Reader for Reader {
        fn read<const N: usize>() -> impl Sized {}
    }

    Reproduce

    rustup toolchain install nightly-2026-10-15 --profile minimal
    rustc +nightly-2026-10-15 --edition=2024 --crate-type=lib dependency.rs
    RUST_BACKTRACE=1 rustc +nightly-2026-10-15 --edition=2024 --crate-type=lib repro.rs \
        --extern dependency=libdependency.rlib

    Verified results

    • nightly-2026-10-15, rustc 1.101.0-nightly (7df81381d 2026-10-14):
      compiler panics (exit status 101).
    • Stable rustc 1.97.1 (8bab26f4f 2026-07-14): compiles successfully.

    The nightly panic matches the original report's location and query:

    compiler/rustc_hir_analysis/src/check/compare_impl_item.rs:2144:64:
    DefId::expect_local: `DefId(20:5 ~ dependency[a703]::Reader::read::N)` isn't local
    

    The query stack starts with compare_impl_item checking read::{anon_assoc#0}.
    Async functions, futures, array types, method receivers, and third-party
    dependencies are not needed.

  7. added
    S-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issue
    on Oct 16, 2026
  8. lqd commented on Oct 16, 2026

    @lqd
    Member

    I'll close this as a duplicate of #164180 whose fix landed on main this morning. Thanks for opening an issue!

  9. removed
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️S-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions