Skip to content

Commit 4887190

Browse files
committed
---
yaml --- r: 185290 b: refs/heads/master c: 7ae8889 h: refs/heads/master v: v3
1 parent 8079f9c commit 4887190

File tree

4 files changed

+10
-18
lines changed

4 files changed

+10
-18
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: bd511f73be526640ae98012d302201a019f9b458
2+
refs/heads/master: 7ae8889286535446f9a7c0d4c3e214b55d7063e6
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 3a96d6a9818fe2affc98a187fb1065120458cee9
55
refs/heads/try: ccf8fedf1cffcb8f6f3581d53d220039e192fe77

trunk/src/libcore/cell.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@
144144
use clone::Clone;
145145
use cmp::PartialEq;
146146
use default::Default;
147-
use marker::{Copy, Send};
147+
use marker::{Copy, Send, Sync};
148148
use ops::{Deref, DerefMut, Drop};
149149
use option::Option;
150150
use option::Option::{None, Some};
@@ -660,6 +660,8 @@ pub struct UnsafeCell<T> {
660660
pub value: T,
661661
}
662662

663+
impl<T> !Sync for UnsafeCell<T> {}
664+
663665
impl<T> UnsafeCell<T> {
664666
/// Construct a new instance of `UnsafeCell` which will wrap the specified
665667
/// value.

trunk/src/libcore/marker.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ pub unsafe trait Send : MarkerTrait {
5151

5252
impl<T> !Send for *const T { }
5353
impl<T> !Send for *mut T { }
54+
impl !Send for Managed { }
5455

5556
/// Types with a constant size known at compile-time.
5657
#[stable(feature = "rust1", since = "1.0.0")]
@@ -219,6 +220,7 @@ pub unsafe trait Sync : MarkerTrait {
219220

220221
impl<T> !Sync for *const T { }
221222
impl<T> !Sync for *mut T { }
223+
impl !Sync for Managed { }
222224

223225
/// A type which is considered "not POD", meaning that it is not
224226
/// implicitly copyable. This is typically embedded in other types to

trunk/src/librustc/middle/traits/select.rs

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -826,6 +826,8 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
826826
}
827827
Some(bound @ ty::BoundSend) |
828828
Some(bound @ ty::BoundSync) => {
829+
// Ideally, we shouldn't sepcial case Send/Sync. This will be unified
830+
// as soon as default trait implementations for these traits land.
829831
try!(self.assemble_candidates_from_impls(obligation, &mut candidates));
830832

831833
// No explicit impls were declared for this type, consider the fallback rules.
@@ -1599,27 +1601,13 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
15991601
-> Result<BuiltinBoundConditions<'tcx>,SelectionError<'tcx>>
16001602
{
16011603
// First check for markers and other nonsense.
1602-
let tcx = this.tcx();
16031604
match bound {
1604-
ty::BoundSend => {
1605-
if Some(def_id) == tcx.lang_items.managed_bound() {
1606-
return Err(Unimplemented)
1607-
}
1608-
}
1609-
16101605
ty::BoundCopy => {
16111606
return Ok(ParameterBuiltin)
16121607
}
16131608

1614-
ty::BoundSync => {
1615-
if
1616-
Some(def_id) == tcx.lang_items.managed_bound() ||
1617-
Some(def_id) == tcx.lang_items.unsafe_cell_type()
1618-
{
1619-
return Err(Unimplemented)
1620-
}
1621-
}
1622-
1609+
ty::BoundSend |
1610+
ty::BoundSync |
16231611
ty::BoundSized => { }
16241612
}
16251613

0 commit comments

Comments
 (0)