mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-03 12:13:43 +00:00
Make various binops not typecheck for unsafe pointers. Closes #1173
This commit is contained in:
parent
768306badd
commit
3cc2641fc3
@ -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 }
|
||||
|
4
src/test/compile-fail/binop-add-ptr.rs
Normal file
4
src/test/compile-fail/binop-add-ptr.rs
Normal 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() { }
|
Loading…
Reference in New Issue
Block a user