]> git.lizzy.rs Git - rust.git/blob - src/test/ui/suggestions/issue-79843-impl-trait-with-missing-bounds-on-async-fn.stderr
Rollup merge of #90420 - GuillaumeGomez:rustdoc-internals-feature, r=camelid
[rust.git] / src / test / ui / suggestions / issue-79843-impl-trait-with-missing-bounds-on-async-fn.stderr
1 error[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    |
4 LL |     assert_is_send(&bar);
5    |     -------------- ^^^^ `<impl Foo as Foo>::Bar` cannot be sent between threads safely
6    |     |
7    |     required by a bound introduced by this call
8    |
9    = help: the trait `Send` is not implemented for `<impl Foo as Foo>::Bar`
10 note: required by a bound in `assert_is_send`
11   --> $DIR/issue-79843-impl-trait-with-missing-bounds-on-async-fn.rs:30:22
12    |
13 LL | fn assert_is_send<T: Send>(_: &T) {}
14    |                      ^^^^ required by this bound in `assert_is_send`
15 help: introduce a type parameter with a trait bound instead of using `impl Trait`
16    |
17 LL | async fn run<F: Foo>(_: &(), foo: F) -> std::io::Result<()> where <F as Foo>::Bar: Send {
18    |             ++++++++              ~                         +++++++++++++++++++++++++++
19
20 error[E0277]: `<impl Foo as Foo>::Bar` cannot be sent between threads safely
21   --> $DIR/issue-79843-impl-trait-with-missing-bounds-on-async-fn.rs:24:20
22    |
23 LL |     assert_is_send(&bar);
24    |     -------------- ^^^^ `<impl Foo as Foo>::Bar` cannot be sent between threads safely
25    |     |
26    |     required by a bound introduced by this call
27    |
28    = help: the trait `Send` is not implemented for `<impl Foo as Foo>::Bar`
29 note: required by a bound in `assert_is_send`
30   --> $DIR/issue-79843-impl-trait-with-missing-bounds-on-async-fn.rs:30:22
31    |
32 LL | fn assert_is_send<T: Send>(_: &T) {}
33    |                      ^^^^ required by this bound in `assert_is_send`
34 help: introduce a type parameter with a trait bound instead of using `impl Trait`
35    |
36 LL | async fn run2<F: Foo>(_: &(), foo: F) -> std::io::Result<()> where <F as Foo>::Bar: Send {
37    |              ~~~~~~~~              ~                         +++++++++++++++++++++++++++
38
39 error: aborting due to 2 previous errors
40
41 For more information about this error, try `rustc --explain E0277`.