Closed
Description
This code gives an ICE when compiled on latest nightly on MSVC:
struct Foo {
s: usize,
f: bool
}
impl Foo {
fn bar(&self, position: (usize, usize)) -> Vec<(usize, usize)> {
let s = self.s;
let mut output = Vec::with_capacity(s * s);
for t in 0..s*s {
let offset = (t / s, t % s)
let coordinate = (position.0 + offset.0, position.1 + offset.1);
output.push(coordinate);
}
output
}
}
Resulting in:
error: expected one of `.`, `;`, `?`, or an operator, found `let`
--> <anon>:12:9
|
11 | let offset = (t / s, t % s)
| - expected one of `.`, `;`, `?`, or an operator here
12 | let coordinate = (position.0 + offset.0, position.1 + offset.1);
| ^^^ unexpected token
error: internal compiler error: Error constructed but not emitted
error: internal compiler error: unexpected panic
rustc --version --verbose
rustc 1.18.0-nightly (7627e3d31 2017-04-16) binary: rustc commit-hash: 7627e3d31dd641ae9042675e9032857f58d0c5d1 commit-date: 2017-04-16 host: x86_64-pc-windows-msvc release: 1.18.0-nightly LLVM version: 3.9
Possibly already resolved with #41161 ?
Metadata
Metadata
Assignees
Labels
No labels