diff --git a/src/test/ui/associated-types/issue-38917.rs b/src/test/ui/associated-types/issue-38917.rs new file mode 100644 index 00000000000..7e898851aa8 --- /dev/null +++ b/src/test/ui/associated-types/issue-38917.rs @@ -0,0 +1,25 @@ +// check-pass + +use std::borrow::Borrow; + +trait TNode: Sized { + type ConcreteElement: TElement; +} + +trait TElement: Sized { + type ConcreteNode: TNode; +} + +trait DomTraversal { + type BorrowElement: Borrow; +} + +#[allow(dead_code)] +fn recalc_style_at() +where + E: TElement, + D: DomTraversal, +{ +} + +fn main() {} diff --git a/src/test/ui/associated-types/issue-40093.rs b/src/test/ui/associated-types/issue-40093.rs new file mode 100644 index 00000000000..fd325ae1008 --- /dev/null +++ b/src/test/ui/associated-types/issue-40093.rs @@ -0,0 +1,14 @@ +// check-pass + +pub trait Test { + type Item; + type Bundle: From; +} + +fn fails() +where + T: Test, +{ +} + +fn main() {} diff --git a/src/test/ui/associated-types/issue-43475.rs b/src/test/ui/associated-types/issue-43475.rs new file mode 100644 index 00000000000..5f177333c93 --- /dev/null +++ b/src/test/ui/associated-types/issue-43475.rs @@ -0,0 +1,10 @@ +// check-pass + +trait Foo { type FooT: Foo; } +impl Foo for () { type FooT = (); } +trait Bar { type BarT: Bar; } +impl Bar<()> for () { type BarT = (); } + +#[allow(dead_code)] +fn test>() { } +fn main() { } diff --git a/src/test/ui/associated-types/issue-63591.rs b/src/test/ui/associated-types/issue-63591.rs new file mode 100644 index 00000000000..4d2e39f4da6 --- /dev/null +++ b/src/test/ui/associated-types/issue-63591.rs @@ -0,0 +1,24 @@ +// check-pass + +#![feature(associated_type_bounds)] +#![feature(type_alias_impl_trait)] + +fn main() {} + +trait Bar { type Assoc; } + +trait Thing { + type Out; + fn func() -> Self::Out; +} + +struct AssocIsCopy; +impl Bar for AssocIsCopy { type Assoc = u8; } + +impl Thing for AssocIsCopy { + type Out = impl Bar; + + fn func() -> Self::Out { + AssocIsCopy + } +}