-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Closed
Labels
E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
Description
This code
#[crate_type = "lib"];
#[link(name = "foo", vers = "0.1")];
use std::cast;
trait A {}
struct B;
impl A for B {}
fn bar<T>(_: &mut A, _: &T) {}
fn foo<T>(t: &T) {
let b = B;
bar(unsafe { cast::transmute(&b as &A) }, t)
}
Dies with
error: internal compiler error: Cannot encode region variables
The transmute
is in place to get around #8248, but I think that this may be uncovering a separate issue. Even with the transmute, I think this should compile anyway (although it's still unsafe code).
cc @msullivan
Metadata
Metadata
Assignees
Labels
E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.