Skip to content

ICE: unexpected non-Self predicate when computing SelfOnly implied bounds` recursive const trait #133526

Closed
@matthiaskrgr

Description

@matthiaskrgr

auto-reduced (treereduce-rust):

#[const_trait]
trait Trait {
    type Assoc: const Trait;
}

original:

#![feature(const_trait_impl)]

#[const_trait]
trait Trait {
    type Assoc: const Trait;
    fn func() -> i32;
}

const fn unqualified<T: ~const Trait>() -> i32 {
    T::Assoc::func()
}

const fn qualified<T: ~const Trait>() -> i32 {
    <T as Trait>::Assoc::func()
}

fn main() {}

Version information

rustc 1.85.0-dev
binary: rustc
commit-hash: unknown
commit-date: unknown
host: x86_64-unknown-linux-gnu
release: 1.85.0-dev
LLVM version: 19.1.4

Possibly related line of code:

ty::ClauseKind::RegionOutlives(_)
| ty::ClauseKind::ConstArgHasType(_, _)
| ty::ClauseKind::WellFormed(_)
| ty::ClauseKind::ConstEvaluatable(_)
| ty::ClauseKind::HostEffect(..) => {
bug!(
"unexpected non-`Self` predicate when computing \
`{filter:?}` implied bounds: {clause:?}"
);
}
}
}

@rustbot label +F-const_trait_impl

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.F-const_trait_impl`#![feature(const_trait_impl)]`I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️PG-const-traitsProject group: Const traitsS-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.requires-debug-assertionsThis issue requires a build of rustc or tooling with debug-assertions in some way

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions