]> git.lizzy.rs Git - rust.git/blob - src/test/ui/lifetimes/issue-105227.stderr
Rollup merge of #106175 - compiler-errors:bad-import-sugg, r=oli-obk
[rust.git] / src / test / ui / lifetimes / issue-105227.stderr
1 error[E0700]: hidden type for `impl Iterator<Item = char>` captures lifetime that does not appear in bounds
2   --> $DIR/issue-105227.rs:7:5
3    |
4 LL | fn chars0(v :(& str, &str)) -> impl Iterator<Item = char> {
5    |               ----- hidden type `std::iter::Chain<Chars<'_>, Chars<'_>>` captures the anonymous lifetime defined here
6 LL |
7 LL |     v.0.chars().chain(v.1.chars())
8    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
9    |
10 help: to declare that `impl Iterator<Item = char>` captures `'_`, you can introduce a named lifetime parameter `'a`
11    |
12 LL | fn chars0<'a>(v :(&'a  str, &'a str)) -> impl Iterator<Item = char> + 'a  {
13    |          ++++      ++        ++                                     ++++
14
15 error[E0700]: hidden type for `impl Iterator<Item = char>` captures lifetime that does not appear in bounds
16   --> $DIR/issue-105227.rs:13:5
17    |
18 LL | fn chars1(v0 : & str, v1 : &str) -> impl Iterator<Item = char> {
19    |                ----- hidden type `std::iter::Chain<Chars<'_>, Chars<'_>>` captures the anonymous lifetime defined here
20 LL |
21 LL |     v0.chars().chain(v1.chars())
22    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
23    |
24 help: to declare that `impl Iterator<Item = char>` captures `'_`, you can introduce a named lifetime parameter `'a`
25    |
26 LL | fn chars1<'a>(v0 : &'a  str, v1 : &'a str) -> impl Iterator<Item = char> + 'a  {
27    |          ++++       ++             ++                                    ++++
28
29 error[E0700]: hidden type for `impl Iterator<Item = char>` captures lifetime that does not appear in bounds
30   --> $DIR/issue-105227.rs:21:5
31    |
32 LL | fn chars2<'b>(v0 : &str, v1 : &'_ str, v2 : &'b str) ->
33    |                    ---- hidden type `std::iter::Chain<Chars<'_>, Chars<'_>>` captures the anonymous lifetime defined here
34 ...
35 LL |     (v0.chars().chain(v1.chars()), v2)
36    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
37    |
38 help: to declare that `impl Iterator<Item = char>` captures `'_`, you can use the named lifetime parameter `'b`
39    |
40 LL ~ fn chars2<'b>(v0 : &'b str, v1 : &'b str, v2 : &'b str) ->
41 LL |
42 LL ~     (impl Iterator<Item = char> + 'b , &'b str)
43    |
44
45 error: aborting due to 3 previous errors
46
47 For more information about this error, try `rustc --explain E0700`.