-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Panic in rustc, "trying to take the sizing type of std::io::Reader+'static, an unsized type" #18866
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'm poking around at this, since something that seems the same bit me a bit earlier today as well. Not particularly familiar with internal compiler code though, so any tips are appreciated. If I'm reading this right, the example should have failed during typeck (passing an &mut Box<Reader +'static> to bar where it should be an &mut Reader), so I'll start somewhere there. |
This does not ICE on OSX: use std::io::Reader;
pub struct Foo {
pub reader: Box<Reader +'static>
}
pub fn bar(reader: &mut Reader) {
}
pub fn new_Foo (reader: Box<Reader +'static>) -> Foo {
let mut foo = Foo {
reader: reader
};
bar(&mut foo.reader);
foo
}
fn main() {} produces:
Could someone check if it still ICEs on Windows? If not, nominating this to be closed. |
tl;dr: this bug appears to be fixed. @sivadeilra's example compiles fine: use std::io::Read;
pub struct Foo {
pub reader: Box<Read +'static>
}
pub fn bar(reader: &mut Read) {
}
pub fn new_Foo (reader: Box<Read +'static>) -> Foo {
let mut foo = Foo {
reader: reader
};
bar(&mut foo.reader);
foo
}
fn main() {} @brandonson's concern is invalid. Box implements Read where T: Read, so this code should pass type checking. @erickt although I wouldn't expect any issues on windows in particular, since this a bug in libsyntax, I went ahead and tested it on Window 8.1 x64 using today's nightly. Again, it compiles fine.
|
Yay! |
…dfile-changes Fix JSON project `PackageRoot` buildfile inclusion
Hit panic in rustc.exe. Running on Windows 8.1 x64, using a nightly installed on Nov 8, 2014. Stack:
I was able to boil this down to this minimal repro:
Here's the stack from the minimal repro:
The text was updated successfully, but these errors were encountered: