Skip to content

Commit

Permalink
Auto merge of #54021 - kennytm:rollup, r=kennytm
Browse files Browse the repository at this point in the history
Rollup of 17 pull requests

Successful merges:

 - #53299 (Updated core/macros.rs to note it works in a no_std environment.)
 - #53376 (Cross reference io::copy and fs::copy in docs.)
 - #53455 (Individual docs for {from,to}_*_bytes)
 - #53550 (librustc_lint: In recursion warning, change 'recurring' to 'recursing')
 - #53860 (Migrate (some) of run-pass/ to ui)
 - #53874 (Implement Unpin for Box, Rc, and Arc)
 - #53895 (tidy: Cleanups and clippy warning fixes)
 - #53946 (Clarify `ManuallyDrop` docs)
 - #53948 (Minimized clippy test from when NLL disabled two-phase borrows)
 - #53959 (Add .git extension to submodule paths missing it)
 - #53966 (A few cleanups and minor improvements to mir/dataflow)
 - #53967 (propagate build.python into cmake)
 - #53979 (Remove `#[repr(transparent)]` from atomics)
 - #53991 (Add unchecked_shl/shr check for intrinsics to fix miri's test suit)
 - #53992 (migrate run-pass/borrowck to ui/run-pass)
 - #53994 (migrate run-pass/*/ to ui/run-pass)
 - #54023 (update clippy submodule)
  • Loading branch information
bors committed Sep 7, 2018
2 parents 7366752 + 87fbf54 commit 5a3292f
Show file tree
Hide file tree
Showing 2,828 changed files with 5,510 additions and 484 deletions.
15 changes: 8 additions & 7 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
url = https://github.com/rust-lang-nursery/rls.git
[submodule "src/libcompiler_builtins"]
path = src/libcompiler_builtins
url = https://github.com/rust-lang-nursery/compiler-builtins
url = https://github.com/rust-lang-nursery/compiler-builtins.git
[submodule "src/tools/clippy"]
path = src/tools/clippy
url = https://github.com/rust-lang-nursery/rust-clippy.git
Expand All @@ -43,24 +43,25 @@
url = https://github.com/alexcrichton/dlmalloc-rs.git
[submodule "src/doc/rust-by-example"]
path = src/doc/rust-by-example
url = https://github.com/rust-lang/rust-by-example
url = https://github.com/rust-lang/rust-by-example.git
[submodule "src/llvm-emscripten"]
path = src/llvm-emscripten
url = https://github.com/rust-lang/llvm
url = https://github.com/rust-lang/llvm.git
[submodule "src/stdsimd"]
path = src/stdsimd
url = https://github.com/rust-lang-nursery/stdsimd
url = https://github.com/rust-lang-nursery/stdsimd.git
[submodule "src/tools/lld"]
path = src/tools/lld
url = https://github.com/rust-lang/lld.git
[submodule "src/libbacktrace"]
path = src/libbacktrace
url = https://github.com/rust-lang-nursery/libbacktrace
url = https://github.com/rust-lang-nursery/libbacktrace.git
[submodule "src/tools/lldb"]
path = src/tools/lldb
url = https://github.com/rust-lang-nursery/lldb/
url = https://github.com/rust-lang-nursery/lldb.git
branch = rust-release-80-v1
[submodule "src/tools/clang"]
path = src/tools/clang
url = https://github.com/rust-lang-nursery/clang/
url = https://github.com/rust-lang-nursery/clang.git
branch = rust-release-80-v1

16 changes: 16 additions & 0 deletions src/Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -296,12 +296,14 @@ version = "0.0.212"
dependencies = [
"cargo_metadata 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"clippy-mini-macro-test 0.2.0",
"clippy_dev 0.0.1",
"clippy_lints 0.0.212",
"compiletest_rs 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)",
"derive-new 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-workspace-hack 1.0.0",
"rustc_tools_util 0.1.0",
"semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)",
Expand All @@ -311,6 +313,16 @@ dependencies = [
name = "clippy-mini-macro-test"
version = "0.2.0"

[[package]]
name = "clippy_dev"
version = "0.0.1"
dependencies = [
"clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)",
"itertools 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "clippy_lints"
version = "0.0.212"
Expand Down Expand Up @@ -2361,6 +2373,10 @@ dependencies = [
"serialize 0.0.0",
]

[[package]]
name = "rustc_tools_util"
version = "0.1.0"

[[package]]
name = "rustc_traits"
version = "0.0.0"
Expand Down
4 changes: 4 additions & 0 deletions src/bootstrap/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,10 @@ impl Step for Llvm {
cfg.define("LLVM_NATIVE_BUILD", builder.llvm_out(builder.config.build).join("build"));
}

if let Some(ref python) = builder.config.python {
cfg.define("PYTHON_EXECUTABLE", python);
}

configure_cmake(builder, target, &mut cfg, false);

// FIXME: we don't actually need to build all LLVM tools and all LLVM
Expand Down
4 changes: 2 additions & 2 deletions src/doc/rustc/src/lints/listing/warn-by-default.md
Original file line number Diff line number Diff line change
Expand Up @@ -603,11 +603,11 @@ fn foo() {
This will produce:

```text
warning: function cannot return without recurring
warning: function cannot return without recursing
--> src/main.rs:1:1
|
1 | fn foo() {
| ^^^^^^^^ cannot return without recurring
| ^^^^^^^^ cannot return without recursing
2 | foo();
| ----- recursive call site
|
Expand Down
25 changes: 25 additions & 0 deletions src/liballoc/boxed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -749,6 +749,31 @@ impl<T: ?Sized> AsMut<T> for Box<T> {
}
}

/* Nota bene
*
* We could have chosen not to add this impl, and instead have written a
* function of Pin<Box<T>> to Pin<T>. Such a function would not be sound,
* because Box<T> implements Unpin even when T does not, as a result of
* this impl.
*
* We chose this API instead of the alternative for a few reasons:
* - Logically, it is helpful to understand pinning in regard to the
* memory region being pointed to. For this reason none of the
* standard library pointer types support projecting through a pin
* (Box<T> is the only pointer type in std for which this would be
* safe.)
* - It is in practice very useful to have Box<T> be unconditionally
* Unpin because of trait objects, for which the structural auto
* trait functionality does not apply (e.g. Box<dyn Foo> would
* otherwise not be Unpin).
*
* Another type with the same semantics as Box but only a conditional
* implementation of `Unpin` (where `T: Unpin`) would be valid/safe, and
* could have a method to project a Pin<T> from it.
*/
#[unstable(feature = "pin", issue = "49150")]
impl<T: ?Sized> Unpin for Box<T> { }

#[unstable(feature = "generator_trait", issue = "43122")]
impl<T> Generator for Box<T>
where T: Generator + ?Sized
Expand Down
5 changes: 4 additions & 1 deletion src/liballoc/rc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ use core::fmt;
use core::hash::{Hash, Hasher};
use core::intrinsics::abort;
use core::marker;
use core::marker::{Unsize, PhantomData};
use core::marker::{Unpin, Unsize, PhantomData};
use core::mem::{self, align_of_val, forget, size_of_val};
use core::ops::Deref;
use core::ops::CoerceUnsized;
Expand Down Expand Up @@ -1830,3 +1830,6 @@ impl<T: ?Sized> AsRef<T> for Rc<T> {
&**self
}
}

#[unstable(feature = "pin", issue = "49150")]
impl<T: ?Sized> Unpin for Rc<T> { }
5 changes: 4 additions & 1 deletion src/liballoc/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use core::mem::{self, align_of_val, size_of_val};
use core::ops::Deref;
use core::ops::CoerceUnsized;
use core::ptr::{self, NonNull};
use core::marker::{Unsize, PhantomData};
use core::marker::{Unpin, Unsize, PhantomData};
use core::hash::{Hash, Hasher};
use core::{isize, usize};
use core::convert::From;
Expand Down Expand Up @@ -1943,3 +1943,6 @@ impl<T: ?Sized> AsRef<T> for Arc<T> {
&**self
}
}

#[unstable(feature = "pin", issue = "49150")]
impl<T: ?Sized> Unpin for Arc<T> { }
20 changes: 20 additions & 0 deletions src/libcore/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,26 @@ macro_rules! try {
/// write!(&mut v, "s = {:?}", s).unwrap(); // uses io::Write::write_fmt
/// assert_eq!(v, b"s = \"abc 123\"");
/// ```
///
/// Note: This macro can be used in `no_std` setups as well
/// In a `no_std` setup you are responsible for the
/// implementation details of the components.
///
/// ```no_run
/// # extern crate core;
/// use core::fmt::Write;
///
/// struct Example;
///
/// impl Write for Example {
/// fn write_str(&mut self, _s: &str) -> core::fmt::Result {
/// unimplemented!();
/// }
/// }
///
/// let mut m = Example{};
/// write!(&mut m, "Hello World").expect("Not written");
/// ```
#[macro_export]
#[stable(feature = "rust1", since = "1.0.0")]
macro_rules! write {
Expand Down
10 changes: 8 additions & 2 deletions src/libcore/mem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -971,14 +971,16 @@ impl<T> ManuallyDrop<T> {
ManuallyDrop { value }
}

/// Extract the value from the ManuallyDrop container.
/// Extract the value from the `ManuallyDrop` container.
///
/// This allows the value to be dropped again.
///
/// # Examples
///
/// ```rust
/// use std::mem::ManuallyDrop;
/// let x = ManuallyDrop::new(Box::new(()));
/// let _: Box<()> = ManuallyDrop::into_inner(x);
/// let _: Box<()> = ManuallyDrop::into_inner(x); // This drops the `Box`.
/// ```
#[stable(feature = "manually_drop", since = "1.20.0")]
#[inline]
Expand All @@ -990,11 +992,15 @@ impl<T> ManuallyDrop<T> {
impl<T: ?Sized> ManuallyDrop<T> {
/// Manually drops the contained value.
///
/// If you have ownership of the value, you can use [`ManuallyDrop::into_inner`] instead.
///
/// # Safety
///
/// This function runs the destructor of the contained value and thus the wrapped value
/// now represents uninitialized data. It is up to the user of this method to ensure the
/// uninitialized data is not actually used.
///
/// [`ManuallyDrop::into_inner`]: #method.into_inner
#[stable(feature = "manually_drop", since = "1.20.0")]
#[inline]
pub unsafe fn drop(slot: &mut ManuallyDrop<T>) {
Expand Down
Loading

0 comments on commit 5a3292f

Please sign in to comment.