Fix an ICE when dereferencing types which cannot be dereferenced
This commit is contained in:
parent
8b3c09a103
commit
93e13e0eee
@ -413,12 +413,9 @@ fn constrain_derefs(rcx: @mut Rcx,
|
|||||||
|
|
||||||
match ty::deref(tcx, derefd_ty, true) {
|
match ty::deref(tcx, derefd_ty, true) {
|
||||||
Some(mt) => derefd_ty = mt.ty,
|
Some(mt) => derefd_ty = mt.ty,
|
||||||
None => {
|
/* if this type can't be dereferenced, then there's already an error
|
||||||
tcx.sess.span_bug(
|
in the session saying so. Just bail out for now */
|
||||||
deref_expr.span,
|
None => break
|
||||||
fmt!("%?'th deref is of a non-deref'able type `%s`",
|
|
||||||
i, rcx.fcx.infcx().ty_to_str(derefd_ty)));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,9 +8,8 @@
|
|||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
// error-pattern:cannot be dereferenced
|
|
||||||
fn main() {
|
fn main() {
|
||||||
match *1 {
|
match *1 { //~ ERROR: cannot be dereferenced
|
||||||
_ => { fail!(); }
|
_ => { fail!(); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user