Skip to content

Rollup of 2 pull requests #72316

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1439,9 +1439,9 @@ dependencies = [

[[package]]
name = "hermit-abi"
version = "0.1.12"
version = "0.1.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "61565ff7aaace3525556587bd2dc31d4a07071957be715e63ce7b1eccf51a8f4"
checksum = "91780f809e750b0a89f5544be56617ff6b1227ee485bcb06ebe10cdf89bd3b71"
dependencies = [
"compiler_builtins",
"libc",
Expand Down
2 changes: 2 additions & 0 deletions src/libcore/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1311,6 +1311,7 @@ extern "rust-intrinsic" {
///
/// The stabilized version of this intrinsic is
/// [`std::pointer::offset`](../../std/primitive.pointer.html#method.offset).
#[must_use = "returns a new pointer rather than modifying its argument"]
pub fn offset<T>(dst: *const T, offset: isize) -> *const T;

/// Calculates the offset from a pointer, potentially wrapping.
Expand All @@ -1327,6 +1328,7 @@ extern "rust-intrinsic" {
///
/// The stabilized version of this intrinsic is
/// [`std::pointer::wrapping_offset`](../../std/primitive.pointer.html#method.wrapping_offset).
#[must_use = "returns a new pointer rather than modifying its argument"]
pub fn arith_offset<T>(dst: *const T, offset: isize) -> *const T;

/// Equivalent to the appropriate `llvm.memcpy.p0i8.0i8.*` intrinsic, with
Expand Down
6 changes: 6 additions & 0 deletions src/libcore/ptr/const_ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ impl<T: ?Sized> *const T {
/// }
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[must_use = "returns a new pointer rather than modifying its argument"]
#[inline]
pub unsafe fn offset(self, count: isize) -> *const T
where
Expand Down Expand Up @@ -208,6 +209,7 @@ impl<T: ?Sized> *const T {
/// }
/// ```
#[stable(feature = "ptr_wrapping_offset", since = "1.16.0")]
#[must_use = "returns a new pointer rather than modifying its argument"]
#[inline]
pub fn wrapping_offset(self, count: isize) -> *const T
where
Expand Down Expand Up @@ -390,6 +392,7 @@ impl<T: ?Sized> *const T {
/// }
/// ```
#[stable(feature = "pointer_methods", since = "1.26.0")]
#[must_use = "returns a new pointer rather than modifying its argument"]
#[inline]
pub unsafe fn add(self, count: usize) -> Self
where
Expand Down Expand Up @@ -451,6 +454,7 @@ impl<T: ?Sized> *const T {
/// }
/// ```
#[stable(feature = "pointer_methods", since = "1.26.0")]
#[must_use = "returns a new pointer rather than modifying its argument"]
#[inline]
pub unsafe fn sub(self, count: usize) -> Self
where
Expand Down Expand Up @@ -506,6 +510,7 @@ impl<T: ?Sized> *const T {
/// }
/// ```
#[stable(feature = "pointer_methods", since = "1.26.0")]
#[must_use = "returns a new pointer rather than modifying its argument"]
#[inline]
pub fn wrapping_add(self, count: usize) -> Self
where
Expand Down Expand Up @@ -561,6 +566,7 @@ impl<T: ?Sized> *const T {
/// }
/// ```
#[stable(feature = "pointer_methods", since = "1.26.0")]
#[must_use = "returns a new pointer rather than modifying its argument"]
#[inline]
pub fn wrapping_sub(self, count: usize) -> Self
where
Expand Down
6 changes: 6 additions & 0 deletions src/libcore/ptr/mut_ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ impl<T: ?Sized> *mut T {
/// }
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[must_use = "returns a new pointer rather than modifying its argument"]
#[inline]
pub unsafe fn offset(self, count: isize) -> *mut T
where
Expand Down Expand Up @@ -201,6 +202,7 @@ impl<T: ?Sized> *mut T {
/// assert_eq!(&data, &[0, 2, 0, 4, 0]);
/// ```
#[stable(feature = "ptr_wrapping_offset", since = "1.16.0")]
#[must_use = "returns a new pointer rather than modifying its argument"]
#[inline]
pub fn wrapping_offset(self, count: isize) -> *mut T
where
Expand Down Expand Up @@ -436,6 +438,7 @@ impl<T: ?Sized> *mut T {
/// }
/// ```
#[stable(feature = "pointer_methods", since = "1.26.0")]
#[must_use = "returns a new pointer rather than modifying its argument"]
#[inline]
pub unsafe fn add(self, count: usize) -> Self
where
Expand Down Expand Up @@ -497,6 +500,7 @@ impl<T: ?Sized> *mut T {
/// }
/// ```
#[stable(feature = "pointer_methods", since = "1.26.0")]
#[must_use = "returns a new pointer rather than modifying its argument"]
#[inline]
pub unsafe fn sub(self, count: usize) -> Self
where
Expand Down Expand Up @@ -552,6 +556,7 @@ impl<T: ?Sized> *mut T {
/// }
/// ```
#[stable(feature = "pointer_methods", since = "1.26.0")]
#[must_use = "returns a new pointer rather than modifying its argument"]
#[inline]
pub fn wrapping_add(self, count: usize) -> Self
where
Expand Down Expand Up @@ -607,6 +612,7 @@ impl<T: ?Sized> *mut T {
/// }
/// ```
#[stable(feature = "pointer_methods", since = "1.26.0")]
#[must_use = "returns a new pointer rather than modifying its argument"]
#[inline]
pub fn wrapping_sub(self, count: usize) -> Self
where
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ dlmalloc = { version = "0.1", features = ['rustc-dep-of-std'] }
fortanix-sgx-abi = { version = "0.3.2", features = ['rustc-dep-of-std'] }

[target.'cfg(all(any(target_arch = "x86_64", target_arch = "aarch64"), target_os = "hermit"))'.dependencies]
hermit-abi = { version = "0.1.12", features = ['rustc-dep-of-std'] }
hermit-abi = { version = "0.1.13", features = ['rustc-dep-of-std'] }

[target.wasm32-wasi.dependencies]
wasi = { version = "0.9.0", features = ['rustc-dep-of-std'], default-features = false }
Expand Down
4 changes: 1 addition & 3 deletions src/libstd/sys/hermit/condvar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ impl Condvar {
Condvar { identifier: 0 }
}

#[inline]
pub unsafe fn init(&mut self) {
// nothing to do
let _ = abi::init_queue(self.id());
}

pub unsafe fn notify_one(&self) {
Expand Down Expand Up @@ -50,7 +49,6 @@ impl Condvar {
ret
}

#[inline]
pub unsafe fn destroy(&self) {
let _ = abi::destroy_queue(self.id());
}
Expand Down