Closed
Description
The following code won't compile:
fn main() {
let foo: *mut uint = std::ptr::null();
}
Instead, it fails with error: mismatched types: expected
*mut uintbut found
*const <generic #1> (values differ in mutability)
But it gets better, this also won't compile:
fn main() {
let foo: *mut uint = std::ptr::null() as *mut uint;
}
That fails with error: cannot determine a type for this expression: unconstrained type [E0101]
.
To get it to compile, you need to do:
fn main() {
let foo: *mut uint = std::ptr::null::<uint>() as *mut uint;
}
This wasn't previously necessary (at least as of 0.11.0).
I'm using rustc 0.12.0-pre-nightly (4d4eb1023 2014-08-02 23:36:09 +0000)
Metadata
Metadata
Assignees
Labels
No labels