-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Description
use std::ptr::{mut_null, to_mut_unsafe_ptr};
struct Foo {
priv data: *mut Foo,
}
impl Foo {
fn get_foo(&mut self) -> *mut Foo {
self.data
}
}
fn main() {
let mut f = Foo{data: mut_null()};
f.get_foo() = to_mut_unsafe_ptr(&mut f);
}
$ rustc ice.rs
ice.rs:15:4: 15:17 error: internal compiler error: trans_lvalue reached fall-through case: ExprMethodCall(33, @syntax::ast::Expr{id: 34, node: ExprPath(syntax::ast::Path{span: syntax::codemap::Span{lo: syntax::codemap::BytePos(220u), hi: syntax::codemap::BytePos(221u), expn_info: None}, global: false, segments: ~[syntax::ast::PathSegment{identifier: syntax::ast::Ident{name: 78u, ctxt: 29u}, lifetime: None, types: Empty}]}), span: syntax::codemap::Span{lo: syntax::codemap::BytePos(220u), hi: syntax::codemap::BytePos(221u), expn_info: None}}, syntax::ast::Ident{name: 77u, ctxt: 29u}, ~[], ~[], NoSugar)
ice.rs:15 f.get_foo() = to_mut_unsafe_ptr(&mut f);
Metadata
Metadata
Assignees
Labels
No labels