Skip to content

Commit 0d6a7dd

Browse files
author
The Miri Cronjob Bot
committed
Merge from rustc
2 parents 0d63614 + a66bc79 commit 0d6a7dd

File tree

9 files changed

+20
-10
lines changed

9 files changed

+20
-10
lines changed

core/src/clone.rs

+3
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,9 @@ pub trait Clone: Sized {
160160
/// ```
161161
#[stable(feature = "rust1", since = "1.0.0")]
162162
#[must_use = "cloning is often expensive and is not expected to have side effects"]
163+
// Clone::clone is special because the compiler generates MIR to implement it for some types.
164+
// See InstanceKind::CloneShim.
165+
#[cfg_attr(not(bootstrap), lang = "clone_fn")]
163166
fn clone(&self) -> Self;
164167

165168
/// Performs copy-assignment from `source`.

core/src/fmt/builders.rs

+8-4
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,7 @@ impl<'a, 'b: 'a> DebugTuple<'a, 'b> {
402402
}
403403
}
404404

405+
/// A helper used to print list-like items with no special formatting.
405406
struct DebugInner<'a, 'b: 'a> {
406407
fmt: &'a mut fmt::Formatter<'b>,
407408
result: fmt::Result,
@@ -578,7 +579,8 @@ impl<'a, 'b: 'a> DebugSet<'a, 'b> {
578579
/// ```
579580
#[stable(feature = "debug_builders", since = "1.2.0")]
580581
pub fn finish(&mut self) -> fmt::Result {
581-
self.inner.result.and_then(|_| self.inner.fmt.write_str("}"))
582+
self.inner.result = self.inner.result.and_then(|_| self.inner.fmt.write_str("}"));
583+
self.inner.result
582584
}
583585
}
584586

@@ -721,7 +723,8 @@ impl<'a, 'b: 'a> DebugList<'a, 'b> {
721723
/// ```
722724
#[stable(feature = "debug_builders", since = "1.2.0")]
723725
pub fn finish(&mut self) -> fmt::Result {
724-
self.inner.result.and_then(|_| self.inner.fmt.write_str("]"))
726+
self.inner.result = self.inner.result.and_then(|_| self.inner.fmt.write_str("]"));
727+
self.inner.result
725728
}
726729
}
727730

@@ -1002,11 +1005,12 @@ impl<'a, 'b: 'a> DebugMap<'a, 'b> {
10021005
/// ```
10031006
#[stable(feature = "debug_builders", since = "1.2.0")]
10041007
pub fn finish(&mut self) -> fmt::Result {
1005-
self.result.and_then(|_| {
1008+
self.result = self.result.and_then(|_| {
10061009
assert!(!self.has_key, "attempted to finish a map with a partial entry");
10071010

10081011
self.fmt.write_str("}")
1009-
})
1012+
});
1013+
self.result
10101014
}
10111015

10121016
fn is_pretty(&self) -> bool {

core/src/iter/traits/iterator.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ pub trait Iterator {
823823
///
824824
/// Given an element the closure must return `true` or `false`. The returned
825825
/// iterator will yield only the elements for which the closure returns
826-
/// true.
826+
/// `true`.
827827
///
828828
/// # Examples
829829
///

core/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@
127127
#![feature(const_hash)]
128128
#![feature(const_heap)]
129129
#![feature(const_index_range_slice_index)]
130-
#![feature(const_int_from_str)]
131130
#![feature(const_intrinsic_copy)]
132131
#![feature(const_intrinsic_forget)]
133132
#![feature(const_ipv4)]

core/src/num/error.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ pub enum IntErrorKind {
113113
impl ParseIntError {
114114
/// Outputs the detailed cause of parsing an integer failing.
115115
#[must_use]
116-
#[rustc_const_unstable(feature = "const_int_from_str", issue = "59133")]
116+
#[rustc_const_stable(feature = "const_int_from_str", since = "CURRENT_RUSTC_VERSION")]
117117
#[stable(feature = "int_error_matching", since = "1.55.0")]
118118
pub const fn kind(&self) -> &IntErrorKind {
119119
&self.kind

core/src/num/mod.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1386,6 +1386,7 @@ from_str_radix_int_impl! { isize i8 i16 i32 i64 i128 usize u8 u16 u32 u64 u128 }
13861386
#[doc(hidden)]
13871387
#[inline(always)]
13881388
#[unstable(issue = "none", feature = "std_internals")]
1389+
#[rustc_const_stable(feature = "const_int_from_str", since = "CURRENT_RUSTC_VERSION")]
13891390
pub const fn can_not_overflow<T>(radix: u32, is_signed_ty: bool, digits: &[u8]) -> bool {
13901391
radix <= 16 && digits.len() <= mem::size_of::<T>() * 2 - is_signed_ty as usize
13911392
}
@@ -1435,7 +1436,7 @@ macro_rules! from_str_radix {
14351436
#[doc = concat!("assert_eq!(", stringify!($int_ty), "::from_str_radix(\"A\", 16), Ok(10));")]
14361437
/// ```
14371438
#[stable(feature = "rust1", since = "1.0.0")]
1438-
#[rustc_const_unstable(feature = "const_int_from_str", issue = "59133")]
1439+
#[rustc_const_stable(feature = "const_int_from_str", since = "CURRENT_RUSTC_VERSION")]
14391440
pub const fn from_str_radix(src: &str, radix: u32) -> Result<$int_ty, ParseIntError> {
14401441
use self::IntErrorKind::*;
14411442
use self::ParseIntError as PIE;
@@ -1565,7 +1566,7 @@ macro_rules! from_str_radix_size_impl {
15651566
#[doc = concat!("assert_eq!(", stringify!($size), "::from_str_radix(\"A\", 16), Ok(10));")]
15661567
/// ```
15671568
#[stable(feature = "rust1", since = "1.0.0")]
1568-
#[rustc_const_unstable(feature = "const_int_from_str", issue = "59133")]
1569+
#[rustc_const_stable(feature = "const_int_from_str", since = "CURRENT_RUSTC_VERSION")]
15691570
pub const fn from_str_radix(src: &str, radix: u32) -> Result<$size, ParseIntError> {
15701571
match <$t>::from_str_radix(src, radix) {
15711572
Ok(x) => Ok(x as $size),

core/tests/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#![feature(const_hash)]
1717
#![feature(const_heap)]
1818
#![feature(const_intrinsic_copy)]
19-
#![feature(const_int_from_str)]
2019
#![feature(const_maybe_uninit_as_mut_ptr)]
2120
#![feature(const_nonnull_new)]
2221
#![feature(const_pointer_is_aligned)]

rtstartup/rsbegin.rs

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ trait Copy {}
2929
#[lang = "freeze"]
3030
auto trait Freeze {}
3131

32+
impl<T: ?Sized> Copy for *mut T {}
33+
3234
#[lang = "drop_in_place"]
3335
#[inline]
3436
#[allow(unconditional_recursion)]

rtstartup/rsend.rs

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ trait Copy {}
1717
#[lang = "freeze"]
1818
auto trait Freeze {}
1919

20+
impl<T: ?Sized> Copy for *mut T {}
21+
2022
#[lang = "drop_in_place"]
2123
#[inline]
2224
#[allow(unconditional_recursion)]

0 commit comments

Comments
 (0)