-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed as duplicate of#138010
Labels
A-attributesArea: Attributes (`#[…]`, `#![…]`)Area: Attributes (`#[…]`, `#![…]`)C-bugCategory: This is a bug.Category: This is a bug.F-where_clause_attrs`#![feature(where_clause_attrs)]``#![feature(where_clause_attrs)]`I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-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.
Description
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
-
ICE ___location:
compiler/rustc_ast_passes/src/ast_validation.rs Line-159
rust/compiler/rustc_ast_passes/src/ast_validation.rs
Lines 150 to 159 in 5795086
fn check_type_alias_where_clause_location( &mut self, ty_alias: &TyAlias, ) -> Result<(), errors::WhereClauseBeforeTypeAlias> { if ty_alias.ty.is_none() || !ty_alias.where_clauses.before.has_where_token { return Ok(()); } let (before_predicates, after_predicates) = ty_alias.generics.where_clause.predicates.split_at(ty_alias.where_clauses.split); -
ICE:
mid > len
on leading assoc ty / lazy type alias where clause with attributes #138010 reports the same ICE, but this one does not require theF-lazy_type_alias
feature.
Metadata
Metadata
Assignees
Labels
A-attributesArea: Attributes (`#[…]`, `#![…]`)Area: Attributes (`#[…]`, `#![…]`)C-bugCategory: This is a bug.Category: This is a bug.F-where_clause_attrs`#![feature(where_clause_attrs)]``#![feature(where_clause_attrs)]`I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-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.