Skip to content

Commit 66678e6

Browse files
committed
Auto merge of rust-lang#138548 - jieyouxu:rollup-xpslct5, r=jieyouxu
Rollup of 16 pull requests Successful merges: - rust-lang#133055 (Expand `CloneToUninit` documentation.) - rust-lang#137147 (Add exclude to config.toml) - rust-lang#137864 (Don't drop `Rvalue::WrapUnsafeBinder` during GVN) - rust-lang#137890 (doc: clarify that consume can be called after BufReader::peek) - rust-lang#137956 (Add RTN support to rustdoc) - rust-lang#137968 (Properly escape regexes in Python scripts) - rust-lang#138082 (Remove `#[cfg(not(test))]` gates in `core`) - rust-lang#138275 (expose `is_s390x_feature_detected!` from `std::arch`) - rust-lang#138303 (Fix Ptr inconsistency in {Rc,Arc}) - rust-lang#138309 (Add missing doc for intrinsic (Fix PR135334)) - rust-lang#138323 (Expand and organize `offset_of!` documentation.) - rust-lang#138329 (debug-assert that the size_hint is well-formed in `collect`) - rust-lang#138465 (linkchecker: bump html5ever) - rust-lang#138471 (Clean up some tests in tests/ui) - rust-lang#138472 (Add codegen test for rust-lang#129795) - rust-lang#138484 (Use lit span when suggesting suffix lit cast) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 9f274ba + f4372f5 commit 66678e6

File tree

77 files changed

+853
-382
lines changed

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

+853
-382
lines changed

Cargo.lock

+29-46
Original file line numberDiff line numberDiff line change
@@ -1548,16 +1548,14 @@ dependencies = [
15481548

15491549
[[package]]
15501550
name = "html5ever"
1551-
version = "0.27.0"
1551+
version = "0.29.2"
15521552
source = "registry+https://github.com/rust-lang/crates.io-index"
1553-
checksum = "c13771afe0e6e846f1e67d038d4cb29998a6779f93c809212e4e9c32efd244d4"
1553+
checksum = "9b958f80f0fde8601dc6c08685adc743eecaa046181cebd5a57551468dfc2ddc"
15541554
dependencies = [
15551555
"log",
15561556
"mac",
15571557
"markup5ever",
1558-
"proc-macro2",
1559-
"quote",
1560-
"syn 2.0.96",
1558+
"match_token",
15611559
]
15621560

15631561
[[package]]
@@ -2023,7 +2021,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
20232021
checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34"
20242022
dependencies = [
20252023
"cfg-if",
2026-
"windows-targets 0.52.6",
2024+
"windows-targets 0.48.5",
20272025
]
20282026

20292027
[[package]]
@@ -2134,9 +2132,9 @@ checksum = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4"
21342132

21352133
[[package]]
21362134
name = "markup5ever"
2137-
version = "0.12.1"
2135+
version = "0.15.0"
21382136
source = "registry+https://github.com/rust-lang/crates.io-index"
2139-
checksum = "16ce3abbeba692c8b8441d036ef91aea6df8da2c6b6e21c7e14d3c18e526be45"
2137+
checksum = "03a7b81dfb91586d0677086d40a6d755070e0799b71bb897485bac408dfd5c69"
21402138
dependencies = [
21412139
"log",
21422140
"phf",
@@ -2146,6 +2144,17 @@ dependencies = [
21462144
"tendril",
21472145
]
21482146

2147+
[[package]]
2148+
name = "match_token"
2149+
version = "0.1.0"
2150+
source = "registry+https://github.com/rust-lang/crates.io-index"
2151+
checksum = "88a9689d8d44bf9964484516275f5cd4c9b59457a6940c1d5d0ecbb94510a36b"
2152+
dependencies = [
2153+
"proc-macro2",
2154+
"quote",
2155+
"syn 2.0.96",
2156+
]
2157+
21492158
[[package]]
21502159
name = "matchers"
21512160
version = "0.1.0"
@@ -2628,7 +2637,7 @@ version = "0.11.3"
26282637
source = "registry+https://github.com/rust-lang/crates.io-index"
26292638
checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078"
26302639
dependencies = [
2631-
"phf_shared 0.11.3",
2640+
"phf_shared",
26322641
]
26332642

26342643
[[package]]
@@ -2637,18 +2646,8 @@ version = "0.11.3"
26372646
source = "registry+https://github.com/rust-lang/crates.io-index"
26382647
checksum = "aef8048c789fa5e851558d709946d6d79a8ff88c0440c587967f8e94bfb1216a"
26392648
dependencies = [
2640-
"phf_generator 0.11.3",
2641-
"phf_shared 0.11.3",
2642-
]
2643-
2644-
[[package]]
2645-
name = "phf_generator"
2646-
version = "0.10.0"
2647-
source = "registry+https://github.com/rust-lang/crates.io-index"
2648-
checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6"
2649-
dependencies = [
2650-
"phf_shared 0.10.0",
2651-
"rand 0.8.5",
2649+
"phf_generator",
2650+
"phf_shared",
26522651
]
26532652

26542653
[[package]]
@@ -2657,26 +2656,17 @@ version = "0.11.3"
26572656
source = "registry+https://github.com/rust-lang/crates.io-index"
26582657
checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d"
26592658
dependencies = [
2660-
"phf_shared 0.11.3",
2659+
"phf_shared",
26612660
"rand 0.8.5",
26622661
]
26632662

2664-
[[package]]
2665-
name = "phf_shared"
2666-
version = "0.10.0"
2667-
source = "registry+https://github.com/rust-lang/crates.io-index"
2668-
checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096"
2669-
dependencies = [
2670-
"siphasher 0.3.11",
2671-
]
2672-
26732663
[[package]]
26742664
name = "phf_shared"
26752665
version = "0.11.3"
26762666
source = "registry+https://github.com/rust-lang/crates.io-index"
26772667
checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5"
26782668
dependencies = [
2679-
"siphasher 1.0.1",
2669+
"siphasher",
26802670
]
26812671

26822672
[[package]]
@@ -4861,12 +4851,6 @@ version = "2.6.0"
48614851
source = "registry+https://github.com/rust-lang/crates.io-index"
48624852
checksum = "1de1d4f81173b03af4c0cbed3c898f6bff5b870e4a7f5d6f4057d62a7a4b686e"
48634853

4864-
[[package]]
4865-
name = "siphasher"
4866-
version = "0.3.11"
4867-
source = "registry+https://github.com/rust-lang/crates.io-index"
4868-
checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d"
4869-
48704854
[[package]]
48714855
name = "siphasher"
48724856
version = "1.0.1"
@@ -4981,26 +4965,25 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
49814965

49824966
[[package]]
49834967
name = "string_cache"
4984-
version = "0.8.7"
4968+
version = "0.8.8"
49854969
source = "registry+https://github.com/rust-lang/crates.io-index"
4986-
checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b"
4970+
checksum = "938d512196766101d333398efde81bc1f37b00cb42c2f8350e5df639f040bbbe"
49874971
dependencies = [
49884972
"new_debug_unreachable",
4989-
"once_cell",
49904973
"parking_lot",
4991-
"phf_shared 0.10.0",
4974+
"phf_shared",
49924975
"precomputed-hash",
49934976
"serde",
49944977
]
49954978

49964979
[[package]]
49974980
name = "string_cache_codegen"
4998-
version = "0.5.2"
4981+
version = "0.5.4"
49994982
source = "registry+https://github.com/rust-lang/crates.io-index"
5000-
checksum = "6bb30289b722be4ff74a408c3cc27edeaad656e06cb1fe8fa9231fa59c728988"
4983+
checksum = "c711928715f1fe0fe509c53b43e993a9a557babc2d0a3567d0a3006f1ac931a0"
50014984
dependencies = [
5002-
"phf_generator 0.10.0",
5003-
"phf_shared 0.10.0",
4985+
"phf_generator",
4986+
"phf_shared",
50044987
"proc-macro2",
50054988
"quote",
50064989
]

compiler/rustc_codegen_cranelift/patches/0027-stdlib-128bit-atomic-operations.patch

+11-13
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From ad7ffe71baba46865f2e65266ab025920dfdc20b Mon Sep 17 00:00:00 2001
1+
From 5d7c709608b01301d4628d2159265936d4440b67 Mon Sep 17 00:00:00 2001
22
From: bjorn3 <[email protected]>
33
Date: Thu, 18 Feb 2021 18:45:28 +0100
44
Subject: [PATCH] Disable 128bit atomic operations
@@ -7,11 +7,10 @@ Cranelift doesn't support them yet
77
---
88
library/core/src/panic/unwind_safe.rs | 6 -----
99
library/core/src/sync/atomic.rs | 38 ---------------------------
10-
library/core/tests/atomic.rs | 4 ---
11-
4 files changed, 4 insertions(+), 50 deletions(-)
10+
2 files changed, 44 deletions(-)
1211

1312
diff --git a/library/core/src/panic/unwind_safe.rs b/library/core/src/panic/unwind_safe.rs
14-
index 092b7cf..158cf71 100644
13+
index a60f0799c0e..af056fbf41f 100644
1514
--- a/library/core/src/panic/unwind_safe.rs
1615
+++ b/library/core/src/panic/unwind_safe.rs
1716
@@ -216,9 +216,6 @@ impl RefUnwindSafe for crate::sync::atomic::AtomicI32 {}
@@ -21,7 +20,7 @@ index 092b7cf..158cf71 100644
2120
-#[cfg(target_has_atomic_load_store = "128")]
2221
-#[unstable(feature = "integer_atomics", issue = "99069")]
2322
-impl RefUnwindSafe for crate::sync::atomic::AtomicI128 {}
24-
23+
2524
#[cfg(target_has_atomic_load_store = "ptr")]
2625
#[stable(feature = "unwind_safe_atomic_refs", since = "1.14.0")]
2726
@@ -235,9 +232,6 @@ impl RefUnwindSafe for crate::sync::atomic::AtomicU32 {}
@@ -31,14 +30,14 @@ index 092b7cf..158cf71 100644
3130
-#[cfg(target_has_atomic_load_store = "128")]
3231
-#[unstable(feature = "integer_atomics", issue = "99069")]
3332
-impl RefUnwindSafe for crate::sync::atomic::AtomicU128 {}
34-
33+
3534
#[cfg(target_has_atomic_load_store = "8")]
3635
#[stable(feature = "unwind_safe_atomic_refs", since = "1.14.0")]
3736
diff --git a/library/core/src/sync/atomic.rs b/library/core/src/sync/atomic.rs
38-
index d9de37e..8293fce 100644
37+
index bf2b6d59f88..d5ccce03bbf 100644
3938
--- a/library/core/src/sync/atomic.rs
4039
+++ b/library/core/src/sync/atomic.rs
41-
@@ -2996,44 +2996,6 @@ atomic_int! {
40+
@@ -3585,44 +3585,6 @@ pub const fn as_ptr(&self) -> *mut $int_type {
4241
8,
4342
u64 AtomicU64
4443
}
@@ -54,7 +53,7 @@ index d9de37e..8293fce 100644
5453
- unstable(feature = "integer_atomics", issue = "99069"),
5554
- rustc_const_unstable(feature = "integer_atomics", issue = "99069"),
5655
- rustc_const_unstable(feature = "integer_atomics", issue = "99069"),
57-
- cfg_attr(not(test), rustc_diagnostic_item = "AtomicI128"),
56+
- rustc_diagnostic_item = "AtomicI128",
5857
- "i128",
5958
- "#![feature(integer_atomics)]\n\n",
6059
- atomic_min, atomic_max,
@@ -73,7 +72,7 @@ index d9de37e..8293fce 100644
7372
- unstable(feature = "integer_atomics", issue = "99069"),
7473
- rustc_const_unstable(feature = "integer_atomics", issue = "99069"),
7574
- rustc_const_unstable(feature = "integer_atomics", issue = "99069"),
76-
- cfg_attr(not(test), rustc_diagnostic_item = "AtomicU128"),
75+
- rustc_diagnostic_item = "AtomicU128",
7776
- "u128",
7877
- "#![feature(integer_atomics)]\n\n",
7978
- atomic_umin, atomic_umax,
@@ -83,7 +82,6 @@ index d9de37e..8293fce 100644
8382

8483
#[cfg(target_has_atomic_load_store = "ptr")]
8584
macro_rules! atomic_int_ptr_sized {
86-
( $($target_pointer_width:literal $align:literal)* ) => { $(
87-
--
88-
2.26.2.7.g19db9cfb68
85+
--
86+
2.48.1
8987

compiler/rustc_hir_analysis/src/lib.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,9 @@ pub fn lower_ty<'tcx>(tcx: TyCtxt<'tcx>, hir_ty: &hir::Ty<'tcx>) -> Ty<'tcx> {
252252
// def-ID that will be used to determine the traits/predicates in
253253
// scope. This is derived from the enclosing item-like thing.
254254
let env_def_id = tcx.hir_get_parent_item(hir_ty.hir_id);
255-
collect::ItemCtxt::new(tcx, env_def_id.def_id).lower_ty(hir_ty)
255+
collect::ItemCtxt::new(tcx, env_def_id.def_id)
256+
.lowerer()
257+
.lower_ty_maybe_return_type_notation(hir_ty)
256258
}
257259

258260
/// This is for rustdoc.

compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -2983,7 +2983,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
29832983
return false;
29842984
}
29852985

2986-
let Ok(src) = self.tcx.sess.source_map().span_to_snippet(expr.span) else {
2986+
let span = if let hir::ExprKind::Lit(lit) = &expr.kind { lit.span } else { expr.span };
2987+
let Ok(src) = self.tcx.sess.source_map().span_to_snippet(span) else {
29872988
return false;
29882989
};
29892990

@@ -3078,10 +3079,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
30783079
// Remove fractional part from literal, for example `42.0f32` into `42`
30793080
let src = src.trim_end_matches(&checked_ty.to_string());
30803081
let len = src.split('.').next().unwrap().len();
3081-
expr.span.with_lo(expr.span.lo() + BytePos(len as u32))
3082+
span.with_lo(span.lo() + BytePos(len as u32))
30823083
} else {
30833084
let len = src.trim_end_matches(&checked_ty.to_string()).len();
3084-
expr.span.with_lo(expr.span.lo() + BytePos(len as u32))
3085+
span.with_lo(span.lo() + BytePos(len as u32))
30853086
},
30863087
if expr.precedence() < ExprPrecedence::Unambiguous {
30873088
// Readd `)`

compiler/rustc_mir_transform/src/gvn.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -872,8 +872,14 @@ impl<'body, 'tcx> VnState<'body, 'tcx> {
872872
self.simplify_place_projection(place, location);
873873
return self.new_pointer(*place, AddressKind::Address(mutbl));
874874
}
875-
Rvalue::WrapUnsafeBinder(ref mut op, _) => {
876-
return self.simplify_operand(op, location);
875+
Rvalue::WrapUnsafeBinder(ref mut op, ty) => {
876+
let value = self.simplify_operand(op, location)?;
877+
Value::Cast {
878+
kind: CastKind::Transmute,
879+
value,
880+
from: op.ty(self.local_decls, self.tcx),
881+
to: ty,
882+
}
877883
}
878884

879885
// Operations.

config.example.toml

+4
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,10 @@
446446
# a specific version.
447447
#ccache = false
448448

449+
# List of paths to exclude from the build and test processes.
450+
# For example, exclude = ["tests/ui", "src/tools/tidy"].
451+
#exclude = []
452+
449453
# =============================================================================
450454
# General install configuration options
451455
# =============================================================================

library/alloc/src/rc.rs

+23-11
Original file line numberDiff line numberDiff line change
@@ -1327,11 +1327,14 @@ impl<T: ?Sized> Rc<T> {
13271327
///
13281328
/// # Safety
13291329
///
1330-
/// The pointer must have been obtained through `Rc::into_raw`, the
1331-
/// associated `Rc` instance must be valid (i.e. the strong count must be at
1330+
/// The pointer must have been obtained through `Rc::into_raw` and must satisfy the
1331+
/// same layout requirements specified in [`Rc::from_raw_in`][from_raw_in].
1332+
/// The associated `Rc` instance must be valid (i.e. the strong count must be at
13321333
/// least 1) for the duration of this method, and `ptr` must point to a block of memory
13331334
/// allocated by the global allocator.
13341335
///
1336+
/// [from_raw_in]: Rc::from_raw_in
1337+
///
13351338
/// # Examples
13361339
///
13371340
/// ```
@@ -1360,12 +1363,15 @@ impl<T: ?Sized> Rc<T> {
13601363
///
13611364
/// # Safety
13621365
///
1363-
/// The pointer must have been obtained through `Rc::into_raw`, the
1364-
/// associated `Rc` instance must be valid (i.e. the strong count must be at
1366+
/// The pointer must have been obtained through `Rc::into_raw`and must satisfy the
1367+
/// same layout requirements specified in [`Rc::from_raw_in`][from_raw_in].
1368+
/// The associated `Rc` instance must be valid (i.e. the strong count must be at
13651369
/// least 1) when invoking this method, and `ptr` must point to a block of memory
13661370
/// allocated by the global allocator. This method can be used to release the final `Rc` and
13671371
/// backing storage, but **should not** be called after the final `Rc` has been released.
13681372
///
1373+
/// [from_raw_in]: Rc::from_raw_in
1374+
///
13691375
/// # Examples
13701376
///
13711377
/// ```
@@ -1623,10 +1629,13 @@ impl<T: ?Sized, A: Allocator> Rc<T, A> {
16231629
///
16241630
/// # Safety
16251631
///
1626-
/// The pointer must have been obtained through `Rc::into_raw`, the
1627-
/// associated `Rc` instance must be valid (i.e. the strong count must be at
1632+
/// The pointer must have been obtained through `Rc::into_raw` and must satisfy the
1633+
/// same layout requirements specified in [`Rc::from_raw_in`][from_raw_in].
1634+
/// The associated `Rc` instance must be valid (i.e. the strong count must be at
16281635
/// least 1) for the duration of this method, and `ptr` must point to a block of memory
1629-
/// allocated by `alloc`
1636+
/// allocated by `alloc`.
1637+
///
1638+
/// [from_raw_in]: Rc::from_raw_in
16301639
///
16311640
/// # Examples
16321641
///
@@ -1665,11 +1674,14 @@ impl<T: ?Sized, A: Allocator> Rc<T, A> {
16651674
///
16661675
/// # Safety
16671676
///
1668-
/// The pointer must have been obtained through `Rc::into_raw`, the
1669-
/// associated `Rc` instance must be valid (i.e. the strong count must be at
1677+
/// The pointer must have been obtained through `Rc::into_raw`and must satisfy the
1678+
/// same layout requirements specified in [`Rc::from_raw_in`][from_raw_in].
1679+
/// The associated `Rc` instance must be valid (i.e. the strong count must be at
16701680
/// least 1) when invoking this method, and `ptr` must point to a block of memory
1671-
/// allocated by `alloc`. This method can be used to release the final `Rc` and backing storage,
1672-
/// but **should not** be called after the final `Rc` has been released.
1681+
/// allocated by `alloc`. This method can be used to release the final `Rc` and
1682+
/// backing storage, but **should not** be called after the final `Rc` has been released.
1683+
///
1684+
/// [from_raw_in]: Rc::from_raw_in
16731685
///
16741686
/// # Examples
16751687
///

0 commit comments

Comments
 (0)