Skip to content

Commit 5a3292f

Browse files
committed
Auto merge of rust-lang#54021 - kennytm:rollup, r=kennytm
Rollup of 17 pull requests Successful merges: - rust-lang#53299 (Updated core/macros.rs to note it works in a no_std environment.) - rust-lang#53376 (Cross reference io::copy and fs::copy in docs.) - rust-lang#53455 (Individual docs for {from,to}_*_bytes) - rust-lang#53550 (librustc_lint: In recursion warning, change 'recurring' to 'recursing') - rust-lang#53860 (Migrate (some) of run-pass/ to ui) - rust-lang#53874 (Implement Unpin for Box, Rc, and Arc) - rust-lang#53895 (tidy: Cleanups and clippy warning fixes) - rust-lang#53946 (Clarify `ManuallyDrop` docs) - rust-lang#53948 (Minimized clippy test from when NLL disabled two-phase borrows) - rust-lang#53959 (Add .git extension to submodule paths missing it) - rust-lang#53966 (A few cleanups and minor improvements to mir/dataflow) - rust-lang#53967 (propagate build.python into cmake) - rust-lang#53979 (Remove `#[repr(transparent)]` from atomics) - rust-lang#53991 (Add unchecked_shl/shr check for intrinsics to fix miri's test suit) - rust-lang#53992 (migrate run-pass/borrowck to ui/run-pass) - rust-lang#53994 (migrate run-pass/*/ to ui/run-pass) - rust-lang#54023 (update clippy submodule)
2 parents 7366752 + 87fbf54 commit 5a3292f

File tree

2,828 files changed

+5510
-484
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,828 files changed

+5510
-484
lines changed

.gitmodules

+8-7
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
url = https://github.com/rust-lang-nursery/rls.git
2929
[submodule "src/libcompiler_builtins"]
3030
path = src/libcompiler_builtins
31-
url = https://github.com/rust-lang-nursery/compiler-builtins
31+
url = https://github.com/rust-lang-nursery/compiler-builtins.git
3232
[submodule "src/tools/clippy"]
3333
path = src/tools/clippy
3434
url = https://github.com/rust-lang-nursery/rust-clippy.git
@@ -43,24 +43,25 @@
4343
url = https://github.com/alexcrichton/dlmalloc-rs.git
4444
[submodule "src/doc/rust-by-example"]
4545
path = src/doc/rust-by-example
46-
url = https://github.com/rust-lang/rust-by-example
46+
url = https://github.com/rust-lang/rust-by-example.git
4747
[submodule "src/llvm-emscripten"]
4848
path = src/llvm-emscripten
49-
url = https://github.com/rust-lang/llvm
49+
url = https://github.com/rust-lang/llvm.git
5050
[submodule "src/stdsimd"]
5151
path = src/stdsimd
52-
url = https://github.com/rust-lang-nursery/stdsimd
52+
url = https://github.com/rust-lang-nursery/stdsimd.git
5353
[submodule "src/tools/lld"]
5454
path = src/tools/lld
5555
url = https://github.com/rust-lang/lld.git
5656
[submodule "src/libbacktrace"]
5757
path = src/libbacktrace
58-
url = https://github.com/rust-lang-nursery/libbacktrace
58+
url = https://github.com/rust-lang-nursery/libbacktrace.git
5959
[submodule "src/tools/lldb"]
6060
path = src/tools/lldb
61-
url = https://github.com/rust-lang-nursery/lldb/
61+
url = https://github.com/rust-lang-nursery/lldb.git
6262
branch = rust-release-80-v1
6363
[submodule "src/tools/clang"]
6464
path = src/tools/clang
65-
url = https://github.com/rust-lang-nursery/clang/
65+
url = https://github.com/rust-lang-nursery/clang.git
6666
branch = rust-release-80-v1
67+

src/Cargo.lock

+16
Original file line numberDiff line numberDiff line change
@@ -296,12 +296,14 @@ version = "0.0.212"
296296
dependencies = [
297297
"cargo_metadata 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
298298
"clippy-mini-macro-test 0.2.0",
299+
"clippy_dev 0.0.1",
299300
"clippy_lints 0.0.212",
300301
"compiletest_rs 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)",
301302
"derive-new 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
302303
"lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
303304
"regex 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
304305
"rustc-workspace-hack 1.0.0",
306+
"rustc_tools_util 0.1.0",
305307
"semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
306308
"serde 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)",
307309
"serde_derive 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -311,6 +313,16 @@ dependencies = [
311313
name = "clippy-mini-macro-test"
312314
version = "0.2.0"
313315

316+
[[package]]
317+
name = "clippy_dev"
318+
version = "0.0.1"
319+
dependencies = [
320+
"clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)",
321+
"itertools 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)",
322+
"lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
323+
"regex 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
324+
]
325+
314326
[[package]]
315327
name = "clippy_lints"
316328
version = "0.0.212"
@@ -2361,6 +2373,10 @@ dependencies = [
23612373
"serialize 0.0.0",
23622374
]
23632375

2376+
[[package]]
2377+
name = "rustc_tools_util"
2378+
version = "0.1.0"
2379+
23642380
[[package]]
23652381
name = "rustc_traits"
23662382
version = "0.0.0"

src/bootstrap/native.rs

+4
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,10 @@ impl Step for Llvm {
239239
cfg.define("LLVM_NATIVE_BUILD", builder.llvm_out(builder.config.build).join("build"));
240240
}
241241

242+
if let Some(ref python) = builder.config.python {
243+
cfg.define("PYTHON_EXECUTABLE", python);
244+
}
245+
242246
configure_cmake(builder, target, &mut cfg, false);
243247

244248
// FIXME: we don't actually need to build all LLVM tools and all LLVM

src/doc/rustc/src/lints/listing/warn-by-default.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -603,11 +603,11 @@ fn foo() {
603603
This will produce:
604604

605605
```text
606-
warning: function cannot return without recurring
606+
warning: function cannot return without recursing
607607
--> src/main.rs:1:1
608608
|
609609
1 | fn foo() {
610-
| ^^^^^^^^ cannot return without recurring
610+
| ^^^^^^^^ cannot return without recursing
611611
2 | foo();
612612
| ----- recursive call site
613613
|

src/liballoc/boxed.rs

+25
Original file line numberDiff line numberDiff line change
@@ -749,6 +749,31 @@ impl<T: ?Sized> AsMut<T> for Box<T> {
749749
}
750750
}
751751

752+
/* Nota bene
753+
*
754+
* We could have chosen not to add this impl, and instead have written a
755+
* function of Pin<Box<T>> to Pin<T>. Such a function would not be sound,
756+
* because Box<T> implements Unpin even when T does not, as a result of
757+
* this impl.
758+
*
759+
* We chose this API instead of the alternative for a few reasons:
760+
* - Logically, it is helpful to understand pinning in regard to the
761+
* memory region being pointed to. For this reason none of the
762+
* standard library pointer types support projecting through a pin
763+
* (Box<T> is the only pointer type in std for which this would be
764+
* safe.)
765+
* - It is in practice very useful to have Box<T> be unconditionally
766+
* Unpin because of trait objects, for which the structural auto
767+
* trait functionality does not apply (e.g. Box<dyn Foo> would
768+
* otherwise not be Unpin).
769+
*
770+
* Another type with the same semantics as Box but only a conditional
771+
* implementation of `Unpin` (where `T: Unpin`) would be valid/safe, and
772+
* could have a method to project a Pin<T> from it.
773+
*/
774+
#[unstable(feature = "pin", issue = "49150")]
775+
impl<T: ?Sized> Unpin for Box<T> { }
776+
752777
#[unstable(feature = "generator_trait", issue = "43122")]
753778
impl<T> Generator for Box<T>
754779
where T: Generator + ?Sized

src/liballoc/rc.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ use core::fmt;
252252
use core::hash::{Hash, Hasher};
253253
use core::intrinsics::abort;
254254
use core::marker;
255-
use core::marker::{Unsize, PhantomData};
255+
use core::marker::{Unpin, Unsize, PhantomData};
256256
use core::mem::{self, align_of_val, forget, size_of_val};
257257
use core::ops::Deref;
258258
use core::ops::CoerceUnsized;
@@ -1830,3 +1830,6 @@ impl<T: ?Sized> AsRef<T> for Rc<T> {
18301830
&**self
18311831
}
18321832
}
1833+
1834+
#[unstable(feature = "pin", issue = "49150")]
1835+
impl<T: ?Sized> Unpin for Rc<T> { }

src/liballoc/sync.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use core::mem::{self, align_of_val, size_of_val};
2727
use core::ops::Deref;
2828
use core::ops::CoerceUnsized;
2929
use core::ptr::{self, NonNull};
30-
use core::marker::{Unsize, PhantomData};
30+
use core::marker::{Unpin, Unsize, PhantomData};
3131
use core::hash::{Hash, Hasher};
3232
use core::{isize, usize};
3333
use core::convert::From;
@@ -1943,3 +1943,6 @@ impl<T: ?Sized> AsRef<T> for Arc<T> {
19431943
&**self
19441944
}
19451945
}
1946+
1947+
#[unstable(feature = "pin", issue = "49150")]
1948+
impl<T: ?Sized> Unpin for Arc<T> { }

src/libcore/macros.rs

+20
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,26 @@ macro_rules! try {
349349
/// write!(&mut v, "s = {:?}", s).unwrap(); // uses io::Write::write_fmt
350350
/// assert_eq!(v, b"s = \"abc 123\"");
351351
/// ```
352+
///
353+
/// Note: This macro can be used in `no_std` setups as well
354+
/// In a `no_std` setup you are responsible for the
355+
/// implementation details of the components.
356+
///
357+
/// ```no_run
358+
/// # extern crate core;
359+
/// use core::fmt::Write;
360+
///
361+
/// struct Example;
362+
///
363+
/// impl Write for Example {
364+
/// fn write_str(&mut self, _s: &str) -> core::fmt::Result {
365+
/// unimplemented!();
366+
/// }
367+
/// }
368+
///
369+
/// let mut m = Example{};
370+
/// write!(&mut m, "Hello World").expect("Not written");
371+
/// ```
352372
#[macro_export]
353373
#[stable(feature = "rust1", since = "1.0.0")]
354374
macro_rules! write {

src/libcore/mem.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -971,14 +971,16 @@ impl<T> ManuallyDrop<T> {
971971
ManuallyDrop { value }
972972
}
973973

974-
/// Extract the value from the ManuallyDrop container.
974+
/// Extract the value from the `ManuallyDrop` container.
975+
///
976+
/// This allows the value to be dropped again.
975977
///
976978
/// # Examples
977979
///
978980
/// ```rust
979981
/// use std::mem::ManuallyDrop;
980982
/// let x = ManuallyDrop::new(Box::new(()));
981-
/// let _: Box<()> = ManuallyDrop::into_inner(x);
983+
/// let _: Box<()> = ManuallyDrop::into_inner(x); // This drops the `Box`.
982984
/// ```
983985
#[stable(feature = "manually_drop", since = "1.20.0")]
984986
#[inline]
@@ -990,11 +992,15 @@ impl<T> ManuallyDrop<T> {
990992
impl<T: ?Sized> ManuallyDrop<T> {
991993
/// Manually drops the contained value.
992994
///
995+
/// If you have ownership of the value, you can use [`ManuallyDrop::into_inner`] instead.
996+
///
993997
/// # Safety
994998
///
995999
/// This function runs the destructor of the contained value and thus the wrapped value
9961000
/// now represents uninitialized data. It is up to the user of this method to ensure the
9971001
/// uninitialized data is not actually used.
1002+
///
1003+
/// [`ManuallyDrop::into_inner`]: #method.into_inner
9981004
#[stable(feature = "manually_drop", since = "1.20.0")]
9991005
#[inline]
10001006
pub unsafe fn drop(slot: &mut ManuallyDrop<T>) {

0 commit comments

Comments
 (0)