-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
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)
Metadata
Metadata
Assignees
Labels
T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.