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
$ cat t.rs
struct A<T> { inner: *T }
struct B;
fn main() {
// works
let _: A<B> = A::<B> { inner: std::ptr::null() };
// works
let _ = A::<B> { inner: std::ptr::null::<B>() };
// cannot determine a type for this local variable: unconstrained type
let _ = A::<B> { inner: std::ptr::null() };
}
$ rustc -v
rustc 0.11.0-pre (3a9228b 2014-06-12 19:36:53 +0000)
host: x86_64-unknown-linux-gnu
$ rustc t.rs
t.rs:10:9: 10:47 error: cannot determine a type for this local variable: unconstrained type
t.rs:10 let _ = A::<B> { inner: std::ptr::null() };
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
The third assignment seems unambiguous but the compiler won't accept it.