error[E0597]: `s` does not live long enough --> $DIR/issue-55850.rs:28:16 | LL | yield &s[..] | ^ borrowed value does not live long enough LL | }) | - borrowed value only lives until here | note: borrowed value must be valid for the lifetime 'a as defined on the function body at 25:8... --> $DIR/issue-55850.rs:25:8 | LL | fn bug<'a>() -> impl Iterator { | ^^ error: aborting due to previous error For more information about this error, try `rustc --explain E0597`.