Skip to content

Commit ab08040

Browse files
committed
Merge ref 'd087f112b7d1:/library/compiler-builtins' from https://github.com/rust-lang/rust
Pull recent changes from rust-lang/rust via Josh. Upstream ref: d087f11 Filtered ref: 2d43ce8ac022170e5383f7e5a188b55564b6566a
2 parents 2beeeab + 8a585bf commit ab08040

Some content is hidden

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

111 files changed

+2005
-2512
lines changed

Cargo.lock

Lines changed: 32 additions & 47 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,4 @@ rustc-demangle.opt-level = "s"
5050
rustc-std-workspace-core = { path = 'rustc-std-workspace-core' }
5151
rustc-std-workspace-alloc = { path = 'rustc-std-workspace-alloc' }
5252
rustc-std-workspace-std = { path = 'rustc-std-workspace-std' }
53+
compiler_builtins = { path = "compiler-builtins/compiler-builtins" }

alloc/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ bench = false
1616

1717
[dependencies]
1818
core = { path = "../core", public = true }
19-
compiler_builtins = { version = "=0.1.160", features = ['rustc-dep-of-std'] }
19+
compiler_builtins = { path = "../compiler-builtins/compiler-builtins", features = ["rustc-dep-of-std"] }
2020

2121
[features]
2222
compiler-builtins-mem = ['compiler_builtins/mem']

alloc/src/collections/btree/map.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1416,18 +1416,18 @@ impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> {
14161416
///
14171417
/// # Examples
14181418
///
1419-
/// Splitting a map into even and odd keys, reusing the original map:
1420-
///
14211419
/// ```
14221420
/// #![feature(btree_extract_if)]
14231421
/// use std::collections::BTreeMap;
14241422
///
1423+
/// // Splitting a map into even and odd keys, reusing the original map:
14251424
/// let mut map: BTreeMap<i32, i32> = (0..8).map(|x| (x, x)).collect();
14261425
/// let evens: BTreeMap<_, _> = map.extract_if(.., |k, _v| k % 2 == 0).collect();
14271426
/// let odds = map;
14281427
/// assert_eq!(evens.keys().copied().collect::<Vec<_>>(), [0, 2, 4, 6]);
14291428
/// assert_eq!(odds.keys().copied().collect::<Vec<_>>(), [1, 3, 5, 7]);
14301429
///
1430+
/// // Splitting a map into low and high halves, reusing the original map:
14311431
/// let mut map: BTreeMap<i32, i32> = (0..8).map(|x| (x, x)).collect();
14321432
/// let low: BTreeMap<_, _> = map.extract_if(0..4, |_k, _v| true).collect();
14331433
/// let high = map;

alloc/src/collections/btree/set.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1201,21 +1201,21 @@ impl<T, A: Allocator + Clone> BTreeSet<T, A> {
12011201
/// [`retain`]: BTreeSet::retain
12021202
/// # Examples
12031203
///
1204-
/// Splitting a set into even and odd values, reusing the original set:
1205-
///
12061204
/// ```
12071205
/// #![feature(btree_extract_if)]
12081206
/// use std::collections::BTreeSet;
12091207
///
1208+
/// // Splitting a set into even and odd values, reusing the original set:
12101209
/// let mut set: BTreeSet<i32> = (0..8).collect();
12111210
/// let evens: BTreeSet<_> = set.extract_if(.., |v| v % 2 == 0).collect();
12121211
/// let odds = set;
12131212
/// assert_eq!(evens.into_iter().collect::<Vec<_>>(), vec![0, 2, 4, 6]);
12141213
/// assert_eq!(odds.into_iter().collect::<Vec<_>>(), vec![1, 3, 5, 7]);
12151214
///
1216-
/// let mut map: BTreeSet<i32> = (0..8).collect();
1217-
/// let low: BTreeSet<_> = map.extract_if(0..4, |_v| true).collect();
1218-
/// let high = map;
1215+
/// // Splitting a set into low and high halves, reusing the original set:
1216+
/// let mut set: BTreeSet<i32> = (0..8).collect();
1217+
/// let low: BTreeSet<_> = set.extract_if(0..4, |_v| true).collect();
1218+
/// let high = set;
12191219
/// assert_eq!(low.into_iter().collect::<Vec<_>>(), [0, 1, 2, 3]);
12201220
/// assert_eq!(high.into_iter().collect::<Vec<_>>(), [4, 5, 6, 7]);
12211221
/// ```

alloc/src/ffi/c_str.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,8 @@ impl ops::Deref for CString {
714714
}
715715
}
716716

717+
/// Delegates to the [`CStr`] implementation of [`fmt::Debug`],
718+
/// showing invalid UTF-8 as hex escapes.
717719
#[stable(feature = "rust1", since = "1.0.0")]
718720
impl fmt::Debug for CString {
719721
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {

alloc/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@
131131
#![feature(local_waker)]
132132
#![feature(maybe_uninit_slice)]
133133
#![feature(maybe_uninit_uninit_array_transpose)]
134-
#![feature(nonnull_provenance)]
135134
#![feature(panic_internals)]
136135
#![feature(pattern)]
137136
#![feature(pin_coerce_unsized_trait)]

alloc/src/slice.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,8 +493,6 @@ impl<T> [T] {
493493
///
494494
/// # Examples
495495
///
496-
/// Basic usage:
497-
///
498496
/// ```
499497
/// assert_eq!([1, 2].repeat(3), vec![1, 2, 1, 2, 1, 2]);
500498
/// ```

alloc/src/str.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,6 @@ impl str {
246246
///
247247
/// # Examples
248248
///
249-
/// Basic usage:
250-
///
251249
/// ```
252250
/// let s = "this is old";
253251
///
@@ -303,8 +301,6 @@ impl str {
303301
///
304302
/// # Examples
305303
///
306-
/// Basic usage:
307-
///
308304
/// ```
309305
/// let s = "foo foo 123 foo";
310306
/// assert_eq!("new new 123 foo", s.replacen("foo", "new", 2));

alloctests/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#![feature(iter_next_chunk)]
2929
#![feature(maybe_uninit_slice)]
3030
#![feature(maybe_uninit_uninit_array_transpose)]
31-
#![feature(nonnull_provenance)]
3231
#![feature(ptr_alignment_type)]
3332
#![feature(ptr_internals)]
3433
#![feature(sized_type_properties)]

alloctests/tests/slice.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1636,6 +1636,19 @@ fn test_chunk_by() {
16361636
assert_eq!(iter.next_back(), Some(&[1][..]));
16371637
assert_eq!(iter.next(), Some(&[2, 2, 2][..]));
16381638
assert_eq!(iter.next_back(), None);
1639+
1640+
let mut iter = slice.chunk_by(|a, b| a == b);
1641+
assert_eq!(iter.next(), Some(&[1, 1, 1][..]));
1642+
assert_eq!(iter.next(), Some(&[3, 3][..]));
1643+
let mut iter_clone = iter.clone();
1644+
assert_eq!(iter.next(), Some(&[2, 2, 2][..]));
1645+
assert_eq!(iter.next(), Some(&[1][..]));
1646+
assert_eq!(iter.next(), Some(&[0][..]));
1647+
assert_eq!(iter.next(), None);
1648+
assert_eq!(iter_clone.next(), Some(&[2, 2, 2][..]));
1649+
assert_eq!(iter_clone.next(), Some(&[1][..]));
1650+
assert_eq!(iter_clone.next(), Some(&[0][..]));
1651+
assert_eq!(iter_clone.next(), None);
16391652
}
16401653

16411654
#[test]

compiler-builtins/compiler-builtins/Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ doctest = false
1515
test = false
1616

1717
[dependencies]
18-
# For more information on this dependency see
19-
# https://github.com/rust-lang/rust/tree/master/library/rustc-std-workspace-core
20-
core = { version = "1.0.1", optional = true, package = "rustc-std-workspace-core" }
18+
core = { path = "../../core", optional = true }
2119

2220
[build-dependencies]
2321
cc = { optional = true, version = "1.2" }

0 commit comments

Comments
 (0)