-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
S-unactionableIssue requires feedback, design decisions or is blocked on other workIssue requires feedback, design decisions or is blocked on other work
Description
** Rust-Analyzer Version:** 0.3.1238-standalone
** Rustc Version:** rustc 1.64.1 (a55dd71d5 2022-09-19)
Rust-Analyzer fails to provide type annotations for variables in loops, giving them the {unknown} type.
Example 1:
pub fn configure (&mut self, modules: &[Mod]) {
let mut prev_size = self.input;
for m in modules.iter() { // problem occurs here; 'm' is of type {unknown}
self.modules.push((m.init(prev_size, self.batch_size), self.optim.init()));
prev_size = m.output_size(prev_size);
}
}Example 2:
pub fn train (&mut self) {
for data in self.dataset.iter() { // problem occurs here; 'data' is of type {unknown}
}
}Issue persists after reinstalling rust-analyzer, restarting VSCode, and restarting my computer. RA successfully identifies the types of other variables.
Metadata
Metadata
Assignees
Labels
S-unactionableIssue requires feedback, design decisions or is blocked on other workIssue requires feedback, design decisions or is blocked on other work