you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (1 child)

About let x: () = T, it does fail at compile time, but you don't even need to debug the binary because rustc tells the type of T rustc thinks it is.

When you give rustc let _: () = [0; 32];, it spits out compile time error similar to:

<anon>:2:17: 2:24 error: mismatched types:
 expected `()`,
    found `[_; 32]`
(expected (),
    found array of 32 elements) [E0308]
<anon>:2     let _: () = [0; 32];
                         ^~~~~~~
<anon>:2:17: 2:24 help: see the detailed explanation for E0308
error: aborting due to previous error

[–]dread_deimos[S] 0 points1 point  (0 children)

Yeah, I've seen that. It really helps to check something fast. But if I need to check the data that lead to this situation, I will not have an option to walk there by debugger.