Skip to content

Commit 68fe518

Browse files
committed
Auto merge of #57354 - kennytm:rollup, r=kennytm
Rollup of 17 pull requests Successful merges: - #57219 (Remove some unused code) - #57229 (Fix #56806 by using `delay_span_bug` in object safety layout sanity checks) - #57233 (Rename and fix nolink-with-link-args test) - #57238 (Fix backtraces for inlined functions on Windows) - #57249 (Fix broken links to second edition TRPL.) - #57267 (src/jemalloc is gone, remove its mention from COPYRIGHT) - #57273 (Update the stdsimd submodule) - #57278 (Add Clippy to config.toml.example) - #57295 (Fix 'be be' constructs) - #57311 (VaList::copy should not require a mutable ref) - #57312 (`const fn` is no longer coming soon (const keyword docs)) - #57313 (Improve Box<T> -> Pin<Box<T>> conversion) - #57314 (Fix repeated word typos) - #57326 (Doc rewording, use the same name `writer`) - #57338 (rustdoc: force binary filename for compiled doctests) - #57342 (librustc_mir: Make qualify_min_const_fn module public) - #57343 (Calculate privacy access only via query) Failed merges: - #57340 (Use correct tracking issue for c_variadic) r? @ghost
2 parents 8c2d0f4 + d9885c4 commit 68fe518

File tree

122 files changed

+296
-339
lines changed

Some content is hidden

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

122 files changed

+296
-339
lines changed

COPYRIGHT

-32
Original file line numberDiff line numberDiff line change
@@ -229,35 +229,3 @@ their own copyright notices and license terms:
229229
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
230230
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
231231
OF SUCH DAMAGE. */
232-
233-
* jemalloc, under src/jemalloc:
234-
235-
Copyright (C) 2002-2014 Jason Evans
236-
<[email protected]>. All rights reserved.
237-
Copyright (C) 2007-2012 Mozilla Foundation.
238-
All rights reserved.
239-
Copyright (C) 2009-2014 Facebook, Inc.
240-
All rights reserved.
241-
242-
Redistribution and use in source and binary forms, with or without
243-
modification, are permitted provided that the following conditions are met:
244-
1. Redistributions of source code must retain the above copyright notice(s),
245-
this list of conditions and the following disclaimer.
246-
2. Redistributions in binary form must reproduce the above copyright notice(s),
247-
this list of conditions and the following disclaimer in the documentation
248-
and/or other materials provided with the distribution.
249-
250-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S)
251-
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
252-
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
253-
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
254-
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S)
255-
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
256-
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
257-
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
258-
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
259-
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
260-
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
261-
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
262-
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
263-
OF SUCH DAMAGE.

config.toml.example

+1-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@
171171

172172
# Installs chosen set of extended tools if enables. By default builds all.
173173
# If chosen tool failed to build the installation fails.
174-
#tools = ["cargo", "rls", "rustfmt", "analysis", "src"]
174+
#tools = ["cargo", "rls", "clippy", "rustfmt", "analysis", "src"]
175175

176176
# Verbosity level: 0 == not verbose, 1 == verbose, 2 == very verbose
177177
#verbose = 0

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

+13-13
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ warning: attempt to add with overflow
2424

2525
## dead-code
2626

27-
This lint detects detect unused, unexported items. Some
27+
This lint detects unused, unexported items. Some
2828
example code that triggers this lint:
2929

3030
```rust
@@ -44,7 +44,7 @@ warning: function is never used: `foo`
4444

4545
## deprecated
4646

47-
This lint detects detects use of deprecated items. Some
47+
This lint detects use of deprecated items. Some
4848
example code that triggers this lint:
4949

5050
```rust
@@ -119,7 +119,7 @@ warning: found struct without foreign-function-safe representation annotation in
119119

120120
## late-bound-lifetime-arguments
121121

122-
This lint detects detects generic lifetime arguments in path segments with
122+
This lint detects generic lifetime arguments in path segments with
123123
late bound lifetime parameters. Some example code that triggers this lint:
124124

125125
```rust
@@ -381,7 +381,7 @@ extern crate macro_crate_test;
381381

382382
## private-in-public
383383

384-
This lint detects detect private items in public interfaces not caught by the old implementation. Some
384+
This lint detects private items in public interfaces not caught by the old implementation. Some
385385
example code that triggers this lint:
386386

387387
```rust,ignore
@@ -659,7 +659,7 @@ warning: unknown lint: `not_a_real_lint`
659659

660660
## unreachable-code
661661

662-
This lint detects detects unreachable code paths. Some example code that
662+
This lint detects unreachable code paths. Some example code that
663663
triggers this lint:
664664

665665
```rust,no_run
@@ -681,7 +681,7 @@ warning: unreachable statement
681681

682682
## unreachable-patterns
683683

684-
This lint detects detects unreachable patterns. Some
684+
This lint detects unreachable patterns. Some
685685
example code that triggers this lint:
686686

687687
```rust
@@ -716,11 +716,11 @@ annotations now.
716716

717717
## unused-allocation
718718

719-
This lint detects detects unnecessary allocations that can be eliminated.
719+
This lint detects unnecessary allocations that can be eliminated.
720720

721721
## unused-assignments
722722

723-
This lint detects detect assignments that will never be read. Some
723+
This lint detects assignments that will never be read. Some
724724
example code that triggers this lint:
725725

726726
```rust
@@ -741,7 +741,7 @@ warning: value assigned to `x` is never read
741741

742742
## unused-attributes
743743

744-
This lint detects detects attributes that were not used by the compiler. Some
744+
This lint detects attributes that were not used by the compiler. Some
745745
example code that triggers this lint:
746746

747747
```rust
@@ -785,7 +785,7 @@ warning: comparison is useless due to type limits
785785

786786
## unused-doc-comment
787787

788-
This lint detects detects doc comments that aren't used by rustdoc. Some
788+
This lint detects doc comments that aren't used by rustdoc. Some
789789
example code that triggers this lint:
790790

791791
```rust
@@ -831,7 +831,7 @@ warning: unused import: `std::collections::HashMap`
831831

832832
## unused-macros
833833

834-
This lint detects detects macros that were not used. Some example code that
834+
This lint detects macros that were not used. Some example code that
835835
triggers this lint:
836836

837837
```rust
@@ -884,7 +884,7 @@ warning: unused `std::result::Result` that must be used
884884

885885
## unused-mut
886886

887-
This lint detects detect mut variables which don't need to be mutable. Some
887+
This lint detects mut variables which don't need to be mutable. Some
888888
example code that triggers this lint:
889889

890890
```rust
@@ -946,7 +946,7 @@ warning: unnecessary `unsafe` block
946946

947947
## unused-variables
948948

949-
This lint detects detect variables which are not used in any way. Some
949+
This lint detects variables which are not used in any way. Some
950950
example code that triggers this lint:
951951

952952
```rust

src/doc/rustdoc/src/documentation-tests.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ compiles, while only showing the parts that are relevant to that part of your
171171
explanation.
172172
173173
The `#`-hiding of lines can be prevented by using two consecutive hashes
174-
`##`. This only needs to be done with with the first `#` which would've
174+
`##`. This only needs to be done with the first `#` which would've
175175
otherwise caused hiding. If we have a string literal like the following,
176176
which has a line that starts with a `#`:
177177

src/liballoc/boxed.rs

+15-5
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,19 @@ impl<T: ?Sized> Box<T> {
257257
{
258258
unsafe { &mut *Box::into_raw(b) }
259259
}
260+
261+
/// Converts a `Box<T>` into a `Pin<Box<T>>`
262+
///
263+
/// This conversion does not allocate on the heap and happens in place.
264+
///
265+
/// This is also available via [`From`].
266+
#[unstable(feature = "box_into_pin", issue = "0")]
267+
pub fn into_pin(boxed: Box<T>) -> Pin<Box<T>> {
268+
// It's not possible to move or replace the insides of a `Pin<Box<T>>`
269+
// when `T: !Unpin`, so it's safe to pin it directly without any
270+
// additional requirements.
271+
unsafe { Pin::new_unchecked(boxed) }
272+
}
260273
}
261274

262275
#[stable(feature = "rust1", since = "1.0.0")]
@@ -451,15 +464,12 @@ impl<T> From<T> for Box<T> {
451464
}
452465

453466
#[stable(feature = "pin", since = "1.33.0")]
454-
impl<T> From<Box<T>> for Pin<Box<T>> {
467+
impl<T: ?Sized> From<Box<T>> for Pin<Box<T>> {
455468
/// Converts a `Box<T>` into a `Pin<Box<T>>`
456469
///
457470
/// This conversion does not allocate on the heap and happens in place.
458471
fn from(boxed: Box<T>) -> Self {
459-
// It's not possible to move or replace the insides of a `Pin<Box<T>>`
460-
// when `T: !Unpin`, so it's safe to pin it directly without any
461-
// additional requirements.
462-
unsafe { Pin::new_unchecked(boxed) }
472+
Box::into_pin(boxed)
463473
}
464474
}
465475

src/libcore/ffi.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ impl<'a> VaList<'a> {
186186
reason = "the `c_variadic` feature has not been properly tested on \
187187
all supported platforms",
188188
issue = "27745")]
189-
pub unsafe fn copy<F, R>(&mut self, f: F) -> R
189+
pub unsafe fn copy<F, R>(&self, f: F) -> R
190190
where F: for<'copy> FnOnce(VaList<'copy>) -> R {
191191
#[cfg(any(all(not(target_arch = "aarch64"), not(target_arch = "powerpc"),
192192
not(target_arch = "x86_64")),

src/libcore/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@
110110
#![feature(aarch64_target_feature)]
111111
#![feature(wasm_target_feature)]
112112
#![feature(avx512_target_feature)]
113+
#![cfg_attr(not(stage0), feature(cmpxchg16b_target_feature))]
113114
#![feature(const_slice_len)]
114115
#![feature(const_str_as_bytes)]
115116
#![feature(const_str_len)]

src/libcore/marker.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ impl<T: ?Sized> !Send for *mut T { }
8585
on(parent_trait="std::path::Path", label="borrow the `Path` instead"),
8686
message="the size for values of type `{Self}` cannot be known at compilation time",
8787
label="doesn't have a size known at compile-time",
88-
note="to learn more, visit <https://doc.rust-lang.org/book/second-edition/\
88+
note="to learn more, visit <https://doc.rust-lang.org/book/\
8989
ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>",
9090
)]
9191
#[fundamental] // for Default, for example, which requires that `[T]: !Default` be evaluatable

src/libcore/ops/deref.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
/// [book] as well as the reference sections on [the dereference operator]
2828
/// [ref-deref-op], [method resolution] and [type coercions].
2929
///
30-
/// [book]: ../../book/second-edition/ch15-02-deref.html
30+
/// [book]: ../../book/ch15-02-deref.html
3131
/// [`DerefMut`]: trait.DerefMut.html
3232
/// [more]: #more-on-deref-coercion
3333
/// [ref-deref-op]: ../../reference/expressions/operator-expr.html#the-dereference-operator
@@ -117,7 +117,7 @@ impl<T: ?Sized> Deref for &mut T {
117117
/// [book] as well as the reference sections on [the dereference operator]
118118
/// [ref-deref-op], [method resolution] and [type coercions].
119119
///
120-
/// [book]: ../../book/second-edition/ch15-02-deref.html
120+
/// [book]: ../../book/ch15-02-deref.html
121121
/// [`Deref`]: trait.Deref.html
122122
/// [more]: #more-on-deref-coercion
123123
/// [ref-deref-op]: ../../reference/expressions/operator-expr.html#the-dereference-operator

src/libcore/ops/drop.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
/// Refer to [the chapter on `Drop` in *The Rust Programming Language*][book]
1212
/// for some more elaboration.
1313
///
14-
/// [book]: ../../book/second-edition/ch15-03-drop.html
14+
/// [book]: ../../book/ch15-03-drop.html
1515
///
1616
/// # Examples
1717
///

src/libcore/ops/function.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
/// `Fn(usize, bool) -> usize`). Those interested in the technical details of
2828
/// this can refer to [the relevant section in the *Rustonomicon*][nomicon].
2929
///
30-
/// [book]: ../../book/second-edition/ch13-01-closures.html
30+
/// [book]: ../../book/ch13-01-closures.html
3131
/// [`FnMut`]: trait.FnMut.html
3232
/// [`FnOnce`]: trait.FnOnce.html
3333
/// [function pointers]: ../../std/primitive.fn.html
@@ -95,7 +95,7 @@ pub trait Fn<Args> : FnMut<Args> {
9595
/// `Fn(usize, bool) -> usize`). Those interested in the technical details of
9696
/// this can refer to [the relevant section in the *Rustonomicon*][nomicon].
9797
///
98-
/// [book]: ../../book/second-edition/ch13-01-closures.html
98+
/// [book]: ../../book/ch13-01-closures.html
9999
/// [`Fn`]: trait.Fn.html
100100
/// [`FnOnce`]: trait.FnOnce.html
101101
/// [function pointers]: ../../std/primitive.fn.html
@@ -173,7 +173,7 @@ pub trait FnMut<Args> : FnOnce<Args> {
173173
/// `Fn(usize, bool) -> usize`). Those interested in the technical details of
174174
/// this can refer to [the relevant section in the *Rustonomicon*][nomicon].
175175
///
176-
/// [book]: ../../book/second-edition/ch13-01-closures.html
176+
/// [book]: ../../book/ch13-01-closures.html
177177
/// [`Fn`]: trait.Fn.html
178178
/// [`FnMut`]: trait.FnMut.html
179179
/// [function pointers]: ../../std/primitive.fn.html

src/librustc/ich/impls_ty.rs

-16
Original file line numberDiff line numberDiff line change
@@ -477,22 +477,6 @@ impl_stable_hash_for!(enum mir::interpret::InboundsCheck {
477477
MaybeDead
478478
});
479479

480-
impl_stable_hash_for!(enum mir::interpret::Lock {
481-
NoLock,
482-
WriteLock(dl),
483-
ReadLock(v)
484-
});
485-
486-
impl_stable_hash_for!(struct mir::interpret::DynamicLifetime {
487-
frame,
488-
region
489-
});
490-
491-
impl_stable_hash_for!(enum mir::interpret::AccessKind {
492-
Read,
493-
Write
494-
});
495-
496480
impl_stable_hash_for!(enum ty::Variance {
497481
Covariant,
498482
Invariant,

src/librustc/infer/opaque_types/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pub type OpaqueTypeMap<'tcx> = DefIdMap<OpaqueTypeDecl<'tcx>>;
1919
/// appear in the return type).
2020
#[derive(Copy, Clone, Debug)]
2121
pub struct OpaqueTypeDecl<'tcx> {
22-
/// The substitutions that we apply to the abstract that that this
22+
/// The substitutions that we apply to the abstract that this
2323
/// `impl Trait` desugars to. e.g., if:
2424
///
2525
/// fn foo<'a, 'b, T>() -> impl Trait<'a>

src/librustc/lint/levels.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,8 @@ impl<'a> LintLevelsBuilder<'a> {
173173

174174
/// Pushes a list of AST lint attributes onto this context.
175175
///
176-
/// This function will return a `BuilderPush` object which should be be
177-
/// passed to `pop` when this scope for the attributes provided is exited.
176+
/// This function will return a `BuilderPush` object which should be passed
177+
/// to `pop` when this scope for the attributes provided is exited.
178178
///
179179
/// This function will perform a number of tasks:
180180
///

src/librustc/mir/interpret/mod.rs

-22
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ use mir;
2929
use hir::def_id::DefId;
3030
use ty::{self, TyCtxt, Instance};
3131
use ty::layout::{self, Size};
32-
use middle::region;
3332
use std::io;
3433
use rustc_serialize::{Encoder, Decodable, Encodable};
3534
use rustc_data_structures::fx::FxHashMap;
@@ -40,27 +39,6 @@ use ty::codec::TyDecoder;
4039
use std::sync::atomic::{AtomicU32, Ordering};
4140
use std::num::NonZeroU32;
4241

43-
#[derive(Clone, Debug, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable)]
44-
pub enum Lock {
45-
NoLock,
46-
WriteLock(DynamicLifetime),
47-
/// This should never be empty -- that would be a read lock held and nobody
48-
/// there to release it...
49-
ReadLock(Vec<DynamicLifetime>),
50-
}
51-
52-
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable)]
53-
pub struct DynamicLifetime {
54-
pub frame: usize,
55-
pub region: Option<region::Scope>, // "None" indicates "until the function ends"
56-
}
57-
58-
#[derive(Copy, Clone, Debug, PartialEq, Eq, RustcEncodable, RustcDecodable)]
59-
pub enum AccessKind {
60-
Read,
61-
Write,
62-
}
63-
6442
/// Uniquely identifies a specific constant or static.
6543
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash, RustcEncodable, RustcDecodable)]
6644
pub struct GlobalId<'tcx> {

src/librustc/mir/interpret/value.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ pub enum Scalar<Tag=(), Id=AllocId> {
7979
/// The raw bytes of a simple value.
8080
Bits {
8181
/// The first `size` bytes are the value.
82-
/// Do not try to read less or more bytes that that. The remaining bytes must be 0.
82+
/// Do not try to read less or more bytes than that. The remaining bytes must be 0.
8383
size: u8,
8484
bits: u128,
8585
},

src/librustc/session/config.rs

-4
Original file line numberDiff line numberDiff line change
@@ -1311,12 +1311,8 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
13111311
"Disable the instrumentation pre-inliner, useful for profiling / PGO."),
13121312
relro_level: Option<RelroLevel> = (None, parse_relro_level, [TRACKED],
13131313
"choose which RELRO level to use"),
1314-
nll_subminimal_causes: bool = (false, parse_bool, [UNTRACKED],
1315-
"when tracking region error causes, accept subminimal results for faster execution."),
13161314
nll_facts: bool = (false, parse_bool, [UNTRACKED],
13171315
"dump facts from NLL analysis into side files"),
1318-
disable_nll_user_type_assert: bool = (false, parse_bool, [UNTRACKED],
1319-
"disable user provided type assertion in NLL"),
13201316
nll_dont_emit_read_for_match: bool = (false, parse_bool, [UNTRACKED],
13211317
"in match codegen, do not include FakeRead statements (used by mir-borrowck)"),
13221318
dont_buffer_diagnostics: bool = (false, parse_bool, [UNTRACKED],

0 commit comments

Comments
 (0)