forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
37: Remove unnecessary GcPointer field r=ltratt a=jacob-hughes This was originally used to stop the `NonNull` affecting the `Send + Sync` impl on the `Gc`. However, it's much easier to just use conditional trait impls, e.g.: ``` unsafe impl<T: Send> Send for Gc<T> {} ``` Co-authored-by: Jake Hughes <jh@jakehughes.uk>
- Loading branch information
Showing
6 changed files
with
31 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// run-pass | ||
#![feature(gc)] | ||
#![feature(negative_impls)] | ||
|
||
use std::gc::Gc; | ||
use std::sync::Mutex; | ||
|
||
fn assert_send<T: Send>() {} | ||
fn assert_both<T: Sync + Send>() {} | ||
|
||
struct NoSync; | ||
|
||
impl !Sync for NoSync {} | ||
|
||
fn main() { | ||
assert_send::<Gc<NoSync>>(); | ||
assert_both::<Gc<Mutex<usize>>>(); | ||
} |