]> git.proxmox.com Git - rustc.git/blame - src/test/ui/suggestions/issue-79843-impl-trait-with-missing-bounds-on-async-fn.stderr
New upstream version 1.56.0~beta.4+dfsg1
[rustc.git] / src / test / ui / suggestions / issue-79843-impl-trait-with-missing-bounds-on-async-fn.stderr
CommitLineData
fc512014
XL
1error[E0277]: `<impl Foo as Foo>::Bar` cannot be sent between threads safely
2 --> $DIR/issue-79843-impl-trait-with-missing-bounds-on-async-fn.rs:14:20
3 |
4LL | assert_is_send(&bar);
5 | ^^^^ `<impl Foo as Foo>::Bar` cannot be sent between threads safely
fc512014
XL
6 |
7 = help: the trait `Send` is not implemented for `<impl Foo as Foo>::Bar`
94222f64
XL
8note: required by a bound in `assert_is_send`
9 --> $DIR/issue-79843-impl-trait-with-missing-bounds-on-async-fn.rs:30:22
10 |
11LL | fn assert_is_send<T: Send>(_: &T) {}
12 | ^^^^ required by this bound in `assert_is_send`
fc512014
XL
13help: introduce a type parameter with a trait bound instead of using `impl Trait`
14 |
15LL | async fn run<F: Foo>(_: &(), foo: F) -> std::io::Result<()> where <F as Foo>::Bar: Send {
94222f64 16 | ++++++++ ~ +++++++++++++++++++++++++++
fc512014
XL
17
18error[E0277]: `<impl Foo as Foo>::Bar` cannot be sent between threads safely
19 --> $DIR/issue-79843-impl-trait-with-missing-bounds-on-async-fn.rs:24:20
20 |
21LL | assert_is_send(&bar);
22 | ^^^^ `<impl Foo as Foo>::Bar` cannot be sent between threads safely
fc512014
XL
23 |
24 = help: the trait `Send` is not implemented for `<impl Foo as Foo>::Bar`
94222f64
XL
25note: required by a bound in `assert_is_send`
26 --> $DIR/issue-79843-impl-trait-with-missing-bounds-on-async-fn.rs:30:22
27 |
28LL | fn assert_is_send<T: Send>(_: &T) {}
29 | ^^^^ required by this bound in `assert_is_send`
fc512014
XL
30help: introduce a type parameter with a trait bound instead of using `impl Trait`
31 |
32LL | async fn run2<F: Foo>(_: &(), foo: F) -> std::io::Result<()> where <F as Foo>::Bar: Send {
94222f64 33 | ~~~~~~~~ ~ +++++++++++++++++++++++++++
fc512014
XL
34
35error: aborting due to 2 previous errors
36
37For more information about this error, try `rustc --explain E0277`.