Skip to content

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

Open
@weiznich

Description

@weiznich

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-coherenceArea: CoherenceA-trait-systemArea: Trait systemC-bugCategory: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.S-has-bisectionStatus: A bisection has been found for this issueT-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