Skip to content

Conversation

lcnr
Copy link
Contributor

@lcnr lcnr commented Sep 18, 2025

doesn't fully fix rust-lang/trait-system-refactor-initiative#191 due to remaining issues in rust-lang/trait-system-refactor-initiative#8. Notably, the following still breaks when switching solvers and would rely on actual eager norm to fix

trait Ref<'a, F> {
    type Input;
}

impl<'a, F> Ref<'a, F> for u32 {
    type Input = &'a u32;
}

fn needs_super<F: for<'a> Fn(<u32 as Ref<'a, F>>::Input)>(_: F) {}

fn main() {
    needs_super(|_| {});
}

this currently breaks

trait Trait {
    type Assoc;
}

struct W<T>(T);
impl<T: Trait> Trait for W<T>
where
    u32: Trait<Assoc = T::Assoc>,
{
    type Assoc = T;
}

impl<T> Trait for (T,) {
    type Assoc = T;
}

impl Trait for u32 {
    type Assoc = u32;
}

fn foo<T: Trait>(_: impl FnOnce(T::Assoc)) {}

fn main() {
    foo::<W<_>>(|(field,)| { let _ = field.count_ones(); })
}

r? @BoxyUwU

@rustbot
Copy link
Collaborator

rustbot commented Sep 18, 2025

changes to the core type system

cc @compiler-errors, @lcnr

Some changes occurred to the core trait solver

cc @rust-lang/initiative-trait-system-refactor

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Sep 18, 2025
@lcnr lcnr changed the title strenghten deduce closure sig -Znext-solver slightly strenghten deduce closure sig Sep 18, 2025
@BoxyUwU BoxyUwU added the S-no-work-capacity-tracking Status: Exempted from triagebot work capacity tracking. label Sep 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-no-work-capacity-tracking Status: Exempted from triagebot work capacity tracking. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rejection of self-referential closure signature in new solver due to lack of eager norm
3 participants