Skip to content

Commit ac25a09

Browse files
bors[bot]taiki-e
andauthored
Merge #20
20: Fix ui test failure r=taiki-e a=taiki-e Co-authored-by: Taiki Endo <[email protected]>
2 parents 10cf035 + a98b702 commit ac25a09

4 files changed

+85
-170
lines changed

tests/ui/bad-item-type.stderr

Lines changed: 43 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
error[E0308]: mismatched types
2-
--> $DIR/bad-item-type.rs:15:11
3-
|
4-
15 | yield val; //~ ERROR mismatched types
5-
| ^^^
6-
| |
7-
| expected enum `std::option::Option`, found integer
8-
| help: try using a variant of the expected type: `Some(val)`
9-
|
10-
= note: expected type `std::option::Option<_>`
11-
found type `{integer}`
2+
--> $DIR/bad-item-type.rs:15:11
3+
|
4+
15| yield val; //~ ERROR mismatched types
5+
| ^^^
6+
| |
7+
| expected enum `std::option::Option`, found integer
8+
| help: try using a variant of the expected type: `Some(val)`
9+
|
10+
= note: expected type `std::option::Option<_>`
11+
found type `{integer}`
1212

1313
error[E0698]: type inside generator must be known in this context
1414
--> $DIR/bad-item-type.rs:9:9
@@ -23,47 +23,47 @@ note: the type is part of the generator because of this `yield`
2323
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2424

2525
error[E0698]: type inside generator must be known in this context
26-
--> $DIR/bad-item-type.rs:14:9
27-
|
28-
14 | let val = val.unwrap();
29-
| ^^^ cannot infer type for `{integer}`
30-
|
26+
--> $DIR/bad-item-type.rs:14:9
27+
|
28+
14| let val = val.unwrap();
29+
| ^^^ cannot infer type for `{integer}`
30+
|
3131
note: the type is part of the generator because of this `yield`
32-
--> $DIR/bad-item-type.rs:7:1
33-
|
34-
7 | #[async_stream(item = Option<i32>)]
35-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
32+
--> $DIR/bad-item-type.rs:7:1
33+
|
34+
7 | #[async_stream(item = Option<i32>)]
35+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3636

3737
error[E0698]: type inside generator must be known in this context
38-
--> $DIR/bad-item-type.rs:15:11
39-
|
40-
15 | yield val; //~ ERROR mismatched types
41-
| ^^^ cannot infer type for `{integer}`
42-
|
38+
--> $DIR/bad-item-type.rs:15:11
39+
|
40+
15| yield val; //~ ERROR mismatched types
41+
| ^^^ cannot infer type for `{integer}`
42+
|
4343
note: the type is part of the generator because of this `yield`
44-
--> $DIR/bad-item-type.rs:7:1
45-
|
46-
7 | #[async_stream(item = Option<i32>)]
47-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
44+
--> $DIR/bad-item-type.rs:7:1
45+
|
46+
7 | #[async_stream(item = Option<i32>)]
47+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4848

4949
error[E0308]: mismatched types
50-
--> $DIR/bad-item-type.rs:23:11
51-
|
52-
23 | yield (1, 2) //~ ERROR mismatched types
53-
| ^^^^^^ expected integer, found tuple
54-
|
55-
= note: expected type `{integer}`
56-
found type `({integer}, {integer})`
50+
--> $DIR/bad-item-type.rs:23:11
51+
|
52+
23| yield (1, 2) //~ ERROR mismatched types
53+
| ^^^^^^ expected integer, found tuple
54+
|
55+
= note: expected type `{integer}`
56+
found type `({integer}, {integer})`
5757

5858
error[E0271]: type mismatch resolving `<impl futures_core::stream::Stream as futures_core::stream::Stream>::Item == (i32, i32)`
59-
--> $DIR/bad-item-type.rs:18:23
60-
|
61-
18 | #[async_stream(item = (i32, i32))]
62-
| ^^^^^^^^^^ expected integer, found tuple
63-
|
64-
= note: expected type `{integer}`
65-
found type `(i32, i32)`
66-
= note: the return type of a function must have a statically known size
59+
--> $DIR/bad-item-type.rs:18:23
60+
|
61+
18| #[async_stream(item = (i32, i32))]
62+
| ^^^^^^^^^^ expected integer, found tuple
63+
|
64+
= note: expected type `{integer}`
65+
found type `(i32, i32)`
66+
= note: the return type of a function must have a statically known size
6767

6868
error[E0698]: type inside generator must be known in this context
6969
--> $DIR/bad-item-type.rs:18:1
@@ -124,6 +124,3 @@ note: the type is part of the generator because of this `yield`
124124
|
125125
18 | #[async_stream(item = (i32, i32))]
126126
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
127-
128-
Some errors have detailed explanations: E0271, E0308, E0698.
129-
For more information about an error, try `rustc --explain E0271`.

tests/ui/forget-semicolon.stderr

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
error[E0308]: mismatched types
2-
--> $DIR/forget-semicolon.rs:10:5
3-
|
4-
10 | Some(()) //~ ERROR mismatched types
5-
| ^^^^^^^^- help: try adding a semicolon: `;`
6-
| |
7-
| expected (), found enum `std::option::Option`
8-
|
9-
= note: expected type `()`
10-
found type `std::option::Option<()>`
11-
12-
For more information about this error, try `rustc --explain E0308`.
2+
--> $DIR/forget-semicolon.rs:10:5
3+
|
4+
10| Some(()) //~ ERROR mismatched types
5+
| ^^^^^^^^- help: try adding a semicolon: `;`
6+
| |
7+
| expected (), found enum `std::option::Option`
8+
|
9+
= note: expected type `()`
10+
found type `std::option::Option<()>`
Lines changed: 22 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
2-
--> $DIR/question-mark-await-type-error.rs:16:9
3-
|
4-
16 | async {}.await?; //~ ERROR the `?` operator can only be applied to values that implement `std::ops::Try`
5-
| ^^^^^^^^^^^^^^^ the `?` operator cannot be applied to type `()`
6-
|
7-
= help: the trait `std::ops::Try` is not implemented for `()`
8-
= note: required by `std::ops::Try::into_result`
2+
--> $DIR/question-mark-await-type-error.rs:16:9
3+
|
4+
16| async {}.await?; //~ ERROR the `?` operator can only be applied to values that implement `std::ops::Try`
5+
| ^^^^^^^^^^^^^^^ the `?` operator cannot be applied to type `()`
6+
|
7+
= help: the trait `std::ops::Try` is not implemented for `()`
8+
= note: required by `std::ops::Try::into_result`
99

1010
error[E0698]: type inside `async` object must be known in this context
1111
--> $DIR/question-mark-await-type-error.rs:15:15
@@ -43,18 +43,6 @@ note: the type is part of the `async` object because of this `await`
4343
16 | async {}.await?; //~ ERROR the `?` operator can only be applied to values that implement `std::ops::Try`
4444
| ^^^^^^^^^^^^^^
4545

46-
error[E0698]: type inside `async` object must be known in this context
47-
--> $DIR/question-mark-await-type-error.rs:15:15
48-
|
49-
15 | for _i in 1..2 {
50-
| ^^^^ cannot infer type for `{integer}`
51-
|
52-
note: the type is part of the `async` object because of this `await`
53-
--> $DIR/question-mark-await-type-error.rs:16:9
54-
|
55-
16 | async {}.await?; //~ ERROR the `?` operator can only be applied to values that implement `std::ops::Try`
56-
| ^^^^^^^^^^^^^^
57-
5846
error[E0698]: type inside `async` object must be known in this context
5947
--> $DIR/question-mark-await-type-error.rs:15:9
6048
|
@@ -68,91 +56,25 @@ note: the type is part of the `async` object because of this `await`
6856
| ^^^^^^^^^^^^^^
6957

7058
error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
71-
--> $DIR/question-mark-await-type-error.rs:29:5
72-
|
73-
29 | #[for_await]
74-
| ^^^^^^^^^^^^ the `?` operator cannot be applied to type `()`
75-
|
76-
= help: the trait `std::ops::Try` is not implemented for `()`
77-
= note: required by `std::ops::Try::into_result`
59+
--> $DIR/question-mark-await-type-error.rs:29:5
60+
|
61+
29| #[for_await]
62+
| ^^^^^^^^^^^^ the `?` operator cannot be applied to type `()`
63+
|
64+
= help: the trait `std::ops::Try` is not implemented for `()`
65+
= note: required by `std::ops::Try::into_result`
7866

79-
error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
80-
--> $DIR/question-mark-await-type-error.rs:23:18
81-
|
82-
23 | async {}.await?; //~ ERROR the `?` operator can only be applied to values that implement `std::ops::Try`
83-
| ^^^^^^ the `?` operator cannot be applied to type `()`
84-
|
85-
= help: the trait `std::ops::Try` is not implemented for `()`
86-
= note: required by `std::ops::Try::into_result`
67+
error: internal compiler error: src/librustc/ich/impls_ty.rs:100: StableHasher: unexpected region '_#4r
8768

88-
error[E0698]: type inside generator must be known in this context
89-
--> $DIR/question-mark-await-type-error.rs:22:15
90-
|
91-
22 | for _i in 1..2 {
92-
| ^^^^ cannot infer type for `{integer}`
93-
|
94-
note: the type is part of the generator because of this `yield`
95-
--> $DIR/question-mark-await-type-error.rs:23:18
96-
|
97-
23 | async {}.await?; //~ ERROR the `?` operator can only be applied to values that implement `std::ops::Try`
98-
| ^^^^^
69+
thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:912:9
70+
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
9971

100-
error[E0698]: type inside generator must be known in this context
101-
--> $DIR/question-mark-await-type-error.rs:22:15
102-
|
103-
22 | for _i in 1..2 {
104-
| ^ cannot infer type for `{integer}`
105-
|
106-
note: the type is part of the generator because of this `yield`
107-
--> $DIR/question-mark-await-type-error.rs:23:18
108-
|
109-
23 | async {}.await?; //~ ERROR the `?` operator can only be applied to values that implement `std::ops::Try`
110-
| ^^^^^
111-
112-
error[E0698]: type inside generator must be known in this context
113-
--> $DIR/question-mark-await-type-error.rs:22:18
114-
|
115-
22 | for _i in 1..2 {
116-
| ^ cannot infer type for `{integer}`
117-
|
118-
note: the type is part of the generator because of this `yield`
119-
--> $DIR/question-mark-await-type-error.rs:23:18
120-
|
121-
23 | async {}.await?; //~ ERROR the `?` operator can only be applied to values that implement `std::ops::Try`
122-
| ^^^^^
72+
note: the compiler unexpectedly panicked. this is a bug.
12373

124-
error[E0698]: type inside generator must be known in this context
125-
--> $DIR/question-mark-await-type-error.rs:22:15
126-
|
127-
22 | for _i in 1..2 {
128-
| ^^^^ cannot infer type for `{integer}`
129-
|
130-
note: the type is part of the generator because of this `yield`
131-
--> $DIR/question-mark-await-type-error.rs:23:18
132-
|
133-
23 | async {}.await?; //~ ERROR the `?` operator can only be applied to values that implement `std::ops::Try`
134-
| ^^^^^
74+
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
13575

136-
error[E0698]: type inside generator must be known in this context
137-
--> $DIR/question-mark-await-type-error.rs:22:9
138-
|
139-
22 | for _i in 1..2 {
140-
| ^^ cannot infer type for `{integer}`
141-
|
142-
note: the type is part of the generator because of this `yield`
143-
--> $DIR/question-mark-await-type-error.rs:23:18
144-
|
145-
23 | async {}.await?; //~ ERROR the `?` operator can only be applied to values that implement `std::ops::Try`
146-
| ^^^^^
76+
note: rustc 1.40.0-nightly (702b45e40 2019-10-01) running on x86_64-apple-darwin
14777

148-
error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
149-
--> $DIR/question-mark-await-type-error.rs:42:18
150-
|
151-
42 | async {}.await?;
152-
| ^^^^^^ the `?` operator cannot be applied to type `()`
153-
|
154-
= help: the trait `std::ops::Try` is not implemented for `()`
155-
= note: required by `std::ops::Try::into_result`
78+
note: compiler flags: -C debuginfo=2 -C incremental --crate-type bin
15679

157-
Some errors have detailed explanations: E0277, E0698.
158-
For more information about an error, try `rustc --explain E0277`.
80+
note: some of the compiler flags provided by cargo are hidden

tests/ui/threads-sendsync.stderr

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
error[E0277]: `dyn futures_core::stream::Stream<Item = i32>` cannot be sent between threads safely
2-
--> $DIR/threads-sendsync.rs:29:17
3-
|
4-
7 | fn assert_send<T: Send>(_: T) {}
5-
| ----------- ---- required by this bound in `assert_send`
2+
--> $DIR/threads-sendsync.rs:29:17
3+
|
4+
7 | fn assert_send<T: Send>(_: T) {}
5+
| ----------- ---- required by this bound in `assert_send`
66
...
7-
29 | assert_send(boxed_local()); //~ ERROR `dyn futures_core::stream::Stream<Item = i32>` cannot be sent between threads safely
8-
| ^^^^^^^^^^^^^ `dyn futures_core::stream::Stream<Item = i32>` cannot be sent between threads safely
9-
|
10-
= help: the trait `std::marker::Send` is not implemented for `dyn futures_core::stream::Stream<Item = i32>`
11-
= note: required because of the requirements on the impl of `std::marker::Send` for `std::ptr::Unique<dyn futures_core::stream::Stream<Item = i32>>`
12-
= note: required because it appears within the type `std::boxed::Box<dyn futures_core::stream::Stream<Item = i32>>`
13-
= note: required because it appears within the type `std::pin::Pin<std::boxed::Box<dyn futures_core::stream::Stream<Item = i32>>>`
14-
15-
For more information about this error, try `rustc --explain E0277`.
7+
29| assert_send(boxed_local()); //~ ERROR `dyn futures_core::stream::Stream<Item = i32>` cannot be sent between threads safely
8+
| ^^^^^^^^^^^^^ `dyn futures_core::stream::Stream<Item = i32>` cannot be sent between threads safely
9+
|
10+
= help: the trait `std::marker::Send` is not implemented for `dyn futures_core::stream::Stream<Item = i32>`
11+
= note: required because of the requirements on the impl of `std::marker::Send` for `std::ptr::Unique<dyn futures_core::stream::Stream<Item = i32>>`
12+
= note: required because it appears within the type `std::boxed::Box<dyn futures_core::stream::Stream<Item = i32>>`
13+
= note: required because it appears within the type `std::pin::Pin<std::boxed::Box<dyn futures_core::stream::Stream<Item = i32>>>`

0 commit comments

Comments
 (0)