Skip to content

Commit 0f05b4b

Browse files
committed
Split monster tests into smaller ones
1 parent 3535159 commit 0f05b4b

29 files changed

+456
-331
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
12+
#![feature(existential_type)]
13+
14+
fn main() {}
15+
16+
// declared but never defined
17+
existential type Bar: std::fmt::Debug; //~ ERROR could not find defining uses
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: could not find defining uses
2+
--> $DIR/declared_but_never_defined.rs:17:1
3+
|
4+
LL | existential type Bar: std::fmt::Debug; //~ ERROR could not find defining uses
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6+
7+
error: aborting due to previous error
8+
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
12+
#![feature(existential_type)]
13+
14+
fn main() {}
15+
16+
mod boo {
17+
// declared in module but not defined inside of it
18+
pub existential type Boo: ::std::fmt::Debug; //~ ERROR could not find defining uses
19+
}
20+
21+
fn bomp() -> boo::Boo {
22+
""
23+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: could not find defining uses
2+
--> $DIR/declared_but_not_defined_in_scope.rs:18:5
3+
|
4+
LL | pub existential type Boo: ::std::fmt::Debug; //~ ERROR could not find defining uses
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6+
7+
error: aborting due to previous error
8+
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
12+
#![feature(existential_type)]
13+
14+
fn main() {}
15+
16+
// two definitions with different types
17+
existential type Foo: std::fmt::Debug;
18+
19+
fn foo() -> Foo {
20+
""
21+
}
22+
23+
fn bar() -> Foo { //~ ERROR defining existential type use differs from previous
24+
42i32
25+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
error: defining existential type use differs from previous
2+
--> $DIR/different_defining_uses.rs:23:1
3+
|
4+
LL | / fn bar() -> Foo { //~ ERROR defining existential type use differs from previous
5+
LL | | 42i32
6+
LL | | }
7+
| |_^
8+
|
9+
note: previous use here
10+
--> $DIR/different_defining_uses.rs:19:1
11+
|
12+
LL | / fn foo() -> Foo {
13+
LL | | ""
14+
LL | | }
15+
| |_^
16+
17+
error: aborting due to previous error
18+
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
12+
#![feature(existential_type)]
13+
14+
fn main() {}
15+
16+
// two definitions with different types
17+
existential type Foo: std::fmt::Debug;
18+
19+
fn foo() -> Foo {
20+
""
21+
}
22+
23+
fn bar() -> Foo { //~ ERROR defining existential type use differs from previous
24+
panic!()
25+
}
26+
27+
fn boo() -> Foo { //~ ERROR defining existential type use differs from previous
28+
loop {}
29+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
error: defining existential type use differs from previous
2+
--> $DIR/different_defining_uses_never_type.rs:23:1
3+
|
4+
LL | / fn bar() -> Foo { //~ ERROR defining existential type use differs from previous
5+
LL | | panic!()
6+
LL | | }
7+
| |_^
8+
|
9+
note: previous use here
10+
--> $DIR/different_defining_uses_never_type.rs:19:1
11+
|
12+
LL | / fn foo() -> Foo {
13+
LL | | ""
14+
LL | | }
15+
| |_^
16+
17+
error: defining existential type use differs from previous
18+
--> $DIR/different_defining_uses_never_type.rs:27:1
19+
|
20+
LL | / fn boo() -> Foo { //~ ERROR defining existential type use differs from previous
21+
LL | | loop {}
22+
LL | | }
23+
| |_^
24+
|
25+
note: previous use here
26+
--> $DIR/different_defining_uses_never_type.rs:19:1
27+
|
28+
LL | / fn foo() -> Foo {
29+
LL | | ""
30+
LL | | }
31+
| |_^
32+
33+
error: aborting due to 2 previous errors
34+
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// compile-pass
12+
13+
#![feature(existential_type)]
14+
15+
fn main() {}
16+
17+
// two definitions with different types
18+
existential type Foo: std::fmt::Debug;
19+
20+
fn foo() -> Foo {
21+
""
22+
}
23+
24+
fn bar(arg: bool) -> Foo {
25+
if arg {
26+
panic!()
27+
} else {
28+
"bar"
29+
}
30+
}
31+
32+
fn boo(arg: bool) -> Foo {
33+
if arg {
34+
loop {}
35+
} else {
36+
"boo"
37+
}
38+
}
39+
40+
fn bar2(arg: bool) -> Foo {
41+
if arg {
42+
"bar2"
43+
} else {
44+
panic!()
45+
}
46+
}
47+
48+
fn boo2(arg: bool) -> Foo {
49+
if arg {
50+
"boo2"
51+
} else {
52+
loop {}
53+
}
54+
}

src/test/ui/existential_types/existential_type.nll.stderr

Lines changed: 0 additions & 111 deletions
This file was deleted.

0 commit comments

Comments
 (0)