Make various binops not typecheck for unsafe pointers. Closes #1173

This commit is contained in:
Brian Anderson 2011-11-13 13:55:08 -08:00
parent 768306badd
commit 3cc2641fc3
2 changed files with 4 additions and 1 deletions

View File

@ -2902,7 +2902,6 @@ fn is_binopable(cx: ctxt, ty: t, op: ast::binop) -> bool {
ty_machine(ast::ty_f32.) { tycat_float }
ty_machine(ast::ty_f64.) { tycat_float }
ty_char. { tycat_int }
ty_ptr(_) { tycat_int }
ty_str. { tycat_str }
ty_vec(_) { tycat_vec }
ty_rec(_) { tycat_struct }

View File

@ -0,0 +1,4 @@
// error-pattern:binary operation + cannot be applied to type `*i`
fn die() -> *int { (0 as *int) + (0 as *int) }
fn main() { }