Skip to content

(fix) Fix compiler error with rust 1.31.1 #44

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions src/internals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,30 +26,29 @@ unsafe impl UnsafeAnyExt for DebugAny + Send + Sync {}
/// additional bounds.
///
/// There is also an exported alias for this type of `TypeMap`, `CloneAny`.
pub trait CloneAny: Any {
pub trait CloneAny: Any + Send + Sync {
#[doc(hidden)]
fn clone_any(&self) -> Box<CloneAny>;
#[doc(hidden)]
fn clone_any_send(&self) -> Box<CloneAny + Send> where Self: Send;
fn clone_any_send(&self) -> Box<CloneAny + Send>;
#[doc(hidden)]
fn clone_any_sync(&self) -> Box<CloneAny + Sync> where Self: Sync;
fn clone_any_sync(&self) -> Box<CloneAny + Sync>;
#[doc(hidden)]
fn clone_any_send_sync(&self) -> Box<CloneAny + Send + Sync> where Self: Send + Sync;
fn clone_any_send_sync(&self) -> Box<CloneAny + Send + Sync>;
}

impl<T: Any + Clone> CloneAny for T {
impl<T: Any + Clone + Send + Sync> CloneAny for T {
fn clone_any(&self) -> Box<CloneAny> { Box::new(self.clone()) }

fn clone_any_send(&self) -> Box<CloneAny + Send> where Self: Send {
fn clone_any_send(&self) -> Box<CloneAny + Send> {
Box::new(self.clone())
}

fn clone_any_sync(&self) -> Box<CloneAny + Sync> where Self: Sync {
fn clone_any_sync(&self) -> Box<CloneAny + Sync> {
Box::new(self.clone())
}

fn clone_any_send_sync(&self) -> Box<CloneAny + Send + Sync>
where Self: Send + Sync {
fn clone_any_send_sync(&self) -> Box<CloneAny + Send + Sync> {
Box::new(self.clone())
}
}
Expand Down