Skip to content

ICE: mid > len #144048

@cushionbadak

Description

@cushionbadak

Code

(hand reduced)

trait a {
    type F<T>
    where
        #[cfg(b)]
        T: TraitB,
    = T;
}

It's a mutant of glacier2/fixed/133597-3.rs (in fuzzer's perspective), though the most parts are from tests/ui/where-clauses/cfg_attribute.rs

Meta

rustc --version --verbose:

rustc 1.90.0-nightly (5795086bd 2025-07-16)
binary: rustc
commit-hash: 5795086bdfe7ed988aa53a110bd0692c33d8755b
commit-date: 2025-07-16
host: x86_64-apple-darwin
release: 1.90.0-nightly
LLVM version: 20.1.8

Error output

command: rustc

thread 'rustc' panicked at compiler/rustc_ast_passes/src/ast_validation.rs:159:55:
mid > len
Backtrace

thread 'rustc' panicked at compiler/rustc_ast_passes/src/ast_validation.rs:159:55:
mid > len
stack backtrace:
   0: __rustc::rust_begin_unwind
   1: core::panicking::panic_fmt
   2: <rustc_ast_passes::ast_validation::AstValidator>::check_type_alias_where_clause_location
   3: <rustc_ast_passes::ast_validation::AstValidator as rustc_ast::visit::Visitor>::visit_assoc_item
   4: <rustc_ast_passes::ast_validation::AstValidator as rustc_ast::visit::Visitor>::visit_item
   5: rustc_interface::passes::configure_and_expand
   6: rustc_interface::passes::resolver_for_lowering_raw
      [... omitted 2 frames ...]
   7: rustc_interface::passes::create_and_enter_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>
   8: rustc_interface::interface::run_compiler::<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}
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 `/Volumes/T7/workspace/scratch_250716/rustc-ice-2025-07-17T04_41_50-27301.txt` to your bug report

query stack during panic:
#0 [resolver_for_lowering_raw] getting the resolver for lowering
end of query stack

Notes

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-attributesArea: Attributes (`#[…]`, `#![…]`)C-bugCategory: This is a bug.F-where_clause_attrs`#![feature(where_clause_attrs)]`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.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions