Skip to content

Commit

Permalink
Minor fromatting for RFC 1598 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gavento committed May 2, 2018
1 parent a43171a commit 9073c89
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
8 changes: 4 additions & 4 deletions src/test/ui/rfc1598-generic-associated-types/collections.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,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]

fn empty() -> Self;
Expand Down Expand Up @@ -63,7 +63,7 @@ impl<T> Collection<T> for Vec<T> {
}

fn floatify<C>(ints: &C) -> <<C as Collection<i32>>::Family as CollectionFamily>::Member<f32>
//~^ ERROR type parameters are not allowed on this type [E0109]
//~^ ERROR type parameters are not allowed on this type [E0109]
where
C: Collection<i32>,
{
Expand All @@ -75,7 +75,7 @@ where
}

fn floatify_sibling<C>(ints: &C) -> <C as Collection<i32>>::Sibling<f32>
//~^ ERROR type parameters are not allowed on this type [E0109]
//~^ ERROR type parameters are not allowed on this type [E0109]
where
C: Collection<i32>,
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ LL | fn floatify_sibling<C>(ints: &C) -> <C as Collection<i32>>::Sibling<f32>
| ^^^ type parameter not allowed

error[E0109]: type parameters are not allowed on this type
--> $DIR/collections.rs:26:16
--> $DIR/collections.rs:26:71
|
LL | Member<U>;
| ^ type parameter not allowed
LL | <<Self as Collection<T>>::Family as CollectionFamily>::Member<U>;
| ^ type parameter not allowed

error[E0110]: lifetime parameters are not allowed on this type
--> $DIR/collections.rs:33:50
Expand Down
6 changes: 2 additions & 4 deletions src/test/ui/rfc1598-generic-associated-types/shadowing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ trait NoShadow<'a> {
type Bar<'b>; // OK
}

impl<'a> NoShadow<'a> for &'a u32
{
impl<'a> NoShadow<'a> for &'a u32 {
type Bar<'a> = i32; // Error: shadowed lifetime
}

Expand All @@ -36,8 +35,7 @@ trait NoShadowT<T> {
type Bar<U>; // OK
}

impl<T> NoShadowT<T> for Option<T>
{
impl<T> NoShadowT<T> for Option<T> {
type Bar<T> = i32; // Error: shadowed type parameter
}

Expand Down

0 comments on commit 9073c89

Please sign in to comment.