You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The output of the following test case is 18446744073709551615:
fnmain(){letmut x = -1;for i invec![1usize]{break;
x = i;}println!("{}", x);}
The problem is that x is inferred as being usize. However, the -1 initial value cannot be hold in that type, so it overflows/gets transmuted into an usize.
My expectation is that this should result in a compilation error.
The output of the following test case is
18446744073709551615
:The problem is that
x
is inferred as beingusize
. However, the-1
initial value cannot be hold in that type, so it overflows/gets transmuted into anusize
.My expectation is that this should result in a compilation error.
Meta
rustc 1.1.0-beta (cd7d89a 2015-05-16) (built 2015-05-16)
binary: rustc
commit-hash: cd7d89a
commit-date: 2015-05-16
build-date: 2015-05-16
host: x86_64-pc-windows-gnu
release: 1.1.0-beta
The text was updated successfully, but these errors were encountered: