Closed
Description
In my branch that has #20723 landed, this oddity comes up:
#[cfg(workaround)]
use std::boxed::Box;
fn main() {
let x: Box<char>;
x = Box::new('c');
println!(" x: {}", x);
}
Ready? Watch this:
% ./x86_64-apple-darwin/stage2/bin/rustc /tmp/boxnew2.rs
/tmp/boxnew2.rs:6:9: 6:17 error: unresolved name `Box::new`
/tmp/boxnew2.rs:6 x = Box::new('c');
^~~~~~~~
error: aborting due to previous error
% ./x86_64-apple-darwin/stage2/bin/rustc /tmp/boxnew2.rs --cfg workaround
%
That is, the Box::new
call fails, unless one includes a use std::boxed::Box
in one's code. Truly weird.
I spent much time today trying to dig into this (when I should have been dealing with the other fallout from feature gating box), but in the end I decided that this is "just a bug" and its an easy enough work around for the purposes of the alpha.