Skip to content

Commit 25a42b2

Browse files
committed
Auto merge of rust-lang#55746 - kennytm:rollup, r=kennytm
Rollup of 14 pull requests Successful merges: - rust-lang#55377 (Slight copy-editing for `std::cell::Cell` docs) - rust-lang#55441 (Remove unused re import in gdb_rust_pretty_printing) - rust-lang#55453 (Choose predicates without inference variables over those with them) - rust-lang#55495 (Don't print opt fuel messages to stdout because it breaks Rustbuild) - rust-lang#55501 (Make `process_obligations`' computation of `completed` optional.) - rust-lang#55510 (Fix feature gate only being checked on first repr attr.) - rust-lang#55609 (Run name-anon-globals after LTO passes as well) - rust-lang#55645 (do not print wrapping ranges like normal ranges in validity diagnostics) - rust-lang#55688 (Standardised names and location of ui issue tests) - rust-lang#55692 (-C remark: fix incorrect warning about requiring "--debuginfo" instead of "-C debuginfo=n") - rust-lang#55702 (Add `aarch64-pc-windows-msvc` to deployed targets) - rust-lang#55728 (Update lldb) - rust-lang#55730 (Use trait impl method span when type param mismatch is due to impl Trait) - rust-lang#55734 (refactor: use shorthand fields)
2 parents 8315b11 + 4e86576 commit 25a42b2

File tree

169 files changed

+505
-268
lines changed

Some content is hidden

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

169 files changed

+505
-268
lines changed

src/etc/gdb_rust_pretty_printing.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
# except according to those terms.
1010

1111
import gdb
12-
import re
1312
import sys
1413
import debugger_pretty_printers_common as rustpp
1514

src/liballoc/string.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ impl String {
502502
#[stable(feature = "rust1", since = "1.0.0")]
503503
pub fn from_utf8(vec: Vec<u8>) -> Result<String, FromUtf8Error> {
504504
match str::from_utf8(&vec) {
505-
Ok(..) => Ok(String { vec: vec }),
505+
Ok(..) => Ok(String { vec }),
506506
Err(e) => {
507507
Err(FromUtf8Error {
508508
bytes: vec,

src/libcore/cell.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,8 @@ use ptr;
207207
///
208208
/// # Examples
209209
///
210-
/// Here you can see how using `Cell<T>` allows to use mutable field inside
211-
/// immutable struct (which is also called 'interior mutability').
210+
/// In this example, you can see that `Cell<T>` enables mutation inside an
211+
/// immutable struct. In other words, it enables "interior mutability".
212212
///
213213
/// ```
214214
/// use std::cell::Cell;
@@ -225,10 +225,11 @@ use ptr;
225225
///
226226
/// let new_value = 100;
227227
///
228-
/// // ERROR, because my_struct is immutable
228+
/// // ERROR: `my_struct` is immutable
229229
/// // my_struct.regular_field = new_value;
230230
///
231-
/// // WORKS, although `my_struct` is immutable, field `special_field` is mutable because it is Cell
231+
/// // WORKS: although `my_struct` is immutable, `special_field` is a `Cell`,
232+
/// // which can always be mutated
232233
/// my_struct.special_field.set(new_value);
233234
/// assert_eq!(my_struct.special_field.get(), new_value);
234235
/// ```

src/libpanic_unwind/dwarf/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ struct Unaligned<T>(T);
2929

3030
impl DwarfReader {
3131
pub fn new(ptr: *const u8) -> DwarfReader {
32-
DwarfReader { ptr: ptr }
32+
DwarfReader { ptr }
3333
}
3434

3535
// DWARF streams are packed, so e.g. a u32 would not necessarily be aligned

src/libpanic_unwind/seh64_gnu.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ struct PanicData {
4141
}
4242

4343
pub unsafe fn panic(data: Box<dyn Any + Send>) -> u32 {
44-
let panic_ctx = Box::new(PanicData { data: data });
44+
let panic_ctx = Box::new(PanicData { data });
4545
let params = [Box::into_raw(panic_ctx) as c::ULONG_PTR];
4646
c::RaiseException(RUST_PANIC,
4747
c::EXCEPTION_NONCONTINUABLE,

src/librustc/infer/resolve.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub struct OpportunisticTypeResolver<'a, 'gcx: 'a+'tcx, 'tcx: 'a> {
2626

2727
impl<'a, 'gcx, 'tcx> OpportunisticTypeResolver<'a, 'gcx, 'tcx> {
2828
pub fn new(infcx: &'a InferCtxt<'a, 'gcx, 'tcx>) -> Self {
29-
OpportunisticTypeResolver { infcx: infcx }
29+
OpportunisticTypeResolver { infcx }
3030
}
3131
}
3232

@@ -54,7 +54,7 @@ pub struct OpportunisticTypeAndRegionResolver<'a, 'gcx: 'a+'tcx, 'tcx: 'a> {
5454

5555
impl<'a, 'gcx, 'tcx> OpportunisticTypeAndRegionResolver<'a, 'gcx, 'tcx> {
5656
pub fn new(infcx: &'a InferCtxt<'a, 'gcx, 'tcx>) -> Self {
57-
OpportunisticTypeAndRegionResolver { infcx: infcx }
57+
OpportunisticTypeAndRegionResolver { infcx }
5858
}
5959
}
6060

src/librustc/infer/type_variable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ impl<'tcx> TypeVariableTable<'tcx> {
169169
// Hack: we only need this so that `types_escaping_snapshot`
170170
// can see what has been unified; see the Delegate impl for
171171
// more details.
172-
self.values.record(Instantiate { vid: vid });
172+
self.values.record(Instantiate { vid });
173173
}
174174

175175
/// Creates a new type variable.

src/librustc/infer/unify_key.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ impl UnifyValue for RegionVidKey {
4343
value2.min_vid
4444
};
4545

46-
Ok(RegionVidKey { min_vid: min_vid })
46+
Ok(RegionVidKey { min_vid })
4747
}
4848
}
4949

src/librustc/middle/stability.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ impl<'a, 'tcx> Index<'tcx> {
469469
/// Cross-references the feature names of unstable APIs with enabled
470470
/// features and possibly prints errors.
471471
pub fn check_unstable_api_usage<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
472-
let mut checker = Checker { tcx: tcx };
472+
let mut checker = Checker { tcx };
473473
tcx.hir.krate().visit_all_item_likes(&mut checker.as_deep_visitor());
474474
}
475475

src/librustc/mir/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2986,7 +2986,7 @@ impl<'tcx> TypeFoldable<'tcx> for Terminator<'tcx> {
29862986
use mir::TerminatorKind::*;
29872987

29882988
let kind = match self.kind {
2989-
Goto { target } => Goto { target: target },
2989+
Goto { target } => Goto { target },
29902990
SwitchInt {
29912991
ref discr,
29922992
switch_ty,

0 commit comments

Comments
 (0)