@@ -104,7 +104,7 @@ fn check_is_legal_to_move_from(bccx: &BorrowckCtxt,
104
104
mc:: cat_deref( _, _, mc:: BorrowedPtr ( ..) ) |
105
105
mc:: cat_deref( _, _, mc:: GcPtr ) |
106
106
mc:: cat_deref( _, _, mc:: UnsafePtr ( ..) ) |
107
- mc:: cat_upvar( ..) |
107
+ mc:: cat_upvar( ..) | mc :: cat_static_item |
108
108
mc:: cat_copied_upvar( mc:: CopiedUpvar { onceness : ast:: Many , .. } ) => {
109
109
bccx. span_err (
110
110
cmt0. span ,
@@ -120,19 +120,6 @@ fn check_is_legal_to_move_from(bccx: &BorrowckCtxt,
120
120
true
121
121
}
122
122
123
- // It seems strange to allow a move out of a static item,
124
- // but what happens in practice is that you have a
125
- // reference to a constant with a type that should be
126
- // moved, like `None::<~int>`. The type of this constant
127
- // is technically `Option<~int>`, which moves, but we know
128
- // that the content of static items will never actually
129
- // contain allocated pointers, so we can just memcpy it.
130
- // Since static items can never have allocated memory,
131
- // this is ok. For now anyhow.
132
- mc:: cat_static_item => {
133
- true
134
- }
135
-
136
123
mc:: cat_rvalue( ..) |
137
124
mc:: cat_local( ..) |
138
125
mc:: cat_arg( ..) => {
0 commit comments