Skip to content

Commit 3cc2641

Browse files
committed
Make various binops not typecheck for unsafe pointers. Closes #1173
1 parent 768306b commit 3cc2641

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/comp/middle/ty.rs

-1
Original file line numberDiff line numberDiff line change
@@ -2902,7 +2902,6 @@ fn is_binopable(cx: ctxt, ty: t, op: ast::binop) -> bool {
29022902
ty_machine(ast::ty_f32.) { tycat_float }
29032903
ty_machine(ast::ty_f64.) { tycat_float }
29042904
ty_char. { tycat_int }
2905-
ty_ptr(_) { tycat_int }
29062905
ty_str. { tycat_str }
29072906
ty_vec(_) { tycat_vec }
29082907
ty_rec(_) { tycat_struct }
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// error-pattern:binary operation + cannot be applied to type `*i`
2+
3+
fn die() -> *int { (0 as *int) + (0 as *int) }
4+
fn main() { }

0 commit comments

Comments
 (0)