Skip to content

Commit 9ae144f

Browse files
committed
Add default impls for Send/Sync
1 parent cbc660b commit 9ae144f

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/libcore/marker.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ pub unsafe trait Send : MarkerTrait {
3939
// empty.
4040
}
4141

42+
impl Send for .. { }
43+
4244
impl<T> !Send for *const T { }
4345
impl<T> !Send for *mut T { }
4446
impl !Send for Managed { }
@@ -203,6 +205,8 @@ pub unsafe trait Sync : MarkerTrait {
203205
// Empty
204206
}
205207

208+
impl Sync for .. { }
209+
206210
impl<T> !Sync for *const T { }
207211
impl<T> !Sync for *mut T { }
208212
impl !Sync for Managed { }

src/librustc/middle/ty.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5980,10 +5980,7 @@ pub fn item_variances(tcx: &ctxt, item_id: ast::DefId) -> Rc<ItemVariances> {
59805980

59815981
pub fn trait_has_default_impl(tcx: &ctxt, trait_def_id: DefId) -> bool {
59825982
populate_implementations_for_trait_if_necessary(tcx, trait_def_id);
5983-
match tcx.lang_items.to_builtin_kind(trait_def_id) {
5984-
Some(BoundSend) | Some(BoundSync) => true,
5985-
_ => tcx.traits_with_default_impls.borrow().contains_key(&trait_def_id),
5986-
}
5983+
tcx.traits_with_default_impls.borrow().contains_key(&trait_def_id)
59875984
}
59885985

59895986
/// Records a trait-to-implementation mapping.

0 commit comments

Comments
 (0)