From 589e494c2e27317b93a35d4f75092f48b4a7f44c Mon Sep 17 00:00:00 2001 From: Markus Westerlind Date: Wed, 22 May 2019 20:34:10 +0200 Subject: [PATCH] Workaround rust-lang/rust#60444 --- completion/tests/suggest.rs | 1 - vm/src/gc.rs | 4 ++-- vm/src/value.rs | 5 +++++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/completion/tests/suggest.rs b/completion/tests/suggest.rs index 8ce6a3637c..3662c4b111 100644 --- a/completion/tests/suggest.rs +++ b/completion/tests/suggest.rs @@ -394,7 +394,6 @@ let { ab } = { x = 1, abc = "", abcd = 2 } fn find_gluon_root() -> PathBuf { use std::env; - use std::fs; let mut dir = env::current_dir().unwrap(); while fs::metadata(dir.join("std")).is_err() { dir = dir.parent().unwrap().into(); diff --git a/vm/src/gc.rs b/vm/src/gc.rs index 1045adeef6..45322d1a77 100644 --- a/vm/src/gc.rs +++ b/vm/src/gc.rs @@ -942,12 +942,12 @@ mod tests { impl PartialEq for Data_ { fn eq(&self, other: &Data_) -> bool { - self.fields.ptr == other.fields.ptr + self.fields.0 == other.fields.0 } } impl fmt::Debug for Data_ { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - self.fields.ptr.fmt(f) + self.fields.0.fmt(f) } } diff --git a/vm/src/value.rs b/vm/src/value.rs index 4a28f05c47..9c845a6b23 100644 --- a/vm/src/value.rs +++ b/vm/src/value.rs @@ -350,6 +350,11 @@ mod gc_str { #[derive(Copy, Clone, PartialEq)] pub struct GcStr(GcPtr); + // Needed due to https://github.com/rust-lang/rust/pull/60444, unsure if that is due to a bug + // or not + unsafe impl Send for GcStr {} + unsafe impl Sync for GcStr {} + impl fmt::Debug for GcStr { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_tuple("GcStr").field(&&**self).finish()