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 17 pull requests #54021

Merged
merged 82 commits into from
Sep 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
5f198a5
Cross reference io::copy and fs::copy in docs.
frewsxcv Aug 15, 2018
f4d6362
librustc_lint: In recursion warning, change 'recurring' to 'recursing'
brson Aug 21, 2018
c3bdd76
Implement Unpin for Box, Rc, and Arc
Aug 31, 2018
9ff29d6
Fix Rc impl.
Sep 1, 2018
cd51523
tidy: Use chars for single-character patterns
joshtriplett Sep 1, 2018
0f40a12
tidy: Use is_empty() instead of len tests
joshtriplett Sep 1, 2018
2893a21
tidy: Clean up argument handling
joshtriplett Sep 1, 2018
fb317aa
tidy: cargo.rs: Clean up loop to use "for" instead of "while let"
joshtriplett Sep 1, 2018
896c3ce
tidy: extdeps.rs: Clean up loop iteration to use "for"
joshtriplett Sep 1, 2018
decc3b0
tidy: extdeps.rs: Avoid an unnecessary collect()
joshtriplett Sep 1, 2018
cd20cdf
tidy: Use "const" instead of "static, and remove implied `'static` li…
joshtriplett Sep 1, 2018
226d79c
tidy: Avoid "let ref mut = ..."
joshtriplett Sep 1, 2018
40ea999
tidy: unstable_book.rs: Clean up directory iteration
joshtriplett Sep 2, 2018
fc3419c
tidy: deps: Hoist a complex multi-line if condition into a let
joshtriplett Sep 2, 2018
d5b1dee
tidy: Eliminate an unnecessary .into_iter()
joshtriplett Sep 2, 2018
87658bb
tidy: Use an inclusive range rather than a +1 bound
joshtriplett Sep 2, 2018
0e65aeb
tidy: features.rs: collect_lib_features: Simplify
joshtriplett Sep 2, 2018
ebdc1bd
tidy: features.rs: Use splitn rather than a complex slice
joshtriplett Sep 2, 2018
a5c86fe
tidy: features.rs: Remove a redundant .contains
joshtriplett Sep 2, 2018
0e62990
Clarify `ManuallyDrop` docs
tbu- Sep 4, 2018
6bde429
Minimized (and then greatly expanded) test of failure cases from rust…
pnkfelix Sep 4, 2018
482346c
Add .git extension to submodule paths missing it
tlively Sep 5, 2018
2ae2c62
Updated libcore/macro.rs to note write macro can work in no_std setups
MagnumOpus21 Aug 11, 2018
3ae6d06
Refined the example
MagnumOpus21 Aug 13, 2018
efb88b4
Formatting errors rectified
MagnumOpus21 Aug 13, 2018
6c66aeb
Prefixed no_run to the no_std write macro
MagnumOpus21 Aug 13, 2018
94e8a6a
Made the requested changes for Note: and no_std within backticks
MagnumOpus21 Aug 21, 2018
5e70394
Added a missing backtick to no std
MagnumOpus21 Aug 23, 2018
9d440d5
Spacing changes made to the example
MagnumOpus21 Sep 5, 2018
b7c0d32
A few cleanups and minor improvements to mir/dataflow
ljedrz Sep 5, 2018
62cd02d
propagate build.python into cmake
froydnj Sep 5, 2018
90b7c5a
Individual docs for {from,to}_*_bytes
llogiq Aug 17, 2018
c82af09
Add comment.
Sep 5, 2018
0338d34
Remove `#[repr(transparent)]` from atomics
alexcrichton Sep 5, 2018
3dab332
Merge branch 'master' into fix-submodules
tlively Sep 6, 2018
7834c22
Migrated slew of run-pass tests to various subdirectories of `ui/run-…
pnkfelix Aug 30, 2018
0909e0b
Add `// run-pass` annotations to all the tests under `ui/run-pass/`.
pnkfelix Aug 30, 2018
06f36a0
Move a bunch of auxiliary support files into `ui/run-pass/**/auxiliary`.
pnkfelix Aug 31, 2018
90241df
Remove references to a collection of unknown lints.
pnkfelix Aug 31, 2018
e462c1a
Add `#![allow(..)]` for a slew of lints of migrated run-pass tests, t…
pnkfelix Aug 31, 2018
8bcf37d
Add `#[allow(improper_ctypes)]` to slew of cases that need e.g. `repr…
pnkfelix Aug 31, 2018
d18b3bf
Add `#![allow(improper_ctypes)]` to extern-pass-empty.rs; note this t…
pnkfelix Aug 31, 2018
175d7f4
Add `.stderr` file for test where there are conflicting repr hints.
pnkfelix Aug 31, 2018
f78b9ad
Alpha-rename label to avoid the shadowing lint (which cannot be silen…
pnkfelix Aug 31, 2018
90412f1
Add `.stderr` files for shadowed labels where the point of the test i…
pnkfelix Aug 31, 2018
dc7685e
Update line numbers to reflect added lines at beginning of tests.
pnkfelix Aug 31, 2018
4a9e55e
Allow illegal_floating_point_literal_pattern. These will need to be u…
pnkfelix Aug 31, 2018
18a77ae
Allow uses of `#[unsafe_destructor_blind_to_params]`. Should be porte…
pnkfelix Aug 31, 2018
2bce9b0
Add `.stdout` file for test of `log_syntax!` and `trace_macros!`.
pnkfelix Aug 31, 2018
f97eea1
Add `.stderr` file for test that appears to trigger a lint that canno…
pnkfelix Aug 31, 2018
dc124e4
Add `#![allow(stable_features)]` to ease review.
pnkfelix Aug 31, 2018
5fe0851
Allow more lints, mainly overflowing_literals for cases that only aro…
pnkfelix Sep 4, 2018
58af73c
Add unchecked_shl/shr checks for intrinsics
Sep 6, 2018
65780bc
Migrated `src/test/run-pass/borrowck` to `src/test/ui/run-pass`.
pnkfelix Sep 3, 2018
4a7c8cc
Add `// run-pass` to collection of tests.
pnkfelix Sep 4, 2018
ff8f1a3
Allow some lints to let the ported run-pass/borrowck tests get through.
pnkfelix Sep 6, 2018
92dd526
Move check out of the match on the intrinsic name
Sep 6, 2018
76ceedd
Migrated remaining `src/test/run-pass/` subdirectories to `src/test/u…
pnkfelix Sep 6, 2018
f3b766d
Add `// run-pass` to collection of tests.
pnkfelix Sep 6, 2018
84a02e1
Allow various name convention lints.
pnkfelix Sep 6, 2018
8e72955
Allow unions_with_drop_fields for unions with members with destructors
pnkfelix Sep 6, 2018
4973094
Allow illegal_floating_point_literal_pattern. These will need to be u…
pnkfelix Sep 6, 2018
43eb925
Use binary_op_val instead of doing the check manually.
Sep 6, 2018
972cd8b
Fix typos.
Sep 6, 2018
10e7b76
update clippy submodule
matthiaskrgr Sep 7, 2018
846a0bd
Rollup merge of #53299 - MagnumOpus21:fix-macro-write, r=steveklabnik
kennytm Sep 7, 2018
654c578
Rollup merge of #53376 - frewsxcv:frewsxcv-copy, r=GuillaumeGomez
kennytm Sep 7, 2018
3f2de03
Rollup merge of #53455 - llogiq:num-byte-conversion-docs, r=steveklabnik
kennytm Sep 7, 2018
1805f3c
Rollup merge of #53550 - brson:recurring, r=estebank
kennytm Sep 7, 2018
3792dbd
Rollup merge of #53860 - pnkfelix:issue-53764-migrate-run-pass-to-ui,…
kennytm Sep 7, 2018
3c77043
Rollup merge of #53874 - withoutboats:pin-ptr-impls, r=RalfJung
kennytm Sep 7, 2018
d2a0f98
Rollup merge of #53895 - joshtriplett:tidy-tidy, r=nikomatsakis
kennytm Sep 7, 2018
03de1c4
Rollup merge of #53946 - tbu-:pr_doc_manuallydrop, r=cramertj
kennytm Sep 7, 2018
d70e055
Rollup merge of #53948 - pnkfelix:issue-52934-minimize-clippy-test, r…
kennytm Sep 7, 2018
7e9fb78
Rollup merge of #53959 - tlively:fix-submodules, r=alexcrichton
kennytm Sep 7, 2018
776b90c
Rollup merge of #53966 - ljedrz:mir_dataflow_cleanups, r=estebank
kennytm Sep 7, 2018
1681b15
Rollup merge of #53967 - froydnj:cmake-python-executable, r=alexcrichton
kennytm Sep 7, 2018
9b70ef7
Rollup merge of #53979 - alexcrichton:remove-repr-transparent-atomics…
kennytm Sep 7, 2018
dcca8e8
Rollup merge of #53991 - TimDiekmann:fix-unchecked-intrinsics, r=oli-obk
kennytm Sep 7, 2018
12b3826
Rollup merge of #53992 - pnkfelix:issue-53764-migrate-run-pass-borrow…
kennytm Sep 7, 2018
ba57ef1
Rollup merge of #53994 - pnkfelix:issue-53764-migrate-run-pass-dirs-t…
kennytm Sep 7, 2018
87fbf54
Rollup merge of #54023 - matthiaskrgr:clippy, r=oli-obk
kennytm Sep 7, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
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