Closed
Description
This was first observed due to a bunch of chain
calls in rustdoc (#21694). @huonw provided a minimal test case:
struct Pair<A, B>(A, B);
trait Foo: Sized {
type Item = ();
fn foo<B>(self, other: B) -> Pair<Self, B> {
Pair(self, other)
}
}
impl Foo for () {
type Item = ();
}
#[cfg(equality)]
impl<A: Foo, B: Foo<Item = A::Item>> Foo for Pair<A, B> {
type Item = A::Item;
}
#[cfg(not(equality))]
impl<A: Foo, B: Foo> Foo for Pair<A, B> {
type Item = A::Item;
}
fn main() {
().foo(())
.foo(())
.foo(())
.foo(())
.foo(())
.foo(())
.foo(())
.foo(())
.foo(())
;
}
Metadata
Metadata
Assignees
Labels
Area: Associated items (types, constants & functions)Category: An issue proposing an enhancement or a PR with one.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.Issue: Problems and improvements with respect to compile times.Medium priorityRelevant to the compiler team, which will review and decide on the PR/issue.