Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
ac19dff
Updating str.chars docs to mention crates.io.
sdegutis Jan 23, 2020
5c962c7
Rename `FunctionRetTy` to `FnRetTy`
JohnTitor Feb 15, 2020
dcad07a
parser: `macro_rules` is a weak keyword
petrochenkov Feb 15, 2020
302b9e4
Improve #Safety in various methods in core::ptr
amosonn Feb 15, 2020
351782d
Improve #Safety of core::ptr::replace
amosonn Jan 31, 2020
40ca167
Improve #Safety in various methods in core::ptr
amosonn Jan 31, 2020
cadf9ef
Clean up E0309 explanation
GuillaumeGomez Feb 15, 2020
3300725
Fix running rustdoc-js test suite individually
ollie27 Feb 15, 2020
759526e
Fix printing of `Yield` terminator
jonas-schievink Feb 15, 2020
67068f3
macOS: avoid calling pthread_self() twice
kubo39 Feb 2, 2020
bb482eb
suspend -> yield
jonas-schievink Feb 16, 2020
943e653
Improve #Safety of core::ptr::drop_in_place
amosonn Feb 14, 2020
bec5d37
debug_assert a few more raw pointer methods
RalfJung Feb 16, 2020
d1a7ae7
Allow whitespaces in revision flags
JohnTitor Feb 16, 2020
6d919b5
Rollup merge of #68495 - sdegutis:patch-1, r=Mark-Simulacrum
JohnTitor Feb 16, 2020
e4192ac
Rollup merge of #68701 - amosonn:patch-2, r=RalfJung
JohnTitor Feb 16, 2020
4d2a325
Rollup merge of #68767 - kubo39:patch-macos, r=shepmaster
JohnTitor Feb 16, 2020
5eb634e
Rollup merge of #69179 - JohnTitor:rename-to-fnretty, r=Centril
JohnTitor Feb 16, 2020
ed186e8
Rollup merge of #69186 - petrochenkov:kwrules, r=Centril
JohnTitor Feb 16, 2020
9766340
Rollup merge of #69188 - GuillaumeGomez:clean-up-e0309, r=Dylan-DPC
JohnTitor Feb 16, 2020
53d4a87
Rollup merge of #69198 - ollie27:rustbuild_rustdoc-js, r=Mark-Simulacrum
JohnTitor Feb 16, 2020
0deb037
Rollup merge of #69200 - jonas-schievink:yield-print, r=eddyb,Zoxc
JohnTitor Feb 16, 2020
c8a2b43
Rollup merge of #69205 - JohnTitor:allow-whitespaces, r=Mark-Simulacrum
JohnTitor Feb 16, 2020
f34cf8d
Rollup merge of #69208 - RalfJung:debug-assert, r=Mark-Simulacrum
JohnTitor Feb 16, 2020
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
Prev Previous commit
Next Next commit
Improve #Safety in various methods in core::ptr
For all methods which read a value of type T, `read`, `read_unaligned`,
`read_volatile` and `replace`, added missing
constraint:
The value they point to must be properly initialized
  • Loading branch information
amosonn committed Feb 15, 2020
commit 40ca16794456e9b1520bba6d887a176395f127f0
8 changes: 8 additions & 0 deletions src/libcore/ptr/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,8 @@ unsafe fn swap_nonoverlapping_bytes(x: *mut u8, y: *mut u8, len: usize) {
///
/// * `dst` must be properly aligned.
///
/// * `dst` must point to a properly initialized value of type `T`.
///
/// Note that even if `T` has size `0`, the pointer must be non-NULL and properly aligned.
///
/// [valid]: ../ptr/index.html#safety
Expand Down Expand Up @@ -514,6 +516,8 @@ pub unsafe fn replace<T>(dst: *mut T, mut src: T) -> T {
/// * `src` must be properly aligned. Use [`read_unaligned`] if this is not the
/// case.
///
/// * `src` must point to a properly initialized value of type `T`.
///
/// Note that even if `T` has size `0`, the pointer must be non-NULL and properly aligned.
///
/// # Examples
Expand Down Expand Up @@ -628,6 +632,8 @@ pub unsafe fn read<T>(src: *const T) -> T {
///
/// * `src` must be [valid] for reads.
///
/// * `src` must point to a properly initialized value of type `T`.
///
/// Like [`read`], `read_unaligned` creates a bitwise copy of `T`, regardless of
/// whether `T` is [`Copy`]. If `T` is not [`Copy`], using both the returned
/// value and the value at `*src` can [violate memory safety][read-ownership].
Expand Down Expand Up @@ -922,6 +928,8 @@ pub unsafe fn write_unaligned<T>(dst: *mut T, src: T) {
///
/// * `src` must be properly aligned.
///
/// * `src` must point to a properly initialized value of type `T`.
///
/// Like [`read`], `read_volatile` creates a bitwise copy of `T`, regardless of
/// whether `T` is [`Copy`]. If `T` is not [`Copy`], using both the returned
/// value and the value at `*src` can [violate memory safety][read-ownership].
Expand Down