fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.1 KiB26 linesraw
1// Regression test for issue #105227.
2
3// run-rustfix
4#![allow(warnings)]
5fn chars0<'a>(v :(&'a  str, &'a str)) -> impl Iterator<Item = char> + 'a  {
6//~^ HELP to declare that `impl Iterator<Item = char>` captures `'_`, you can introduce a named lifetime parameter `'a`
7    v.0.chars().chain(v.1.chars())
8    //~^ ERROR hidden type for `impl Iterator<Item = char>` captures lifetime that does not appear in bounds
9}
10
11fn chars1<'a>(v0 : &'a  str, v1 : &'a str) -> impl Iterator<Item = char> + 'a  {
12//~^ HELP to declare that `impl Iterator<Item = char>` captures `'_`, you can introduce a named lifetime parameter `'a`
13    v0.chars().chain(v1.chars())
14    //~^ ERROR hidden type for `impl Iterator<Item = char>` captures lifetime that does not appear in bound
15}
16
17fn chars2<'b>(v0 : &'b str, v1 : &'b str, v2 : &'b str) ->
18//~^ HELP to declare that `impl Iterator<Item = char>` captures `'_`, you can use the named lifetime parameter `'b`
19    (impl Iterator<Item = char> + 'b , &'b str)
20{
21    (v0.chars().chain(v1.chars()), v2)
22    //~^ ERROR hidden type for `impl Iterator<Item = char>` captures lifetime that does not appear in bound
23}
24
25fn main() {
26}