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
There is another bug by the same name, but that one was fixed. After searching about 10 minutes, I couldn't find any duplicates.
The code
fn main () {
let arr: ~[u8] = ~[ 1, 2, 3 ];
let iter = &arr.iter() as &Iterator<&u8>
}
Fails to compile with the following error
task 'rustc' failed at 'index out of bounds: the len is 1 but the index is 1', /home/username/dload/code/rust/src/librustc/middle/ty.rs:1432
error: internal compiler error: unexpected failure
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
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 '' failed at 'explicit failure', /home/username/dload/code/rust/src/librustc/lib.rs:398
I am running rustc 0.9-pre (e5f4904 2013-12-13 07:51:42 -0800) on Fedora 19 (Linux 3.11.6-200.fc19.x86_64 #1 SMP). This is latest git HEAD as of about an hour ago.
The text was updated successfully, but these errors were encountered:
This happens anytime you cast a generic struct to a trait containing a generic method implementation:
trait Tr {
fn dostuff<A>(&self, v: A) -> A {
v
}
}
struct St <T> {
val: T,
}
impl<T> Tr for St <T> {}
fn main () {
let a = St { val: 1 };
let b = &a as &Tr;
}
From what i understand, during the vtable generation, before dostuff is discarded for being generic, we try to perform its type parameter substitution, which goes to hell because there's no type to substitute to A.
I'm not sure why there's a call to ty::subst_tps from trans::meth::emit_vtable_methods for generic methods, since those are discarded just afterward.
…exendoo,blyxyas
new lint [`redundant_guards`]
Closesrust-lang#7825, maybe somebody else can get the ranges lint in the comments?
changelog: New lint [`redundant_guards`]
There is another bug by the same name, but that one was fixed. After searching about 10 minutes, I couldn't find any duplicates.
The code
Fails to compile with the following error
I am running rustc 0.9-pre (e5f4904 2013-12-13 07:51:42 -0800) on Fedora 19 (Linux 3.11.6-200.fc19.x86_64 #1 SMP). This is latest git HEAD as of about an hour ago.
The text was updated successfully, but these errors were encountered: