summary refs log tree commit diff
path: root/gnu/packages/patches/rust-1.19-mrustc.patch
diff options
context:
space:
mode:
authorDanny Milosavljevic <dannym@scratchpost.org>2018-09-01 19:31:45 +0200
committerDanny Milosavljevic <dannym@scratchpost.org>2018-09-02 00:09:34 +0200
commit3159ef7c99c646b78b04cedb1bd3525c301ef978 (patch)
tree0834188aec24a4efcb4a76cb7cf013bac79d6ba6 /gnu/packages/patches/rust-1.19-mrustc.patch
parenta0a273c1eec438c80cf0c716987514e551b3b8f4 (diff)
downloadguix-3159ef7c99c646b78b04cedb1bd3525c301ef978.tar.gz
gnu: rust: Bootstrap (only) Rust 1.19.0 by mrustc.
* gnu/packages/patches/rust-1.19-mrustc.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/rust.scm (rust-1.19)[source]: Add patch
"rust-1.19-mrustc.patch".
[arguments]<#:modules>: New field.
<#:phases>[patch-cargo-tomls]: New phase.
<#:phases>[build]: Modify.
<#:phases>[install]: Modify.
[native-inputs]: Replace rust-bootstrap by mrustc.
(rust-1.23)[native-inputs]: New field.
[arguments]<#:phases>: Delete phase "patch-cargo-tomls".
Diffstat (limited to 'gnu/packages/patches/rust-1.19-mrustc.patch')
-rw-r--r--gnu/packages/patches/rust-1.19-mrustc.patch28
1 files changed, 28 insertions, 0 deletions
diff --git a/gnu/packages/patches/rust-1.19-mrustc.patch b/gnu/packages/patches/rust-1.19-mrustc.patch
new file mode 100644
index 0000000000..261162172e
--- /dev/null
+++ b/gnu/packages/patches/rust-1.19-mrustc.patch
@@ -0,0 +1,28 @@
+See https://github.com/thepowersgang/mrustc/archive/v0.8.0.tar.gz
+
+--- rustc-1.19.0-src-orig/src/libcore/intrinsics.rs
++++ rustc-1.19.0-src/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;
+
+--- rustc-1.19.0-src-orig/src/libcore/slice/mod.rs
++++ rustc-1.19.0-src/src/libcore/slice/mod.rs
+@@ -413,6 +413,8 @@
+     #[inline]
+     fn len(&self) -> usize {
+-        unsafe {
+-            mem::transmute::<&[T], Repr<T>>(self).len
+-        }
++        #[cfg(not(rust_compiler="mrustc"))]
++        let rv = unsafe { mem::transmute::<&[T], Repr<T>>(self).len };
++        #[cfg(rust_compiler="mrustc")]
++        let rv = unsafe { ::intrinsics::mrustc_slice_len(self) };
++        rv
+     }