diff --git a/src/comp/middle/ty.rs b/src/comp/middle/ty.rs index d20544e48e8..bae7f84d4ae 100644 --- a/src/comp/middle/ty.rs +++ b/src/comp/middle/ty.rs @@ -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 } diff --git a/src/test/compile-fail/binop-add-ptr.rs b/src/test/compile-fail/binop-add-ptr.rs new file mode 100644 index 00000000000..e21f6a97fc2 --- /dev/null +++ b/src/test/compile-fail/binop-add-ptr.rs @@ -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() { } \ No newline at end of file