Closed mattmacy closed 5 years ago
Reduced:
#[cfg(not(feature = "linked-hash-map"))]
use std::collections::hash_map::{HashMap as Map, IterMut};
#[cfg(feature = "linked-hash-map")]
extern crate linked_hash_map;
#[cfg(feature = "linked-hash-map")]
use linked_hash_map::{LinkedHashMap as Map, IterMut};
fn f<'a, 'r>(m: &'r mut Map<&'a (), ()>) -> IterMut<'r, &'r (), ()> {
m.iter_mut()
}
fn main() {}
Looks like a linked-hash-map bug. Relevant code from libstd that makes this work:
¯_(ツ)_/¯
The following code works without issue: https://is.gd/BIFxdX
However, when I comment out the hash_map usage and uncomment the linked_hash_map code - which is verbatim the same AFAICT- it can't resolve the lifetime of iter_mut