Skip to content

Trivial bounds check doesn't consider non-global predicates *after* normalization #140309

@compiler-errors

Description

@compiler-errors
trait Hello {}
impl<const N: usize> Hello for [(); N] {}

trait Foo {
    type Assoc;
}

fn foo<const N: usize>()
where
    <u32 as Foo>::Assoc: Hello,
    u32: Foo<Assoc = [(); N]>,
{
}

I expected to see this pass.

Instead, this ICEd.

<u32 as Foo>::Assoc: Hello is considered global, but it is not global.

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.T-typesRelevant to the types 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