Skip to content

Commit 71965ab

Browse files
committed
Auto merge of #84411 - m-ou-se:rollup-9btsp2t, r=m-ou-se
Rollup of 12 pull requests Successful merges: - #84013 (Replace all `fmt.pad` with `debug_struct`) - #84119 (Move `sys::vxworks` code to `sys::unix`) - #84212 (Replace `Void` in `sys` with never type) - #84251 (fix 'const-stable since' for NonZeroU*::new_unchecked) - #84301 (Document that `index` and `index_mut` can panic) - #84365 (Improve the docstrings of the `Lto` struct.) - #84378 (Fix broken doc link) - #84379 (Add GAT related tests) - #84380 (Write Rustdoc titles like "x in crate::mod - Rust") - #84390 (Format `Struct { .. }` on one line even with `{:#?}`.) - #84393 (Support `x.py doc std --open`) - #84406 (Remove `delete` alias from `mem::drop`.) Failed merges: - #84387 (Move `sys_common::poison` to `sync::poison`) r? `@ghost` `@rustbot` modify labels: rollup
2 parents c757729 + 268d29d commit 71965ab

Some content is hidden

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

77 files changed

+793
-589
lines changed

compiler/rustc_session/src/config.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,19 +75,21 @@ impl_stable_hash_via_hash!(OptLevel);
7575

7676
/// This is what the `LtoCli` values get mapped to after resolving defaults and
7777
/// and taking other command line options into account.
78+
///
79+
/// Note that linker plugin-based LTO is a different mechanism entirely.
7880
#[derive(Clone, PartialEq)]
7981
pub enum Lto {
80-
/// Don't do any LTO whatsoever
82+
/// Don't do any LTO whatsoever.
8183
No,
8284

83-
/// Do a full crate graph LTO with ThinLTO
85+
/// Do a full-crate-graph (inter-crate) LTO with ThinLTO.
8486
Thin,
8587

86-
/// Do a local graph LTO with ThinLTO (only relevant for multiple codegen
87-
/// units).
88+
/// Do a local ThinLTO (intra-crate, over the CodeGen Units of the local crate only). This is
89+
/// only relevant if multiple CGUs are used.
8890
ThinLocal,
8991

90-
/// Do a full crate graph LTO with "fat" LTO
92+
/// Do a full-crate-graph (inter-crate) LTO with "fat" LTO.
9193
Fat,
9294
}
9395

library/alloc/src/tests.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,17 @@ fn test_show() {
4949
let b = Box::new(Test) as Box<dyn Any>;
5050
let a_str = format!("{:?}", a);
5151
let b_str = format!("{:?}", b);
52-
assert_eq!(a_str, "Any");
53-
assert_eq!(b_str, "Any");
52+
assert_eq!(a_str, "Any { .. }");
53+
assert_eq!(b_str, "Any { .. }");
5454

5555
static EIGHT: usize = 8;
5656
static TEST: Test = Test;
5757
let a = &EIGHT as &dyn Any;
5858
let b = &TEST as &dyn Any;
5959
let s = format!("{:?}", a);
60-
assert_eq!(s, "Any");
60+
assert_eq!(s, "Any { .. }");
6161
let s = format!("{:?}", b);
62-
assert_eq!(s, "Any");
62+
assert_eq!(s, "Any { .. }");
6363
}
6464

6565
#[test]

library/core/src/any.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ impl<T: 'static + ?Sized> Any for T {
141141
#[stable(feature = "rust1", since = "1.0.0")]
142142
impl fmt::Debug for dyn Any {
143143
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
144-
f.pad("Any")
144+
f.debug_struct("Any").finish_non_exhaustive()
145145
}
146146
}
147147

@@ -151,14 +151,14 @@ impl fmt::Debug for dyn Any {
151151
#[stable(feature = "rust1", since = "1.0.0")]
152152
impl fmt::Debug for dyn Any + Send {
153153
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
154-
f.pad("Any")
154+
f.debug_struct("Any").finish_non_exhaustive()
155155
}
156156
}
157157

158158
#[stable(feature = "any_send_sync_methods", since = "1.28.0")]
159159
impl fmt::Debug for dyn Any + Send + Sync {
160160
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
161-
f.pad("Any")
161+
f.debug_struct("Any").finish_non_exhaustive()
162162
}
163163
}
164164

library/core/src/ascii.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,6 @@ impl fmt::Display for EscapeDefault {
145145
#[stable(feature = "std_debug", since = "1.16.0")]
146146
impl fmt::Debug for EscapeDefault {
147147
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
148-
f.pad("EscapeDefault { .. }")
148+
f.debug_struct("EscapeDefault").finish_non_exhaustive()
149149
}
150150
}

library/core/src/ffi.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ pub enum c_void {
5353
#[stable(feature = "std_debug", since = "1.16.0")]
5454
impl fmt::Debug for c_void {
5555
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
56-
f.pad("c_void")
56+
f.debug_struct("c_void").finish()
5757
}
5858
}
5959

library/core/src/fmt/builders.rs

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -188,28 +188,19 @@ impl<'a, 'b: 'a> DebugStruct<'a, 'b> {
188188
#[stable(feature = "debug_non_exhaustive", since = "1.53.0")]
189189
pub fn finish_non_exhaustive(&mut self) -> fmt::Result {
190190
self.result = self.result.and_then(|_| {
191-
// Draw non-exhaustive dots (`..`), and open brace if necessary (no fields).
192-
if self.is_pretty() {
193-
if !self.has_fields {
194-
self.fmt.write_str(" {\n")?;
195-
}
196-
let mut slot = None;
197-
let mut state = Default::default();
198-
let mut writer = PadAdapter::wrap(&mut self.fmt, &mut slot, &mut state);
199-
writer.write_str("..\n")?;
200-
} else {
201-
if self.has_fields {
202-
self.fmt.write_str(", ..")?;
191+
if self.has_fields {
192+
if self.is_pretty() {
193+
let mut slot = None;
194+
let mut state = Default::default();
195+
let mut writer = PadAdapter::wrap(&mut self.fmt, &mut slot, &mut state);
196+
writer.write_str("..\n")?;
197+
self.fmt.write_str("}")
203198
} else {
204-
self.fmt.write_str(" { ..")?;
199+
self.fmt.write_str(", .. }")
205200
}
206-
}
207-
if self.is_pretty() {
208-
self.fmt.write_str("}")?
209201
} else {
210-
self.fmt.write_str(" }")?;
202+
self.fmt.write_str(" { .. }")
211203
}
212-
Ok(())
213204
});
214205
self.result
215206
}

library/core/src/fmt/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2220,7 +2220,7 @@ impl Debug for () {
22202220
#[stable(feature = "rust1", since = "1.0.0")]
22212221
impl<T: ?Sized> Debug for PhantomData<T> {
22222222
fn fmt(&self, f: &mut Formatter<'_>) -> Result {
2223-
f.pad("PhantomData")
2223+
f.debug_struct("PhantomData").finish()
22242224
}
22252225
}
22262226

@@ -2270,7 +2270,7 @@ impl<T: ?Sized + Debug> Debug for RefMut<'_, T> {
22702270
#[stable(feature = "core_impl_debug", since = "1.9.0")]
22712271
impl<T: ?Sized> Debug for UnsafeCell<T> {
22722272
fn fmt(&self, f: &mut Formatter<'_>) -> Result {
2273-
f.pad("UnsafeCell")
2273+
f.debug_struct("UnsafeCell").finish_non_exhaustive()
22742274
}
22752275
}
22762276

library/core/src/hash/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ pub struct BuildHasherDefault<H>(marker::PhantomData<H>);
507507
#[stable(since = "1.9.0", feature = "core_impl_debug")]
508508
impl<H> fmt::Debug for BuildHasherDefault<H> {
509509
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
510-
f.pad("BuildHasherDefault")
510+
f.debug_struct("BuildHasherDefault").finish()
511511
}
512512
}
513513

library/core/src/iter/sources/empty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ unsafe impl<T> Sync for Empty<T> {}
3636
#[stable(feature = "core_impl_debug", since = "1.9.0")]
3737
impl<T> fmt::Debug for Empty<T> {
3838
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
39-
f.pad("Empty")
39+
f.debug_struct("Empty").finish()
4040
}
4141
}
4242

library/core/src/mem/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,6 @@ pub const fn replace<T>(dest: &mut T, src: T) -> T {
886886
/// ```
887887
///
888888
/// [`RefCell`]: crate::cell::RefCell
889-
#[doc(alias = "delete")]
890889
#[inline]
891890
#[stable(feature = "rust1", since = "1.0.0")]
892891
pub fn drop<T>(_x: T) {}

0 commit comments

Comments
 (0)