Skip to content

AliasBound + ParamEnv candidate eq modulo regions  #90

Closed
@lcnr

Description

@lcnr

fixed by preferring where-bounds over alias-bounds

pub trait QueryDb<'d>: Sized {
    type DynDb: HasQueryGroup<Self::Group>;

    type Group: QueryGroup;
}

pub trait QueryGroup: Sized {
    type DynDb: HasQueryGroup<Self>;
}

pub trait HasQueryGroup<G>
where
    G: QueryGroup,
{
}

pub trait EqualDynDb<'d, IQ: QueryDb<'d>>: QueryDb<'d> {}

impl<'d, IQ, Q> EqualDynDb<'d, IQ> for Q
where
    Q: QueryDb<'d, DynDb = IQ::DynDb, Group = IQ::Group>,
    Q::DynDb: HasQueryGroup<IQ::Group>,
    IQ: QueryDb<'d>,
{
}

fn main() {}

results in

error[E0283]: type annotations needed: cannot satisfy `Q: EqualDynDb<'d, IQ>`
  --> src/main.rs:28:40
   |
28 | impl<'d, IQ, Q> EqualDynDb<'d, IQ> for Q
   |                                        ^
   |
   = note: cannot satisfy `Q: EqualDynDb<'d, IQ>`
   = help: the trait `EqualDynDb<'_, IQ>` is implemented for `Q`

error: aborting due to 1 previous error

minimized from salsa

feels related to #89 but also affects nightly

Metadata

Metadata

Assignees

No one assigned

    Labels

    blocks-craterBlocks running a crater run for breakage w/ new solver

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions