From e42b7877ac1f7c173d42600b220b1f50a143b9b4 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Wed, 3 Oct 2018 20:50:30 +0800 Subject: Fiddling for rustc 1.29 update --- rustc-1.19.0-src.patch | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 rustc-1.19.0-src.patch (limited to 'rustc-1.19.0-src.patch') diff --git a/rustc-1.19.0-src.patch b/rustc-1.19.0-src.patch new file mode 100644 index 00000000..1cc13242 --- /dev/null +++ b/rustc-1.19.0-src.patch @@ -0,0 +1,26 @@ +--- src/libcore/intrinsics.rs ++++ src/libcore/intrinsics.rs +@@ -678,5 +678,9 @@ + pub fn min_align_of_val(_: &T) -> usize; + ++ /// Obtain the length of a slice pointer ++ #[cfg(rust_compiler="mrustc")] ++ pub fn mrustc_slice_len(pointer: *const [T]) -> usize; ++ + /// Gets a static string slice containing the name of a type. + pub fn type_name() -> &'static str; + +--- src/libcore/slice/mod.rs ++++ src/libcore/slice/mod.rs +@@ -413,6 +413,8 @@ + #[inline] + fn len(&self) -> usize { +- unsafe { +- mem::transmute::<&[T], Repr>(self).len +- } ++ #[cfg(not(rust_compiler="mrustc"))] ++ let rv = unsafe { mem::transmute::<&[T], Repr>(self).len }; ++ #[cfg(rust_compiler="mrustc")] ++ let rv = unsafe { ::intrinsics::mrustc_slice_len(self) }; ++ rv + } -- cgit v1.2.3