Skip to content

Add a regression test for issue-81712 #82752

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

Merged
merged 1 commit into from
Mar 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions src/test/ui/generic-associated-types/issue-81712-cyclic-traits.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Regression test for #81712.

#![feature(generic_associated_types)]
#![allow(incomplete_features)]

trait A {
type BType: B<AType = Self>;
}

trait B {
type AType: A<BType = Self>;
}
trait C {
type DType<T>: D<T, CType = Self>;
//~^ ERROR: missing generics for associated type `C::DType` [E0107]
}
trait D<T> {
type CType: C<DType = Self>;
}

fn main() {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
error[E0107]: missing generics for associated type `C::DType`
--> $DIR/issue-81712-cyclic-traits.rs:14:10
|
LL | type DType<T>: D<T, CType = Self>;
| ^^^^^ expected 1 type argument
|
note: associated type defined here, with 1 type parameter: `T`
--> $DIR/issue-81712-cyclic-traits.rs:14:10
|
LL | type DType<T>: D<T, CType = Self>;
| ^^^^^ -
help: use angle brackets to add missing type argument
|
LL | type DType<T><T>: D<T, CType = Self>;
| ^^^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0107`.