Skip to content

Commit e014ab9

Browse files
committed
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.
1 parent a9012a2 commit e014ab9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/librustc/middle/borrowck/gather_loans/gather_moves.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ fn check_is_legal_to_move_from(bccx: @BorrowckCtxt,
105105
mc::cat_implicit_self(*) |
106106
mc::cat_copied_upvar(*) |
107107
mc::cat_deref(_, _, mc::region_ptr(*)) |
108-
mc::cat_deref(_, _, mc::gc_ptr(*)) => {
108+
mc::cat_deref(_, _, mc::gc_ptr(*)) |
109+
mc::cat_deref(_, _, mc::unsafe_ptr(*)) => {
109110
bccx.span_err(
110111
cmt0.span,
111112
fmt!("cannot move out of %s",
@@ -129,8 +130,7 @@ fn check_is_legal_to_move_from(bccx: @BorrowckCtxt,
129130
mc::cat_rvalue(*) |
130131
mc::cat_local(*) |
131132
mc::cat_arg(*) |
132-
mc::cat_self(*) |
133-
mc::cat_deref(_, _, mc::unsafe_ptr(*)) => {
133+
mc::cat_self(*) => {
134134
true
135135
}
136136

0 commit comments

Comments
 (0)