Closed
Description
Code to reproduce.
#[repr(C)]
#[allow(dead_code)]
struct Slice<T> {
data: *const T,
len: usize,
}
fn main() {
let text = "Hello World!\n";
let t1 = text as *const str;
let t2 = t1 as *const Slice<u8>;
}
Rust Playpen: http://is.gd/jfBLrG
Output
error: internal compiler error: translating unsupported cast: *const str (cast_other) -> *const Slice<u8> (cast_pointer)
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'Box<Any>', /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libsyntax/diagnostic.rs:189