Skip to content
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

Rollup of 12 pull requests #66175

Merged
merged 41 commits into from
Nov 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
6bbe162
Optimize long-linker-command-line test
tmiasko Oct 28, 2019
df4e12d
uninit/zeroed lint: warn against NULL vtables
RalfJung Nov 2, 2019
7ff57ed
also identiy MaybeUninit::uninit().assume_init() as dangerous
RalfJung Nov 2, 2019
6515371
QPath docs: mention how to resolve them
RalfJung Nov 4, 2019
bb37d00
more robust method checking through DefId and diagnostic_item
RalfJung Nov 4, 2019
151e989
also explain how to resolve MethodCall
RalfJung Nov 4, 2019
d22a659
Do not require extra LLVM backends for `x.py test` to pass
petrochenkov Nov 4, 2019
82dc3aa
link from raw slice creation methods to safety requirements
RalfJung Nov 5, 2019
1a254e4
expand slice from_raw_part docs
RalfJung Nov 5, 2019
6a1f303
also edit String::from_raw_parts while we are at it
RalfJung Nov 5, 2019
002c1c7
Improve std::thread::Result documentation
golddranks Nov 5, 2019
b1d0a68
fix link to ptr docs
RalfJung Nov 5, 2019
3a54ab7
LinkedList: PhantomData<Box<Node<T>>> => PhantomData<T>
olegnn Nov 5, 2019
45f281d
Reverted PhantomData in LinkedList, fixed PhantomData markers in Rc a…
olegnn Nov 5, 2019
11a48a0
Apply suggestions from code review
RalfJung Nov 5, 2019
6a59319
Fixed libcore/cell.rs example
olegnn Nov 5, 2019
f1bc4ef
Addressed review comments.
golddranks Nov 6, 2019
1c7595f
gate rustc_on_unimplemented under rustc_attrs
Centril Oct 25, 2019
4317263
Fix the Error linking.
golddranks Nov 6, 2019
936349c
Update local.rs
3442853561 Nov 6, 2019
14ee66a
miri cast: avoid unnecessary to_scalar_ptr
RalfJung Nov 5, 2019
32453ce
remvoe to_scalar_ptr and use ref_to_mplace everywhere
RalfJung Nov 6, 2019
87edcf0
improve a comment
RalfJung Nov 6, 2019
2312a56
--bless
RalfJung Nov 6, 2019
f2ed1e6
Fix markdown link
RalfJung Nov 6, 2019
2daf7b9
Fix broken link in README
Darksonn Nov 6, 2019
8568204
Try with crate::error::Error
golddranks Nov 6, 2019
1d2a314
Update link on CONTRIBUTING.md
JohnTitor Nov 6, 2019
90b094a
Fix other broken link
JohnTitor Nov 6, 2019
082a076
Rollup merge of #65794 - Centril:unimpl-internal, r=varkor
JohnTitor Nov 7, 2019
1988f28
Rollup merge of #65945 - tmiasko:long-linker-command-line, r=alexcric…
JohnTitor Nov 7, 2019
12ffe5f
Rollup merge of #66044 - RalfJung:uninit-lint, r=oli-obk
JohnTitor Nov 7, 2019
a30964e
Rollup merge of #66076 - RalfJung:qpath, r=davidtwco,oli-obk
JohnTitor Nov 7, 2019
64b2f5c
Rollup merge of #66084 - petrochenkov:x86arm, r=alexcrichton
JohnTitor Nov 7, 2019
b94a2f9
Rollup merge of #66111 - RalfJung:from_raw_parts, r=Centril
JohnTitor Nov 7, 2019
3032233
Rollup merge of #66114 - golddranks:improve_thread_docs, r=Centril
JohnTitor Nov 7, 2019
a2b4ad4
Rollup merge of #66117 - olegnn:fixed_linked_list_marker, r=RalfJung
JohnTitor Nov 7, 2019
de40190
Rollup merge of #66146 - 3442853561:patch-2, r=Mark-Simulacrum
JohnTitor Nov 7, 2019
9e3f000
Rollup merge of #66147 - RalfJung:no-scalar-ptr, r=oli-obk
JohnTitor Nov 7, 2019
02de841
Rollup merge of #66162 - Darksonn:master, r=ehuss
JohnTitor Nov 7, 2019
b59d166
Rollup merge of #66171 - JohnTitor:update-link, r=ehuss
JohnTitor Nov 7, 2019
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
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ contributions to the compiler and the standard library. It also lists some
really useful commands to the build system (`./x.py`), which could save you a
lot of time.

[rustcguidebuild]: https://rust-lang.github.io/rustc-guide/how-to-build-and-run.html
[rustcguidebuild]: https://rust-lang.github.io/rustc-guide/building/how-to-build-and-run.html

## Pull Requests
[pull-requests]: #pull-requests
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The Rust build system has a Python script called `x.py` to bootstrap building
the compiler. More information about it may be found by running `./x.py --help`
or reading the [rustc guide][rustcguidebuild].

[rustcguidebuild]: https://rust-lang.github.io/rustc-guide/how-to-build-and-run.html
[rustcguidebuild]: https://rust-lang.github.io/rustc-guide/building/how-to-build-and-run.html

### Building on *nix
1. Make sure you have installed the dependencies:
Expand Down
154 changes: 0 additions & 154 deletions src/doc/unstable-book/src/language-features/on-unimplemented.md

This file was deleted.

2 changes: 1 addition & 1 deletion src/liballoc/collections/linked_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ impl<T> Clone for Iter<'_, T> {
#[stable(feature = "rust1", since = "1.0.0")]
pub struct IterMut<'a, T: 'a> {
// We do *not* exclusively own the entire list here, references to node's `element`
// have been handed out by the iterator! So be careful when using this; the methods
// have been handed out by the iterator! So be careful when using this; the methods
// called must be aware that there can be aliasing pointers to `element`.
list: &'a mut LinkedList<T>,
head: Option<NonNull<Node<T>>>,
Expand Down
2 changes: 1 addition & 1 deletion src/liballoc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
#![feature(unsize)]
#![feature(unsized_locals)]
#![feature(allocator_internals)]
#![feature(on_unimplemented)]
#![cfg_attr(bootstrap, feature(on_unimplemented))]
#![feature(rustc_const_unstable)]
#![feature(slice_partition_dedup)]
#![feature(maybe_uninit_extra, maybe_uninit_slice)]
Expand Down
2 changes: 1 addition & 1 deletion src/liballoc/rc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ struct RcBox<T: ?Sized> {
#[stable(feature = "rust1", since = "1.0.0")]
pub struct Rc<T: ?Sized> {
ptr: NonNull<RcBox<T>>,
phantom: PhantomData<T>,
phantom: PhantomData<RcBox<T>>,
}

#[stable(feature = "rust1", since = "1.0.0")]
Expand Down
2 changes: 1 addition & 1 deletion src/liballoc/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ impl String {
/// checked:
///
/// * The memory at `ptr` needs to have been previously allocated by the
/// same allocator the standard library uses.
/// same allocator the standard library uses, with a required alignment of exactly 1.
/// * `length` needs to be less than or equal to `capacity`.
/// * `capacity` needs to be the correct value.
///
Expand Down
2 changes: 1 addition & 1 deletion src/liballoc/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ const MAX_REFCOUNT: usize = (isize::MAX) as usize;
#[stable(feature = "rust1", since = "1.0.0")]
pub struct Arc<T: ?Sized> {
ptr: NonNull<ArcInner<T>>,
phantom: PhantomData<T>,
phantom: PhantomData<ArcInner<T>>,
}

#[stable(feature = "rust1", since = "1.0.0")]
Expand Down
9 changes: 7 additions & 2 deletions src/libcore/cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,11 @@
//! use std::cell::Cell;
//! use std::ptr::NonNull;
//! use std::intrinsics::abort;
//! use std::marker::PhantomData;
//!
//! struct Rc<T: ?Sized> {
//! ptr: NonNull<RcBox<T>>
//! ptr: NonNull<RcBox<T>>,
//! phantom: PhantomData<RcBox<T>>,
//! }
//!
//! struct RcBox<T: ?Sized> {
Expand All @@ -151,7 +153,10 @@
//! impl<T: ?Sized> Clone for Rc<T> {
//! fn clone(&self) -> Rc<T> {
//! self.inc_strong();
//! Rc { ptr: self.ptr }
//! Rc {
//! ptr: self.ptr,
//! phantom: PhantomData,
//! }
//! }
//! }
//!
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
#![feature(nll)]
#![feature(exhaustive_patterns)]
#![feature(no_core)]
#![feature(on_unimplemented)]
#![cfg_attr(bootstrap, feature(on_unimplemented))]
#![feature(optin_builtin_traits)]
#![feature(prelude_import)]
#![feature(repr_simd, platform_intrinsics)]
Expand Down
1 change: 1 addition & 0 deletions src/libcore/mem/maybe_uninit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,7 @@ impl<T> MaybeUninit<T> {
/// ```
#[stable(feature = "maybe_uninit", since = "1.36.0")]
#[inline(always)]
#[cfg_attr(all(not(bootstrap)), rustc_diagnostic_item = "assume_init")]
pub unsafe fn assume_init(self) -> T {
intrinsics::panic_if_uninhabited::<T>();
ManuallyDrop::into_inner(self.value)
Expand Down
23 changes: 18 additions & 5 deletions src/libcore/ptr/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
//! * A [null] pointer is *never* valid, not even for accesses of [size zero][zst].
//! * All pointers (except for the null pointer) are valid for all operations of
//! [size zero][zst].
//! * For a pointer to be valid, it is necessary, but not always sufficient, that the pointer
//! be *dereferencable*: the memory range of the given size starting at the pointer must all be
//! within the bounds of a single allocated object. Note that in Rust,
//! every (stack-allocated) variable is considered a separate allocated object.
//! * All accesses performed by functions in this module are *non-atomic* in the sense
//! of [atomic operations] used to synchronize between threads. This means it is
//! undefined behavior to perform two concurrent accesses to the same location from different
Expand Down Expand Up @@ -221,10 +225,15 @@ pub(crate) struct FatPtr<T> {
pub(crate) len: usize,
}

/// Forms a slice from a pointer and a length.
/// Forms a raw slice from a pointer and a length.
///
/// The `len` argument is the number of **elements**, not the number of bytes.
///
/// This function is safe, but actually using the return value is unsafe.
/// See the documentation of [`from_raw_parts`] for slice safety requirements.
///
/// [`from_raw_parts`]: ../../std/slice/fn.from_raw_parts.html
///
/// # Examples
///
/// ```rust
Expand All @@ -243,12 +252,16 @@ pub fn slice_from_raw_parts<T>(data: *const T, len: usize) -> *const [T] {
unsafe { Repr { raw: FatPtr { data, len } }.rust }
}

/// Performs the same functionality as [`from_raw_parts`], except that a
/// mutable slice is returned.
/// Performs the same functionality as [`slice_from_raw_parts`], except that a
/// raw mutable slice is returned, as opposed to a raw immutable slice.
///
/// See the documentation of [`from_raw_parts`] for more details.
/// See the documentation of [`slice_from_raw_parts`] for more details.
///
/// [`from_raw_parts`]: ../../std/slice/fn.from_raw_parts.html
/// This function is safe, but actually using the return value is unsafe.
/// See the documentation of [`from_raw_parts_mut`] for slice safety requirements.
///
/// [`slice_from_raw_parts`]: fn.slice_from_raw_parts.html
/// [`from_raw_parts_mut`]: ../../std/slice/fn.from_raw_parts_mut.html
#[inline]
#[unstable(feature = "slice_from_raw_parts", reason = "recently added", issue = "36925")]
pub fn slice_from_raw_parts_mut<T>(data: *mut T, len: usize) -> *mut [T] {
Expand Down
Loading