Found while triaging the NLL crater run, in Servo's url crate.
Playground
There's a Drop impl preventing , so the error should at least mention it. But the implicit reborrow self.url hides this error with a '*self.url' does not live long enough one.
Changing the impl to
impl<'a> S<'a> {
fn finish(self) -> &'a mut String {
let p = self.url;
p
}
}
gives a better error message: self.url cannot move out of type "S<'_>", which implements the "Drop" trait.