Skip to content

Commit 9b58369

Browse files
committed
Treat static slices and rptrs as sendable.
1 parent e653d49 commit 9b58369

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/rustc/middle/ty.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1950,7 +1950,11 @@ fn type_kind(cx: ctxt, ty: t) -> kind {
19501950
// Trait instances are (for now) like shared boxes, basically
19511951
ty_trait(_, _, _) => kind_safe_for_default_mode() | kind_owned(),
19521952
1953-
// Region pointers are copyable but NOT owned nor sendable
1953+
// Static region pointers are copyable and sendable, but not owned
1954+
ty_rptr(re_static, mt) =>
1955+
kind_safe_for_default_mode() | mutable_type_kind(cx, mt),
1956+
1957+
// General region pointers are copyable but NOT owned nor sendable
19541958
ty_rptr(_, _) => kind_safe_for_default_mode(),
19551959
19561960
// Unique boxes and vecs have the kind of their contained type,
@@ -1972,6 +1976,9 @@ fn type_kind(cx: ctxt, ty: t) -> kind {
19721976
ty_evec(tm, vstore_box) => {
19731977
remove_send(kind_safe_for_default_mode() | mutable_type_kind(cx, tm))
19741978
}
1979+
ty_evec(tm, vstore_slice(re_static)) => {
1980+
kind_safe_for_default_mode() | mutable_type_kind(cx, tm)
1981+
}
19751982
ty_evec(tm, vstore_slice(_)) => {
19761983
remove_owned_send(kind_safe_for_default_mode() |
19771984
mutable_type_kind(cx, tm))
@@ -1984,6 +1991,9 @@ fn type_kind(cx: ctxt, ty: t) -> kind {
19841991
ty_estr(vstore_box) => {
19851992
kind_safe_for_default_mode() | kind_const() | kind_owned()
19861993
}
1994+
ty_estr(vstore_slice(re_static)) => {
1995+
kind_safe_for_default_mode() | kind_send_copy() | kind_const()
1996+
}
19871997
ty_estr(vstore_slice(_)) => {
19881998
kind_safe_for_default_mode() | kind_const()
19891999
}

0 commit comments

Comments
 (0)