Improve a type error message (avoid the word 'non-dereferenceable')

This commit is contained in:
Tim Chevalier 2012-03-07 14:14:34 -08:00
parent 5c4ffd0dd7
commit 90ac69904f
2 changed files with 9 additions and 4 deletions

View File

@ -2163,10 +2163,9 @@ fn check_expr_with_unifier(fcx: @fn_ctxt, expr: @ast::expr, unify: unifier,
require_unsafe(tcx.sess, fcx.purity, expr.span);
}
_ {
tcx.sess.span_err(expr.span,
"dereferencing non-" +
"dereferenceable type: " +
ty_to_str(tcx, oper_t));
tcx.sess.span_err(expr.span,
#fmt("Type %s cannot be dereferenced",
ty_to_str(tcx, oper_t)));
}
}
}

View File

@ -0,0 +1,6 @@
// error-pattern:cannot be dereferenced
fn main() {
alt *1 {
_ { fail; }
}
}