Skip to content

Commit

Permalink
Split monster tests into smaller ones
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Jul 18, 2018
1 parent 3535159 commit 0f05b4b
Show file tree
Hide file tree
Showing 29 changed files with 456 additions and 331 deletions.
17 changes: 17 additions & 0 deletions src/test/ui/existential_types/declared_but_never_defined.rs
@@ -0,0 +1,17 @@
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.


#![feature(existential_type)]

fn main() {}

// declared but never defined
existential type Bar: std::fmt::Debug; //~ ERROR could not find defining uses
@@ -0,0 +1,8 @@
error: could not find defining uses
--> $DIR/declared_but_never_defined.rs:17:1
|
LL | existential type Bar: std::fmt::Debug; //~ ERROR could not find defining uses
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

23 changes: 23 additions & 0 deletions src/test/ui/existential_types/declared_but_not_defined_in_scope.rs
@@ -0,0 +1,23 @@
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.


#![feature(existential_type)]

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
}

fn bomp() -> boo::Boo {
""
}
@@ -0,0 +1,8 @@
error: could not find defining uses
--> $DIR/declared_but_not_defined_in_scope.rs:18:5
|
LL | pub existential type Boo: ::std::fmt::Debug; //~ ERROR could not find defining uses
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

25 changes: 25 additions & 0 deletions src/test/ui/existential_types/different_defining_uses.rs
@@ -0,0 +1,25 @@
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.


#![feature(existential_type)]

fn main() {}

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

fn foo() -> Foo {
""
}

fn bar() -> Foo { //~ ERROR defining existential type use differs from previous
42i32
}
18 changes: 18 additions & 0 deletions src/test/ui/existential_types/different_defining_uses.stderr
@@ -0,0 +1,18 @@
error: defining existential type use differs from previous
--> $DIR/different_defining_uses.rs:23:1
|
LL | / fn bar() -> Foo { //~ ERROR defining existential type use differs from previous
LL | | 42i32
LL | | }
| |_^
|
note: previous use here
--> $DIR/different_defining_uses.rs:19:1
|
LL | / fn foo() -> Foo {
LL | | ""
LL | | }
| |_^

error: aborting due to previous error

@@ -0,0 +1,29 @@
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.


#![feature(existential_type)]

fn main() {}

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

fn foo() -> Foo {
""
}

fn bar() -> Foo { //~ ERROR defining existential type use differs from previous
panic!()
}

fn boo() -> Foo { //~ ERROR defining existential type use differs from previous
loop {}
}
@@ -0,0 +1,34 @@
error: defining existential type use differs from previous
--> $DIR/different_defining_uses_never_type.rs:23:1
|
LL | / fn bar() -> Foo { //~ ERROR defining existential type use differs from previous
LL | | panic!()
LL | | }
| |_^
|
note: previous use here
--> $DIR/different_defining_uses_never_type.rs:19:1
|
LL | / fn foo() -> Foo {
LL | | ""
LL | | }
| |_^

error: defining existential type use differs from previous
--> $DIR/different_defining_uses_never_type.rs:27:1
|
LL | / fn boo() -> Foo { //~ ERROR defining existential type use differs from previous
LL | | loop {}
LL | | }
| |_^
|
note: previous use here
--> $DIR/different_defining_uses_never_type.rs:19:1
|
LL | / fn foo() -> Foo {
LL | | ""
LL | | }
| |_^

error: aborting due to 2 previous errors

@@ -0,0 +1,54 @@
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// compile-pass

#![feature(existential_type)]

fn main() {}

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

fn foo() -> Foo {
""
}

fn bar(arg: bool) -> Foo {
if arg {
panic!()
} else {
"bar"
}
}

fn boo(arg: bool) -> Foo {
if arg {
loop {}
} else {
"boo"
}
}

fn bar2(arg: bool) -> Foo {
if arg {
"bar2"
} else {
panic!()
}
}

fn boo2(arg: bool) -> Foo {
if arg {
"boo2"
} else {
loop {}
}
}
111 changes: 0 additions & 111 deletions src/test/ui/existential_types/existential_type.nll.stderr

This file was deleted.

0 comments on commit 0f05b4b

Please sign in to comment.