From 7fdcbce499990498bca38ebce6b215206dcbb591 Mon Sep 17 00:00:00 2001 From: limira <20672976+limira@users.noreply.github.com> Date: Mon, 2 Sep 2019 00:14:58 +0700 Subject: [PATCH 1/8] Replace file_stem by file_name in rustdoc markdown --- src/librustdoc/markdown.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustdoc/markdown.rs b/src/librustdoc/markdown.rs index a30fc05f36acd..401bd5f6e66c1 100644 --- a/src/librustdoc/markdown.rs +++ b/src/librustdoc/markdown.rs @@ -43,7 +43,7 @@ pub fn render( edition: Edition ) -> i32 { let mut output = options.output; - output.push(input.file_stem().unwrap()); + output.push(input.file_name().unwrap()); output.set_extension("html"); let mut css = String::new(); From db576f8103ed0cdda4e77d977c1eab8456233e11 Mon Sep 17 00:00:00 2001 From: Baoshan Pang Date: Sun, 1 Sep 2019 17:56:36 -0700 Subject: [PATCH 2/8] vxWorks: set DEFAULT_MIN_STACK_SIZE to 256K and use min_stack to pass initial stack size to rtpSpawn --- src/libstd/sys/vxworks/process/process_vxworks.rs | 6 ++++-- src/libstd/sys/vxworks/thread.rs | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/libstd/sys/vxworks/process/process_vxworks.rs b/src/libstd/sys/vxworks/process/process_vxworks.rs index b07966fa20626..12aa779746866 100644 --- a/src/libstd/sys/vxworks/process/process_vxworks.rs +++ b/src/libstd/sys/vxworks/process/process_vxworks.rs @@ -1,3 +1,5 @@ +// Copyright (c) 2019 Wind River Systems, Inc. + use crate::io::{self, Error, ErrorKind}; use libc::{self, c_int, c_char}; use libc::{RTP_ID}; @@ -5,6 +7,7 @@ use crate::sys; use crate::sys::cvt; use crate::sys::process::rtp; use crate::sys::process::process_common::*; +use crate::sys_common::thread; //////////////////////////////////////////////////////////////////////////////// // Command @@ -57,8 +60,7 @@ impl Command { self.get_argv().as_ptr() as *const _, // argv *sys::os::environ() as *const *const c_char, 100 as c_int, // initial priority - 0x16000, // initial stack size. 0 defaults - // to 0x4000 in 32 bit and 0x8000 in 64 bit + thread::min_stack(), // initial stack size. 0, // options 0 // task options ); diff --git a/src/libstd/sys/vxworks/thread.rs b/src/libstd/sys/vxworks/thread.rs index ef896f6a6e8cf..f9305afdeb6d1 100644 --- a/src/libstd/sys/vxworks/thread.rs +++ b/src/libstd/sys/vxworks/thread.rs @@ -1,3 +1,5 @@ +// Copyright (c) 2019 Wind River Systems, Inc. + use crate::cmp; use crate::ffi::CStr; use crate::io; @@ -8,7 +10,7 @@ use crate::time::Duration; use crate::sys_common::thread::*; -pub const DEFAULT_MIN_STACK_SIZE: usize = 2 * 1024 * 1024; +pub const DEFAULT_MIN_STACK_SIZE: usize = 0x40000; // 256K pub struct Thread { id: libc::pthread_t, From bb9d3bea30c354fecca5dae735bec62962fc5e4c Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 5 Sep 2019 11:55:20 -0700 Subject: [PATCH 3/8] rustc: Allow the cdylib crate type with wasm32-wasi The wasm32-wasi target respects configuration around `crt-static` in general, but is defaulted to being static. This interacted badly with code which validated the `cdylib` crate type for `wasm32-wasi`, erroneously saying that the `cdylib` crate type wasn't supported on `wasm32-wasi` by default. This commit sets the appropriate flag in `wasm32_wasi`'s target specification to indicate that the `cdylib` crate type is supported regardless of `crt-static` Closes #64187 --- src/librustc_target/spec/wasm32_wasi.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/librustc_target/spec/wasm32_wasi.rs b/src/librustc_target/spec/wasm32_wasi.rs index bb33493a77333..86978c05b15d0 100644 --- a/src/librustc_target/spec/wasm32_wasi.rs +++ b/src/librustc_target/spec/wasm32_wasi.rs @@ -97,6 +97,10 @@ pub fn target() -> Result { options.crt_static_default = true; options.crt_static_respected = true; + // Allow `+crt-static` to create a "cdylib" output which is just a wasm file + // without a main function. + options.crt_static_allows_dylibs = true; + Ok(Target { llvm_target: "wasm32-wasi".to_string(), target_endian: "little".to_string(), From d42e60331fb08efce78e7fc9739bf42620e51f8f Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Sun, 1 Sep 2019 14:10:50 +0300 Subject: [PATCH 4/8] Improve hygiene of `alloc::format!` --- src/liballoc/lib.rs | 6 ++++++ src/liballoc/macros.rs | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/liballoc/lib.rs b/src/liballoc/lib.rs index 4a48945adc37a..370e5cf4b303f 100644 --- a/src/liballoc/lib.rs +++ b/src/liballoc/lib.rs @@ -171,3 +171,9 @@ pub mod vec; mod std { pub use core::ops; // RangeFull } + +#[doc(hidden)] +#[unstable(feature = "liballoc_internals", issue = "0", reason = "implementation detail")] +pub mod __export { + pub use core::format_args; +} diff --git a/src/liballoc/macros.rs b/src/liballoc/macros.rs index 0b5e186d4c77b..2f2cdc39c633d 100644 --- a/src/liballoc/macros.rs +++ b/src/liballoc/macros.rs @@ -98,5 +98,5 @@ macro_rules! vec { #[macro_export] #[stable(feature = "rust1", since = "1.0.0")] macro_rules! format { - ($($arg:tt)*) => ($crate::fmt::format(::core::format_args!($($arg)*))) + ($($arg:tt)*) => ($crate::fmt::format($crate::__export::format_args!($($arg)*))) } From bdfab2049ce6bf67cb8557017d148960c534eb61 Mon Sep 17 00:00:00 2001 From: hman523 Date: Mon, 9 Sep 2019 18:50:11 -0500 Subject: [PATCH 5/8] Fixed documentation within c_str::from_ptr --- src/libstd/ffi/c_str.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libstd/ffi/c_str.rs b/src/libstd/ffi/c_str.rs index 65f4e0cafe09e..29d86e7146edc 100644 --- a/src/libstd/ffi/c_str.rs +++ b/src/libstd/ffi/c_str.rs @@ -935,8 +935,10 @@ impl CStr { /// Wraps a raw C string with a safe C string wrapper. /// /// This function will wrap the provided `ptr` with a `CStr` wrapper, which - /// allows inspection and interoperation of non-owned C strings. This method - /// is unsafe for a number of reasons: + /// allows inspection and interoperation of non-owned C strings. The total + /// size of the raw C string must be smaller than `isize::MAX` **bytes** + /// in memory due to calling the slice::from_raw_parts function. + /// This method is unsafe for a number of reasons: /// /// * There is no guarantee to the validity of `ptr`. /// * The returned lifetime is not guaranteed to be the actual lifetime of From 9b1456e4c5ebae855278ca6f5618915d6c7ad37e Mon Sep 17 00:00:00 2001 From: hman523 Date: Mon, 9 Sep 2019 20:09:17 -0500 Subject: [PATCH 6/8] Update added backticks around a function call Co-Authored-By: Mazdak Farrokhzad --- src/libstd/ffi/c_str.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libstd/ffi/c_str.rs b/src/libstd/ffi/c_str.rs index 29d86e7146edc..bb346fb4db515 100644 --- a/src/libstd/ffi/c_str.rs +++ b/src/libstd/ffi/c_str.rs @@ -937,7 +937,7 @@ impl CStr { /// This function will wrap the provided `ptr` with a `CStr` wrapper, which /// allows inspection and interoperation of non-owned C strings. The total /// size of the raw C string must be smaller than `isize::MAX` **bytes** - /// in memory due to calling the slice::from_raw_parts function. + /// in memory due to calling the `slice::from_raw_parts` function. /// This method is unsafe for a number of reasons: /// /// * There is no guarantee to the validity of `ptr`. From 7ad44c7c9c7feeca7df5358d7df26cc7cb10cf87 Mon Sep 17 00:00:00 2001 From: Arno Haase Date: Tue, 10 Sep 2019 14:18:16 +0200 Subject: [PATCH 7/8] documentation for AtomicPtr CAS operations --- src/libcore/sync/atomic.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/libcore/sync/atomic.rs b/src/libcore/sync/atomic.rs index 8dfb19fa03296..a73111571c2b0 100644 --- a/src/libcore/sync/atomic.rs +++ b/src/libcore/sync/atomic.rs @@ -979,9 +979,8 @@ impl AtomicPtr { /// let some_ptr = AtomicPtr::new(ptr); /// /// let other_ptr = &mut 10; - /// let another_ptr = &mut 10; /// - /// let value = some_ptr.compare_and_swap(other_ptr, another_ptr, Ordering::Relaxed); + /// let value = some_ptr.compare_and_swap(ptr, other_ptr, Ordering::Relaxed); /// ``` #[inline] #[stable(feature = "rust1", since = "1.0.0")] @@ -1021,9 +1020,8 @@ impl AtomicPtr { /// let some_ptr = AtomicPtr::new(ptr); /// /// let other_ptr = &mut 10; - /// let another_ptr = &mut 10; /// - /// let value = some_ptr.compare_exchange(other_ptr, another_ptr, + /// let value = some_ptr.compare_exchange(ptr, other_ptr, /// Ordering::SeqCst, Ordering::Relaxed); /// ``` #[inline] From 5318f98c06bc99292ea6241804a03b26eab8d8b5 Mon Sep 17 00:00:00 2001 From: Baoshan Pang Date: Tue, 10 Sep 2019 09:25:22 -0700 Subject: [PATCH 8/8] remove Copyright notic --- src/libstd/sys/vxworks/fast_thread_local.rs | 2 -- src/libstd/sys/vxworks/process/process_vxworks.rs | 2 -- src/libstd/sys/vxworks/thread.rs | 2 -- 3 files changed, 6 deletions(-) diff --git a/src/libstd/sys/vxworks/fast_thread_local.rs b/src/libstd/sys/vxworks/fast_thread_local.rs index 2e021980778e5..8b55939b8e54a 100644 --- a/src/libstd/sys/vxworks/fast_thread_local.rs +++ b/src/libstd/sys/vxworks/fast_thread_local.rs @@ -1,5 +1,3 @@ -// Copyright (c) 2019 Wind River Systems, Inc. - #![cfg(target_thread_local)] #![unstable(feature = "thread_local_internals", issue = "0")] diff --git a/src/libstd/sys/vxworks/process/process_vxworks.rs b/src/libstd/sys/vxworks/process/process_vxworks.rs index 12aa779746866..8780df17a1c7e 100644 --- a/src/libstd/sys/vxworks/process/process_vxworks.rs +++ b/src/libstd/sys/vxworks/process/process_vxworks.rs @@ -1,5 +1,3 @@ -// Copyright (c) 2019 Wind River Systems, Inc. - use crate::io::{self, Error, ErrorKind}; use libc::{self, c_int, c_char}; use libc::{RTP_ID}; diff --git a/src/libstd/sys/vxworks/thread.rs b/src/libstd/sys/vxworks/thread.rs index f9305afdeb6d1..e4396b05c0065 100644 --- a/src/libstd/sys/vxworks/thread.rs +++ b/src/libstd/sys/vxworks/thread.rs @@ -1,5 +1,3 @@ -// Copyright (c) 2019 Wind River Systems, Inc. - use crate::cmp; use crate::ffi::CStr; use crate::io;