summaryrefslogtreecommitdiff
path: root/rustc-1.29.0-src.patch
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2018-10-03 20:50:30 +0800
committerJohn Hodge <tpg@mutabah.net>2018-10-03 20:50:30 +0800
commite42b7877ac1f7c173d42600b220b1f50a143b9b4 (patch)
treeeeb7f627f831de64446c18bf108c5a1297f5ee13 /rustc-1.29.0-src.patch
parent9fe41ffb9bde218ad97c5430d6cc92051634357d (diff)
downloadmrust-e42b7877ac1f7c173d42600b220b1f50a143b9b4.tar.gz
Fiddling for rustc 1.29 update
Diffstat (limited to 'rustc-1.29.0-src.patch')
-rw-r--r--rustc-1.29.0-src.patch25
1 files changed, 25 insertions, 0 deletions
diff --git a/rustc-1.29.0-src.patch b/rustc-1.29.0-src.patch
new file mode 100644
index 00000000..df6ef8f5
--- /dev/null
+++ b/rustc-1.29.0-src.patch
@@ -0,0 +1,25 @@
+--- src/libcore/intrinsics.rs
++++ src/libcore/intrinsics.rs
+@@ -678,5 +678,9 @@
+ pub fn min_align_of_val<T: ?Sized>(_: &T) -> usize;
+
++ /// Obtain the length of a slice pointer
++ #[cfg(rust_compiler="mrustc")]
++ pub fn mrustc_slice_len<T>(pointer: *const [T]) -> usize;
++
+ /// Gets a static string slice containing the name of a type.
+ pub fn type_name<T: ?Sized>() -> &'static str;
+
+--- src/libcore/slice/mod.rs
++++ src/libcore/slice/mod.rs
+@@ -413,5 +413,7 @@
+ pub const fn len(&self) -> usize {
+- unsafe {
+- Repr { rust: self }.raw.len
+- }
++ #[cfg(not(rust_compiler="mrustc"))]
++ let rv = unsafe { Repr { rust: self }.raw.len };
++ #[cfg(rust_compiler="mrustc")]
++ let rv = unsafe { ::intrinsics::mrustc_slice_len(self) };
++ rv
+ }