From e014ab9023017ec1c1533a1fbe27288e0b53152f Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Sat, 15 Jun 2013 20:17:59 -0400 Subject: [PATCH] Make it illegal to move from *T. This interacts poorly with moves-based-on-type, since it creates moves that were not apparent. It also turns out to be not widely used. --- src/librustc/middle/borrowck/gather_loans/gather_moves.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/librustc/middle/borrowck/gather_loans/gather_moves.rs b/src/librustc/middle/borrowck/gather_loans/gather_moves.rs index ef911c9a808e..5431a0a29980 100644 --- a/src/librustc/middle/borrowck/gather_loans/gather_moves.rs +++ b/src/librustc/middle/borrowck/gather_loans/gather_moves.rs @@ -105,7 +105,8 @@ fn check_is_legal_to_move_from(bccx: @BorrowckCtxt, mc::cat_implicit_self(*) | mc::cat_copied_upvar(*) | mc::cat_deref(_, _, mc::region_ptr(*)) | - mc::cat_deref(_, _, mc::gc_ptr(*)) => { + mc::cat_deref(_, _, mc::gc_ptr(*)) | + mc::cat_deref(_, _, mc::unsafe_ptr(*)) => { bccx.span_err( cmt0.span, fmt!("cannot move out of %s", @@ -129,8 +130,7 @@ fn check_is_legal_to_move_from(bccx: @BorrowckCtxt, mc::cat_rvalue(*) | mc::cat_local(*) | mc::cat_arg(*) | - mc::cat_self(*) | - mc::cat_deref(_, _, mc::unsafe_ptr(*)) => { + mc::cat_self(*) => { true }