Skip to content

not normalizing tait parameters before checking if it's a defining usage #49

Closed
rust-lang/rust
#145711

Description

@compiler-errors

This code stops working with lazy-norm:

#![feature(type_alias_impl_trait)]

trait Mirror {
    type Assoc;
}

impl<T> Mirror for T {
    type Assoc = T;
}

type Tait<T> = impl Sized;

// Can't actually put `-> Tait<<T as Mirror>::Assoc>` in the return type,
// since the opaque type collector doesn't normalize either.
fn x<T>() -> Tait<T> {
    let x: Tait<<T as Mirror>::Assoc> = ();
    //~^ But this user type annotation does get normalized before it's
    // unified with `()`.
    ()
}

fn main() {}

We could, perhaps, structurally normalize the opaque params before checking that they're all placeholders...

Activity

  1. added
    A-incompleteincorrectly return `NoSolution`, unsound during coherence
    on Jul 24, 2023
  2. moved this to potentially irrelevant in -Znext-solver=globallyon Jan 29, 2025
  3. added a commit that references this issue on Aug 25, 2025
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

    A-incompleteincorrectly return `NoSolution`, unsound during coherenceA-normalization

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions