Closed
Description
The following error appears:
error: internal compiler error: ty::Region#subst(): Reference to self region when given substs with no self region: substs(regions=[], self_ty=Some(BUG[1u]), tps=[T])
This message reflects a bug in the Rust compiler.
We would appreciate a bug report: https://github.com/mozilla/rust/wiki/HOWTO-submit-a-Rust-bug-report
task 'rustc' failed at 'explicit failure', /build/buildd/rust-nightly-201311090805~d14a647~saucy/src/libsyntax/diagnostic.rs:101
task '<main>' failed at 'explicit failure', /build/buildd/rust-nightly-201311090805~d14a647~saucy/src/librustc/lib.rs:397
When compiling the following program:
trait Serializable<'self, T> {
fn serialize(val : &'self T) -> ~[u8];
fn deserialize(repr : &[u8]) -> &'self T;
}
impl<'self> Serializable<str> for &'self str {
fn serialize(val : &'self str) -> ~[u8] {
~[1]
}
fn deserialize(repr: &[u8]) -> &'self str {
"hi"
}
}
fn main() {
println("hello");
let x = ~"foo";
let y = x;
println(y);
}
$ rustc --version
rustc 0.9-pre
host: x86_64-unknown-linux-gnu
$ dpkg --status rust-nightly
Package: rust-nightly
Status: install ok installed
Priority: extra
Section: devel
Installed-Size: 113880
Maintainer: Hans Jørgen Hoel <[email protected]>
Architecture: amd64
Version: 201311090805~d14a647~saucy
Depends: libc6 (>= 2.17), libgcc1 (>= 1:4.1.1), libstdc++6 (>= 4.6)
Description: Rust compiler and tools
Compiler, libraries and tools for the Rust programming language.
Homepage: http://rust-lang.org