Skip to content

Commit

Permalink
Update syntax in existing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
varkor committed Aug 2, 2019
1 parent 87738fe commit fc48541
Show file tree
Hide file tree
Showing 100 changed files with 343 additions and 328 deletions.
14 changes: 7 additions & 7 deletions src/test/ui/associated-type-bounds/duplicate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// error-pattern:could not find defining uses

#![feature(associated_type_bounds)]
#![feature(existential_type)]
#![feature(type_alias_impl_trait)]
#![feature(impl_trait_in_bindings)]
#![feature(untagged_unions)]

Expand Down Expand Up @@ -107,17 +107,17 @@ type TAW2<T> where T: Iterator<Item: Copy, Item: Copy> = T;
type TAW3<T> where T: Iterator<Item: 'static, Item: 'static> = T;
//~^ the value of the associated type `Item` (from the trait `std::iter::Iterator`) is already specified [E0719]

existential type ETAI1<T: Iterator<Item: Copy, Item: Send>>: Copy;
type ETAI1<T: Iterator<Item: Copy, Item: Send>> = impl Copy;
//~^ the value of the associated type `Item` (from the trait `std::iter::Iterator`) is already specified [E0719]
existential type ETAI2<T: Iterator<Item: Copy, Item: Copy>>: Copy;
type ETAI2<T: Iterator<Item: Copy, Item: Copy>> = impl Copy;
//~^ the value of the associated type `Item` (from the trait `std::iter::Iterator`) is already specified [E0719]
existential type ETAI3<T: Iterator<Item: 'static, Item: 'static>>: Copy;
type ETAI3<T: Iterator<Item: 'static, Item: 'static>> = impl Copy;
//~^ the value of the associated type `Item` (from the trait `std::iter::Iterator`) is already specified [E0719]
existential type ETAI4: Iterator<Item: Copy, Item: Send>;
type ETAI4 = impl Iterator<Item: Copy, Item: Send>;
//~^ the value of the associated type `Item` (from the trait `std::iter::Iterator`) is already specified [E0719]
existential type ETAI5: Iterator<Item: Copy, Item: Copy>;
type ETAI5 = impl Iterator<Item: Copy, Item: Copy>;
//~^ the value of the associated type `Item` (from the trait `std::iter::Iterator`) is already specified [E0719]
existential type ETAI6: Iterator<Item: 'static, Item: 'static>;
type ETAI6 = impl Iterator<Item: 'static, Item: 'static>;
//~^ the value of the associated type `Item` (from the trait `std::iter::Iterator`) is already specified [E0719]

trait TRI1<T: Iterator<Item: Copy, Item: Send>> {}
Expand Down
84 changes: 42 additions & 42 deletions src/test/ui/associated-type-bounds/duplicate.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -369,86 +369,86 @@ LL | type TAW3<T> where T: Iterator<Item: 'static, Item: 'static> = T;
error: could not find defining uses
--> $DIR/duplicate.rs:110:1
|
LL | existential type ETAI1<T: Iterator<Item: Copy, Item: Send>>: Copy;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | type ETAI1<T: Iterator<Item: Copy, Item: Send>> = impl Copy;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0719]: the value of the associated type `Item` (from the trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:110:48
--> $DIR/duplicate.rs:110:36
|
LL | existential type ETAI1<T: Iterator<Item: Copy, Item: Send>>: Copy;
| ---------- ^^^^^^^^^^ re-bound here
| |
| `Item` bound here first
LL | type ETAI1<T: Iterator<Item: Copy, Item: Send>> = impl Copy;
| ---------- ^^^^^^^^^^ re-bound here
| |
| `Item` bound here first

error: could not find defining uses
--> $DIR/duplicate.rs:112:1
|
LL | existential type ETAI2<T: Iterator<Item: Copy, Item: Copy>>: Copy;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | type ETAI2<T: Iterator<Item: Copy, Item: Copy>> = impl Copy;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0719]: the value of the associated type `Item` (from the trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:112:48
--> $DIR/duplicate.rs:112:36
|
LL | existential type ETAI2<T: Iterator<Item: Copy, Item: Copy>>: Copy;
| ---------- ^^^^^^^^^^ re-bound here
| |
| `Item` bound here first
LL | type ETAI2<T: Iterator<Item: Copy, Item: Copy>> = impl Copy;
| ---------- ^^^^^^^^^^ re-bound here
| |
| `Item` bound here first

error: could not find defining uses
--> $DIR/duplicate.rs:114:1
|
LL | existential type ETAI3<T: Iterator<Item: 'static, Item: 'static>>: Copy;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | type ETAI3<T: Iterator<Item: 'static, Item: 'static>> = impl Copy;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0719]: the value of the associated type `Item` (from the trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:114:51
--> $DIR/duplicate.rs:114:39
|
LL | existential type ETAI3<T: Iterator<Item: 'static, Item: 'static>>: Copy;
| ------------- ^^^^^^^^^^^^^ re-bound here
| |
| `Item` bound here first
LL | type ETAI3<T: Iterator<Item: 'static, Item: 'static>> = impl Copy;
| ------------- ^^^^^^^^^^^^^ re-bound here
| |
| `Item` bound here first

error: could not find defining uses
--> $DIR/duplicate.rs:116:1
|
LL | existential type ETAI4: Iterator<Item: Copy, Item: Send>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | type ETAI4 = impl Iterator<Item: Copy, Item: Send>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0719]: the value of the associated type `Item` (from the trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:116:46
--> $DIR/duplicate.rs:116:40
|
LL | existential type ETAI4: Iterator<Item: Copy, Item: Send>;
| ---------- ^^^^^^^^^^ re-bound here
| |
| `Item` bound here first
LL | type ETAI4 = impl Iterator<Item: Copy, Item: Send>;
| ---------- ^^^^^^^^^^ re-bound here
| |
| `Item` bound here first

error: could not find defining uses
--> $DIR/duplicate.rs:118:1
|
LL | existential type ETAI5: Iterator<Item: Copy, Item: Copy>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | type ETAI5 = impl Iterator<Item: Copy, Item: Copy>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0719]: the value of the associated type `Item` (from the trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:118:46
--> $DIR/duplicate.rs:118:40
|
LL | existential type ETAI5: Iterator<Item: Copy, Item: Copy>;
| ---------- ^^^^^^^^^^ re-bound here
| |
| `Item` bound here first
LL | type ETAI5 = impl Iterator<Item: Copy, Item: Copy>;
| ---------- ^^^^^^^^^^ re-bound here
| |
| `Item` bound here first

error: could not find defining uses
--> $DIR/duplicate.rs:120:1
|
LL | existential type ETAI6: Iterator<Item: 'static, Item: 'static>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | type ETAI6 = impl Iterator<Item: 'static, Item: 'static>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0719]: the value of the associated type `Item` (from the trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:120:49
--> $DIR/duplicate.rs:120:43
|
LL | existential type ETAI6: Iterator<Item: 'static, Item: 'static>;
| ------------- ^^^^^^^^^^^^^ re-bound here
| |
| `Item` bound here first
LL | type ETAI6 = impl Iterator<Item: 'static, Item: 'static>;
| ------------- ^^^^^^^^^^^^^ re-bound here
| |
| `Item` bound here first

error[E0719]: the value of the associated type `Item` (from the trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:123:36
Expand Down
1 change: 0 additions & 1 deletion src/test/ui/associated-type-bounds/dyn-existential-type.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// run-pass

#![feature(associated_type_bounds)]
#![feature(existential_type)]

use std::ops::Add;

Expand Down
10 changes: 5 additions & 5 deletions src/test/ui/associated-type-bounds/existential-type.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// run-pass

#![feature(associated_type_bounds)]
#![feature(existential_type)]
#![feature(type_alias_impl_trait)]

use std::ops::Add;

Expand All @@ -17,15 +17,15 @@ struct S1;
struct S2;
impl Tr1 for S1 { type As1 = S2; fn mk(self) -> Self::As1 { S2 } }

existential type Et1: Tr1<As1: Copy>;
type Et1 = impl Tr1<As1: Copy>;
fn def_et1() -> Et1 { S1 }
pub fn use_et1() { assert_copy(def_et1().mk()); }

existential type Et2: Tr1<As1: 'static>;
type Et2 = impl Tr1<As1: 'static>;
fn def_et2() -> Et2 { S1 }
pub fn use_et2() { assert_static(def_et2().mk()); }

existential type Et3: Tr1<As1: Clone + Iterator<Item: Add<u8, Output: Into<u8>>>>;
type Et3 = impl Tr1<As1: Clone + Iterator<Item: Add<u8, Output: Into<u8>>>>;
fn def_et3() -> Et3 {
struct A;
impl Tr1 for A {
Expand All @@ -44,7 +44,7 @@ pub fn use_et3() {
assert_eq!(s, (0..10).map(|x| x + 1).sum());
}

existential type Et4: Tr1<As1: for<'a> Tr2<'a>>;
type Et4 = impl Tr1<As1: for<'a> Tr2<'a>>;
fn def_et4() -> Et4 {
#[derive(Copy, Clone)]
struct A;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
// build-pass (FIXME(62277): could be check-pass?)
// edition:2018

#![feature(async_await, existential_type)]
#![feature(async_await)]
#![feature(type_alias_impl_trait)]

use std::future::Future;

pub existential type Func: Sized;
pub type Func = impl Sized;

// Late bound region should be allowed to escape the function, since it's bound
// in the type.
Expand All @@ -17,7 +18,7 @@ fn null_function_ptr() -> Func {

async fn async_nop(_: &u8) {}

pub existential type ServeFut: Future<Output=()>;
pub type ServeFut = impl Future<Output=()>;

// Late bound regions occur in the generator witness type here.
fn serve() -> ServeFut {
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/existential_types/auxiliary/cross_crate_ice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

#![crate_type="rlib"]

#![feature(existential_type)]
#![feature(type_alias_impl_trait)]

pub existential type Foo: std::fmt::Debug;
pub type Foo = impl std::fmt::Debug;

pub fn foo() -> Foo {
5
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/existential_types/auxiliary/cross_crate_ice2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#![crate_type="rlib"]

#![feature(existential_type)]
#![feature(type_alias_impl_trait)]

pub trait View {
type Tmp: Iterator<Item = u32>;
Expand All @@ -13,7 +13,7 @@ pub trait View {
pub struct X;

impl View for X {
existential type Tmp: Iterator<Item = u32>;
type Tmp = impl Iterator<Item = u32>;

fn test(&self) -> Self::Tmp {
vec![1,2,3].into_iter()
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/existential_types/bound_reduction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

#![allow(warnings)]

#![feature(existential_type)]
#![feature(type_alias_impl_trait)]

fn main() {
}

existential type Foo<V>: std::fmt::Debug;
type Foo<V> = impl std::fmt::Debug;

trait Trait<U> {}

Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/existential_types/bound_reduction2.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![feature(existential_type)]
#![feature(type_alias_impl_trait)]

fn main() {
}
Expand All @@ -7,7 +7,7 @@ trait TraitWithAssoc {
type Assoc;
}

existential type Foo<V>: Trait<V>;
type Foo<V> = impl Trait<V>;
//~^ ERROR could not find defining uses

trait Trait<U> {}
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/existential_types/bound_reduction2.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ LL | | }
error: could not find defining uses
--> $DIR/bound_reduction2.rs:10:1
|
LL | existential type Foo<V>: Trait<V>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | type Foo<V> = impl Trait<V>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 2 previous errors

4 changes: 2 additions & 2 deletions src/test/ui/existential_types/declared_but_never_defined.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#![feature(existential_type)]
#![feature(type_alias_impl_trait)]

fn main() {}

// declared but never defined
existential type Bar: std::fmt::Debug; //~ ERROR could not find defining uses
type Bar = impl std::fmt::Debug; //~ ERROR could not find defining uses
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error: could not find defining uses
--> $DIR/declared_but_never_defined.rs:6:1
|
LL | existential type Bar: std::fmt::Debug;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | type Bar = impl std::fmt::Debug;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#![feature(existential_type)]
#![feature(type_alias_impl_trait)]

fn main() {}

mod boo {
// declared in module but not defined inside of it
pub existential type Boo: ::std::fmt::Debug; //~ ERROR could not find defining uses
pub type Boo = impl ::std::fmt::Debug; //~ ERROR could not find defining uses
}

fn bomp() -> boo::Boo {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error: could not find defining uses
--> $DIR/declared_but_not_defined_in_scope.rs:7:5
|
LL | pub existential type Boo: ::std::fmt::Debug;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | pub type Boo = impl ::std::fmt::Debug;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

4 changes: 2 additions & 2 deletions src/test/ui/existential_types/different_defining_uses.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#![feature(existential_type)]
#![feature(type_alias_impl_trait)]

fn main() {}

// two definitions with different types
existential type Foo: std::fmt::Debug;
type Foo = impl std::fmt::Debug;

fn foo() -> Foo {
""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#![feature(existential_type)]
#![feature(type_alias_impl_trait)]

fn main() {}

// two definitions with different types
existential type Foo: std::fmt::Debug;
type Foo = impl std::fmt::Debug;

fn foo() -> Foo {
""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// build-pass (FIXME(62277): could be check-pass?)

#![feature(existential_type)]
#![feature(type_alias_impl_trait)]

fn main() {}

// two definitions with different types
existential type Foo: std::fmt::Debug;
type Foo = impl std::fmt::Debug;

fn foo() -> Foo {
""
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/existential_types/existential-associated-type.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![feature(existential_type)]
#![feature(type_alias_impl_trait)]
// build-pass (FIXME(62277): could be check-pass?)

trait Bar {}
Expand All @@ -11,7 +11,7 @@ trait Foo {
fn bar() -> Self::Assoc;
}

existential type Helper: Bar;
type Helper = impl Bar;

impl Foo for i32 {
type Assoc = Helper;
Expand Down
Loading

0 comments on commit fc48541

Please sign in to comment.