Closed
Description
This code:
struct S {
v: Vec<(u32, Vec<u32>)>,
}
impl S {
pub fn remove(&mut self, i: u32) -> Option<std::vec::Drain<u32>> {
self.v.get_mut(i as _ /*usize*/).map(|&mut (_, ref mut v2)| {
v2.drain(..)
})
}
}
stopped compiling in 1.15.0 with:
error: the type of this value must be known in this context
--> src/main.rs:8:16
|
8 | v2.drain(..)
| ^^^^^
If you change the cast on line 7 to the concrete type usize
, it compiles fine on 1.15.0 (and later)