Closed
Description
Turns out it's impossible to use generic newtypes across crates:
test.rs:
pub struct Foo<T>(T);
impl<T> Foo<T> {
pub fn new(t: T) -> Foo<T> {
Foo(t)
}
}
test2.rs:
extern mod test;
use test::{Foo};
struct Baz;
fn main() {
Foo::new(Baz);
}
~ ❯ env RUST_LOG=rustc=1 rustc -L. test2.rs
task <unnamed> failed at 'assertion failed: `(left == right) && (right == left)` (left: `2`, right: `0`)', /build/rust-git/src/rust/src/librustc/middle/trans/callee.rs:385
error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug
note: try running with RUST_LOG=rustc=1 to get further details and report the results to github.com/mozilla/rust/issues
task <unnamed> failed at 'explicit failure', /build/rust-git/src/rust/src/librustc/rustc.rs:377
This makes it impossible to use std::rt::io::buffered::BufferedStream
.