mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-22 20:03:37 +00:00
Improve a type error message (avoid the word 'non-dereferenceable')
This commit is contained in:
parent
5c4ffd0dd7
commit
90ac69904f
@ -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)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
6
src/test/compile-fail/deref-non-pointer.rs
Normal file
6
src/test/compile-fail/deref-non-pointer.rs
Normal file
@ -0,0 +1,6 @@
|
||||
// error-pattern:cannot be dereferenced
|
||||
fn main() {
|
||||
alt *1 {
|
||||
_ { fail; }
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user