Skip to content

Commit 86734b0

Browse files
Bless tests
1 parent 7945036 commit 86734b0

6 files changed

+14
-95
lines changed

Diff for: src/test/ui/async-await/async-trait-fn.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
// edition:2018
22
trait T {
33
async fn foo() {} //~ ERROR functions in traits cannot be declared `async`
4-
//~^ ERROR mismatched types
54
async fn bar(&self) {} //~ ERROR functions in traits cannot be declared `async`
6-
//~^ ERROR mismatched types
75
async fn baz() { //~ ERROR functions in traits cannot be declared `async`
8-
//~^ ERROR mismatched types
96
// Nested item must not ICE.
107
fn a() {}
118
}

Diff for: src/test/ui/async-await/async-trait-fn.stderr

+4-52
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ LL | async fn foo() {}
1212
= help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable
1313

1414
error[E0706]: functions in traits cannot be declared `async`
15-
--> $DIR/async-trait-fn.rs:5:5
15+
--> $DIR/async-trait-fn.rs:4:5
1616
|
1717
LL | async fn bar(&self) {}
1818
| -----^^^^^^^^^^^^^^
@@ -25,7 +25,7 @@ LL | async fn bar(&self) {}
2525
= help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable
2626

2727
error[E0706]: functions in traits cannot be declared `async`
28-
--> $DIR/async-trait-fn.rs:7:5
28+
--> $DIR/async-trait-fn.rs:5:5
2929
|
3030
LL | async fn baz() {
3131
| -----^^^^^^^^^
@@ -37,54 +37,6 @@ LL | async fn baz() {
3737
= note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
3838
= help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable
3939

40-
error[E0308]: mismatched types
41-
--> $DIR/async-trait-fn.rs:3:20
42-
|
43-
LL | async fn foo() {}
44-
| ^^ expected associated type, found opaque type
45-
|
46-
::: $SRC_DIR/core/src/future/mod.rs:LL:COL
47-
|
48-
LL | pub const fn from_generator<T>(gen: T) -> impl Future<Output = T::Return>
49-
| ------------------------------- the found opaque type
50-
|
51-
= note: expected associated type `impl Future<Output = ()>` (trait associated opaque type at <$DIR/async-trait-fn.rs:3:20>)
52-
found opaque type `impl Future<Output = ()>` (opaque type at <$SRC_DIR/core/src/future/mod.rs:LL:COL>)
53-
54-
error[E0308]: mismatched types
55-
--> $DIR/async-trait-fn.rs:5:25
56-
|
57-
LL | async fn bar(&self) {}
58-
| ^^ expected associated type, found opaque type
59-
|
60-
::: $SRC_DIR/core/src/future/mod.rs:LL:COL
61-
|
62-
LL | pub const fn from_generator<T>(gen: T) -> impl Future<Output = T::Return>
63-
| ------------------------------- the found opaque type
64-
|
65-
= note: expected associated type `impl Future<Output = ()>` (trait associated opaque type at <$DIR/async-trait-fn.rs:5:25>)
66-
found opaque type `impl Future<Output = ()>` (opaque type at <$SRC_DIR/core/src/future/mod.rs:LL:COL>)
67-
68-
error[E0308]: mismatched types
69-
--> $DIR/async-trait-fn.rs:7:20
70-
|
71-
LL | async fn baz() {
72-
| ____________________^
73-
LL | |
74-
LL | | // Nested item must not ICE.
75-
LL | | fn a() {}
76-
LL | | }
77-
| |_____^ expected associated type, found opaque type
78-
|
79-
::: $SRC_DIR/core/src/future/mod.rs:LL:COL
80-
|
81-
LL | pub const fn from_generator<T>(gen: T) -> impl Future<Output = T::Return>
82-
| ------------------------------- the found opaque type
83-
|
84-
= note: expected associated type `impl Future<Output = ()>` (trait associated opaque type at <$DIR/async-trait-fn.rs:7:20>)
85-
found opaque type `impl Future<Output = ()>` (opaque type at <$SRC_DIR/core/src/future/mod.rs:LL:COL>)
86-
87-
error: aborting due to 6 previous errors
40+
error: aborting due to 3 previous errors
8841

89-
Some errors have detailed explanations: E0308, E0706.
90-
For more information about an error, try `rustc --explain E0308`.
42+
For more information about this error, try `rustc --explain E0706`.

Diff for: src/test/ui/async-await/edition-deny-async-fns-2015.rs

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ impl Foo {
1717
trait Bar {
1818
async fn foo() {} //~ ERROR `async fn` is not permitted in Rust 2015
1919
//~^ ERROR functions in traits cannot be declared `async`
20-
//~| ERROR mismatched types
2120
}
2221

2322
fn main() {

Diff for: src/test/ui/async-await/edition-deny-async-fns-2015.stderr

+6-20
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ LL | async fn foo() {}
5353
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
5454

5555
error[E0670]: `async fn` is not permitted in Rust 2015
56-
--> $DIR/edition-deny-async-fns-2015.rs:37:9
56+
--> $DIR/edition-deny-async-fns-2015.rs:36:9
5757
|
5858
LL | async fn bar() {}
5959
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
@@ -62,7 +62,7 @@ LL | async fn bar() {}
6262
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
6363

6464
error[E0670]: `async fn` is not permitted in Rust 2015
65-
--> $DIR/edition-deny-async-fns-2015.rs:27:9
65+
--> $DIR/edition-deny-async-fns-2015.rs:26:9
6666
|
6767
LL | async fn foo() {}
6868
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
@@ -71,7 +71,7 @@ LL | async fn foo() {}
7171
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
7272

7373
error[E0670]: `async fn` is not permitted in Rust 2015
74-
--> $DIR/edition-deny-async-fns-2015.rs:32:13
74+
--> $DIR/edition-deny-async-fns-2015.rs:31:13
7575
|
7676
LL | async fn bar() {}
7777
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
@@ -92,21 +92,7 @@ LL | async fn foo() {}
9292
= note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
9393
= help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable
9494

95-
error[E0308]: mismatched types
96-
--> $DIR/edition-deny-async-fns-2015.rs:18:20
97-
|
98-
LL | async fn foo() {}
99-
| ^^ expected associated type, found opaque type
100-
|
101-
::: $SRC_DIR/core/src/future/mod.rs:LL:COL
102-
|
103-
LL | pub const fn from_generator<T>(gen: T) -> impl Future<Output = T::Return>
104-
| ------------------------------- the found opaque type
105-
|
106-
= note: expected associated type `impl Future<Output = ()>` (trait associated opaque type at <$DIR/edition-deny-async-fns-2015.rs:18:20>)
107-
found opaque type `impl Future<Output = ()>` (opaque type at <$SRC_DIR/core/src/future/mod.rs:LL:COL>)
108-
109-
error: aborting due to 11 previous errors
95+
error: aborting due to 10 previous errors
11096

111-
Some errors have detailed explanations: E0308, E0670, E0706.
112-
For more information about an error, try `rustc --explain E0308`.
97+
Some errors have detailed explanations: E0670, E0706.
98+
For more information about an error, try `rustc --explain E0670`.

Diff for: src/test/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ impl A {
1212

1313
trait C{async fn new(val: T) {} //~ ERROR `async fn` is not permitted in Rust 2015
1414
//~^ ERROR functions in traits cannot be declared `async`
15-
//~| ERROR mismatched types
1615
//~| ERROR cannot find type `T` in this scope
1716
//~| WARN changes to closure capture in Rust 2021 will affect drop order [rust_2021_incompatible_closure_captures]
1817

Diff for: src/test/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.stderr

+4-18
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: this file contains an unclosed delimiter
2-
--> $DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs:19:53
2+
--> $DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs:18:53
33
|
44
LL | trait C{async fn new(val: T) {}
55
| - unclosed delimiter
@@ -74,20 +74,6 @@ help: add a dummy let to cause `path` to be fully captured
7474
LL | async fn create(path: impl AsRef<std::path::Path>) { let _ = &path;
7575
| ++++++++++++++
7676

77-
error[E0308]: mismatched types
78-
--> $DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs:13:30
79-
|
80-
LL | trait C{async fn new(val: T) {}
81-
| ^^ expected associated type, found opaque type
82-
|
83-
::: $SRC_DIR/core/src/future/mod.rs:LL:COL
84-
|
85-
LL | pub const fn from_generator<T>(gen: T) -> impl Future<Output = T::Return>
86-
| ------------------------------- the found opaque type
87-
|
88-
= note: expected associated type `impl Future<Output = ()>` (trait associated opaque type at <$DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs:13:30>)
89-
found opaque type `impl Future<Output = ()>` (opaque type at <$SRC_DIR/core/src/future/mod.rs:LL:COL>)
90-
9177
warning: changes to closure capture in Rust 2021 will affect drop order
9278
--> $DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs:13:30
9379
|
@@ -103,7 +89,7 @@ help: add a dummy let to cause `val` to be fully captured
10389
LL | trait C{async fn new(val: T) { let _ = &val;}
10490
| +++++++++++++
10591

106-
error: aborting due to 7 previous errors; 2 warnings emitted
92+
error: aborting due to 6 previous errors; 2 warnings emitted
10793

108-
Some errors have detailed explanations: E0308, E0412, E0423, E0670, E0706.
109-
For more information about an error, try `rustc --explain E0308`.
94+
Some errors have detailed explanations: E0412, E0423, E0670, E0706.
95+
For more information about an error, try `rustc --explain E0412`.

0 commit comments

Comments
 (0)