Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent "overflow evaluating the requirement" error for adding impl in another crate #77446

Open
weiznich opened this issue Oct 2, 2020 · 4 comments
Labels
A-coherence Area: Coherence A-trait-system Area: Trait system C-bug Category: This is a bug. E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. S-has-bisection Status: a bisection has been found for this issue T-types Relevant to the types team, which will review and decide on the PR/issue.

Comments

@weiznich
Copy link
Contributor

weiznich commented Oct 2, 2020

I tried this code:

(lib.rs)

pub trait SqlType {
    type IsNull;
}

pub trait IntoNullable {
    type Nullable;
}

pub trait IntoNotNullable {
    type NotNullable;
}

pub trait Expression {
    type SqlType: SqlType;
}

pub trait AsExpression<T>
where
    T: SqlType,
{
    type Expression: Expression<SqlType = T>;
}

pub mod is_nullable {
    pub struct NotNull;
    pub struct IsNullable;
}

pub struct Bool;

impl SqlType for Bool {
    type IsNull = is_nullable::NotNull;
}

impl<T> IntoNotNullable for T
where
    T: SqlType<IsNull = is_nullable::NotNull>,
{
    type NotNullable = T;
}

impl<T, ST> AsExpression<ST> for T
where
    ST: SqlType + IntoNotNullable,
    ST::NotNullable: SqlType,
    ExpressionImplHelper<T, ST::IsNull, <T::SqlType as SqlType>::IsNull>: AsExpression<ST>,
    T: Expression,
    T::SqlType: SqlType,
{
    type Expression =
        <ExpressionImplHelper<T, ST::IsNull, <T::SqlType as SqlType>::IsNull> as AsExpression<
            ST,
        >>::Expression;
}

pub struct Bound<T>(std::marker::PhantomData<T>);

impl<T> Expression for Bound<T>
where
    T: SqlType,
{
    type SqlType = T;
}

#[allow(missing_debug_implementations)]
pub struct ExpressionImplHelper<T, IsNullExpr, IsNullAsExpr>(
    pub T,
    pub std::marker::PhantomData<(IsNullExpr, IsNullAsExpr)>,
);

(main.rs)

use a::*;

struct MyType(bool);

impl AsExpression<Bool> for MyType {
    type Expression = Bound<Bool>;
}

struct MyMarkerType;

impl SqlType for MyMarkerType {
    type IsNull = is_nullable::NotNull;
}

impl AsExpression<MyMarkerType> for MyType {
    type Expression = Bound<MyMarkerType>;
}

I expected this code to compile without any issue or a clear error message why I cannot implment that AsExpression there, but instead I got a compilation error:

error[E0275]: overflow evaluating the requirement `a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::Expresa::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, sionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<MyType, _, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>: a::AsExpression<MyMarkerType>`
  |
  = help: consider adding a `#![recursion_limit="256"]` attribute to your crate (`a`)
  = note: required because of the requirements on the impl of `a::AsExpression<MyMarkerType>` for `a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::Expresa::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, sionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<MyType, _, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>`
  = note: required because of the requirements on the impl of `a::AsExpression<MyMarkerType>` for `a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<a::ExpressionImplHelper<MyType, _, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>, a::is_nullable::NotNull, _>`

As an intresting side note: This happens for the following impl:

impl AsExpression<MyMarkerType> for MyType {
    type Expression = Bound<MyMarkerType>;
}

removing it results in a successful compilation.

Meta

rustc --version --verbose: rustc 1.48.0-nightly (fc2daaae6 2020-09-28)

@weiznich weiznich added the C-bug Category: This is a bug. label Oct 2, 2020
@jonas-schievink jonas-schievink added A-trait-system Area: Trait system T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 2, 2020
@fmease fmease added E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example T-types Relevant to the types team, which will review and decide on the PR/issue. E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc and removed T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. labels Feb 11, 2025
@fmease
Copy link
Member

fmease commented Feb 11, 2025

This now compiles successfully. Bisecting…

@fmease
Copy link
Member

fmease commented Feb 11, 2025

Ah, right. #130654 (stabilize -Znext-solver=coherence) fixed this, makes sense. I do wonder though if we need an extra regression test 🤔 I doubt it.

@fmease fmease added E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. S-has-bisection Status: a bisection has been found for this issue A-coherence Area: Coherence and removed E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc labels Feb 11, 2025
@weiznich
Copy link
Contributor Author

@fmease As this is marked with E-needs-mcvc: Isn't the example provided above sufficient?

@compiler-errors
Copy link
Member

It's best if whoever's analyzing this tries to simplify it further. It definitely doesn't look minimal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-coherence Area: Coherence A-trait-system Area: Trait system C-bug Category: This is a bug. E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. S-has-bisection Status: a bisection has been found for this issue T-types Relevant to the types team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants