Skip to content

Commit 6ed24ab

Browse files
The Miri Cronjob Botgitbot
The Miri Cronjob Bot
authored and
gitbot
committed
Merge from rustc
2 parents ac61ca8 + 609894c commit 6ed24ab

File tree

16 files changed

+451
-139
lines changed

16 files changed

+451
-139
lines changed

alloc/src/fmt.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,8 @@ pub use core::fmt::{Arguments, write};
596596
pub use core::fmt::{Binary, Octal};
597597
#[stable(feature = "rust1", since = "1.0.0")]
598598
pub use core::fmt::{Debug, Display};
599+
#[unstable(feature = "formatting_options", issue = "118117")]
600+
pub use core::fmt::{DebugAsHex, FormattingOptions, Sign};
599601
#[stable(feature = "rust1", since = "1.0.0")]
600602
pub use core::fmt::{DebugList, DebugMap, DebugSet, DebugStruct, DebugTuple};
601603
#[stable(feature = "rust1", since = "1.0.0")]

alloc/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@
117117
#![feature(extend_one_unchecked)]
118118
#![feature(fmt_internals)]
119119
#![feature(fn_traits)]
120+
#![feature(formatting_options)]
120121
#![feature(hasher_prefixfree_extras)]
121122
#![feature(inplace_iteration)]
122123
#![feature(iter_advance_by)]

alloc/src/string.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2682,7 +2682,8 @@ impl<T: fmt::Display + ?Sized> ToString for T {
26822682
#[inline]
26832683
default fn to_string(&self) -> String {
26842684
let mut buf = String::new();
2685-
let mut formatter = core::fmt::Formatter::new(&mut buf);
2685+
let mut formatter =
2686+
core::fmt::Formatter::new(&mut buf, core::fmt::FormattingOptions::new());
26862687
// Bypass format_args!() to avoid write_str with zero-length strs
26872688
fmt::Display::fmt(self, &mut formatter)
26882689
.expect("a Display implementation returned an error unexpectedly");

alloc/src/task.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,6 @@ fn raw_waker<W: Wake + Send + Sync + 'static>(waker: Arc<W>) -> RawWaker {
199199
///
200200
/// ```rust
201201
/// #![feature(local_waker)]
202-
/// #![feature(noop_waker)]
203202
/// use std::task::{LocalWake, ContextBuilder, LocalWaker, Waker};
204203
/// use std::future::Future;
205204
/// use std::pin::Pin;

alloc/src/vec/mod.rs

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3025,26 +3025,29 @@ impl<T: Clone, A: Allocator> Vec<T, A> {
30253025
self.spec_extend(other.iter())
30263026
}
30273027

3028-
/// Copies elements from `src` range to the end of the vector.
3028+
/// Given a range `src`, clones a slice of elements in that range and appends it to the end.
3029+
///
3030+
/// `src` must be a range that can form a valid subslice of the `Vec`.
30293031
///
30303032
/// # Panics
30313033
///
3032-
/// Panics if the starting point is greater than the end point or if
3033-
/// the end point is greater than the length of the vector.
3034+
/// Panics if starting index is greater than the end index
3035+
/// or if the index is greater than the length of the vector.
30343036
///
30353037
/// # Examples
30363038
///
30373039
/// ```
3038-
/// let mut vec = vec![0, 1, 2, 3, 4];
3039-
///
3040-
/// vec.extend_from_within(2..);
3041-
/// assert_eq!(vec, [0, 1, 2, 3, 4, 2, 3, 4]);
3040+
/// let mut characters = vec!['a', 'b', 'c', 'd', 'e'];
3041+
/// characters.extend_from_within(2..);
3042+
/// assert_eq!(characters, ['a', 'b', 'c', 'd', 'e', 'c', 'd', 'e']);
30423043
///
3043-
/// vec.extend_from_within(..2);
3044-
/// assert_eq!(vec, [0, 1, 2, 3, 4, 2, 3, 4, 0, 1]);
3044+
/// let mut numbers = vec![0, 1, 2, 3, 4];
3045+
/// numbers.extend_from_within(..2);
3046+
/// assert_eq!(numbers, [0, 1, 2, 3, 4, 0, 1]);
30453047
///
3046-
/// vec.extend_from_within(4..8);
3047-
/// assert_eq!(vec, [0, 1, 2, 3, 4, 2, 3, 4, 0, 1, 4, 2, 3, 4]);
3048+
/// let mut strings = vec![String::from("hello"), String::from("world"), String::from("!")];
3049+
/// strings.extend_from_within(1..=2);
3050+
/// assert_eq!(strings, ["hello", "world", "!", "world", "!"]);
30483051
/// ```
30493052
#[cfg(not(no_global_oom_handling))]
30503053
#[stable(feature = "vec_extend_from_within", since = "1.53.0")]

core/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ check-cfg = [
4343
'cfg(bootstrap)',
4444
'cfg(no_fp_fmt_parse)',
4545
'cfg(stdarch_intel_sde)',
46+
'cfg(target_arch, values("xtensa"))',
4647
# core use #[path] imports to portable-simd `core_simd` crate
4748
# and to stdarch `core_arch` crate which messes-up with Cargo list
4849
# of declared features, we therefor expect any feature cfg

core/src/ffi/va_list.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ use crate::ops::{Deref, DerefMut};
1515
not(target_arch = "aarch64"),
1616
not(target_arch = "powerpc"),
1717
not(target_arch = "s390x"),
18+
not(target_arch = "xtensa"),
1819
not(target_arch = "x86_64")
1920
),
2021
all(target_arch = "aarch64", target_vendor = "apple"),
@@ -37,6 +38,7 @@ pub struct VaListImpl<'f> {
3738
not(target_arch = "aarch64"),
3839
not(target_arch = "powerpc"),
3940
not(target_arch = "s390x"),
41+
not(target_arch = "xtensa"),
4042
not(target_arch = "x86_64")
4143
),
4244
all(target_arch = "aarch64", target_vendor = "apple"),
@@ -113,6 +115,18 @@ pub struct VaListImpl<'f> {
113115
_marker: PhantomData<&'f mut &'f c_void>,
114116
}
115117

118+
/// Xtensa ABI implementation of a `va_list`.
119+
#[cfg(target_arch = "xtensa")]
120+
#[repr(C)]
121+
#[derive(Debug)]
122+
#[lang = "va_list"]
123+
pub struct VaListImpl<'f> {
124+
stk: *mut i32,
125+
reg: *mut i32,
126+
ndx: i32,
127+
_marker: PhantomData<&'f mut &'f c_void>,
128+
}
129+
116130
/// A wrapper for a `va_list`
117131
#[repr(transparent)]
118132
#[derive(Debug)]
@@ -124,6 +138,7 @@ pub struct VaList<'a, 'f: 'a> {
124138
not(target_arch = "s390x"),
125139
not(target_arch = "x86_64")
126140
),
141+
target_arch = "xtensa",
127142
all(target_arch = "aarch64", target_vendor = "apple"),
128143
target_family = "wasm",
129144
target_os = "uefi",
@@ -138,6 +153,7 @@ pub struct VaList<'a, 'f: 'a> {
138153
target_arch = "s390x",
139154
target_arch = "x86_64"
140155
),
156+
not(target_arch = "xtensa"),
141157
any(not(target_arch = "aarch64"), not(target_vendor = "apple")),
142158
not(target_family = "wasm"),
143159
not(target_os = "uefi"),
@@ -155,6 +171,7 @@ pub struct VaList<'a, 'f: 'a> {
155171
not(target_arch = "s390x"),
156172
not(target_arch = "x86_64")
157173
),
174+
target_arch = "xtensa",
158175
all(target_arch = "aarch64", target_vendor = "apple"),
159176
target_family = "wasm",
160177
target_os = "uefi",
@@ -173,8 +190,10 @@ impl<'f> VaListImpl<'f> {
173190
target_arch = "aarch64",
174191
target_arch = "powerpc",
175192
target_arch = "s390x",
193+
target_arch = "xtensa",
176194
target_arch = "x86_64"
177195
),
196+
not(target_arch = "xtensa"),
178197
any(not(target_arch = "aarch64"), not(target_vendor = "apple")),
179198
not(target_family = "wasm"),
180199
not(target_os = "uefi"),

core/src/fmt/float.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ where
8686
true => flt2dec::Sign::MinusPlus,
8787
};
8888

89-
if let Some(precision) = fmt.precision {
89+
if let Some(precision) = fmt.options.precision {
9090
float_to_decimal_common_exact(fmt, num, sign, precision)
9191
} else {
9292
let min_precision = 0;
@@ -162,7 +162,7 @@ where
162162
true => flt2dec::Sign::MinusPlus,
163163
};
164164

165-
if let Some(precision) = fmt.precision {
165+
if let Some(precision) = fmt.options.precision {
166166
// 1 integral digit + `precision` fractional digits = `precision + 1` total digits
167167
float_to_exponential_common_exact(fmt, num, sign, precision + 1, upper)
168168
} else {
@@ -180,7 +180,7 @@ where
180180
true => flt2dec::Sign::MinusPlus,
181181
};
182182

183-
if let Some(precision) = fmt.precision {
183+
if let Some(precision) = fmt.options.precision {
184184
// this behavior of {:.PREC?} predates exponential formatting for {:?}
185185
float_to_decimal_common_exact(fmt, num, sign, precision)
186186
} else {

0 commit comments

Comments
 (0)