Skip to content

Commit

Permalink
Tidy up the code
Browse files Browse the repository at this point in the history
  • Loading branch information
gavento committed May 2, 2018
1 parent b0fcb5f commit e09d9ec
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/test/ui/rfc1598-generic-associated-types/collections.rs
Expand Up @@ -14,8 +14,9 @@
//FIXME(#44265): "lifetime parameters are not allowed on this type" errors will be addressed in a
//follow-up PR

// A Collection trait and collection families.
// Based on http://smallcultfollowing.com/babysteps/blog/2016/11/03/associated-type-constructors-part-2-family-traits/
// A Collection trait and collection families. Based on
// http://smallcultfollowing.com/babysteps/blog/2016/11/03/
// associated-type-constructors-part-2-family-traits/

trait Collection<T> {
fn empty() -> Self;
Expand All @@ -25,7 +26,8 @@ trait Collection<T> {
type Iter<'iter>: Iterator<Item=&'iter T>;
type Family: CollectionFamily;
// Test associated type defaults with parameters
type Sibling<U>: Collection<U> = <<Self as Collection<T>>::Family as CollectionFamily>::Member<U>;
type Sibling<U>: Collection<U> = <<Self as Collection<T>>::Family as CollectionFamily>::
Member<U>;
//~^ ERROR type parameters are not allowed on this type [E0109]
}

Expand Down Expand Up @@ -82,4 +84,4 @@ fn use_floatify() {
println!("{}", c.iterate().next());
}

fn main() {}
fn main() {}

0 comments on commit e09d9ec

Please sign in to comment.