Skip to content

Commit 1f44f0a

Browse files
committed
Auto merge of #130133 - workingjubilee:rollup-t5o827k, r=workingjubilee
Rollup of 14 pull requests Successful merges: - #119229 (Update mingw-w64 + GNU toolchain) - #128345 (added support for GNU/Hurd on x86_64) - #128667 (rustdoc: normalise type/field names) - #129876 (Use sysroot crates maximally in `rustc_codegen_gcc`.) - #130034 ( Fix enabling wasm-component-ld to match other tools ) - #130048 (run-make-support: Add llvm-pdbutil) - #130068 (Test codegen when setting deployment target) - #130070 (Rename variant `AddrOfRegion` of `RegionVariableOrigin` to `BorrowRegion`) - #130087 (remove 'const' from 'Option::iter') - #130090 (make Result::copied unstably const) - #130092 (Fixes typo in wasm32-wasip2 doc comment) - #130107 (const: make ptr.is_null() stop execution on ambiguity) - #130115 (Remove needless returns detected by clippy in libraries) - #130130 (Miri subtree update) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 263a3ae + 3e01a5d commit 1f44f0a

File tree

144 files changed

+1264
-979
lines changed

Some content is hidden

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

144 files changed

+1264
-979
lines changed

compiler/rustc_codegen_gcc/Cargo.lock

-176
Original file line numberDiff line numberDiff line change
@@ -11,63 +11,12 @@ dependencies = [
1111
"memchr",
1212
]
1313

14-
[[package]]
15-
name = "bitflags"
16-
version = "1.3.2"
17-
source = "registry+https://github.com/rust-lang/crates.io-index"
18-
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
19-
20-
[[package]]
21-
name = "bitflags"
22-
version = "2.4.0"
23-
source = "registry+https://github.com/rust-lang/crates.io-index"
24-
checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635"
25-
2614
[[package]]
2715
name = "boml"
2816
version = "0.3.1"
2917
source = "registry+https://github.com/rust-lang/crates.io-index"
3018
checksum = "85fdb93f04c73bff54305fa437ffea5449c41edcaadfe882f35836206b166ac5"
3119

32-
[[package]]
33-
name = "cc"
34-
version = "1.0.79"
35-
source = "registry+https://github.com/rust-lang/crates.io-index"
36-
checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f"
37-
38-
[[package]]
39-
name = "cfg-if"
40-
version = "1.0.0"
41-
source = "registry+https://github.com/rust-lang/crates.io-index"
42-
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
43-
44-
[[package]]
45-
name = "errno"
46-
version = "0.3.1"
47-
source = "registry+https://github.com/rust-lang/crates.io-index"
48-
checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a"
49-
dependencies = [
50-
"errno-dragonfly",
51-
"libc",
52-
"windows-sys",
53-
]
54-
55-
[[package]]
56-
name = "errno-dragonfly"
57-
version = "0.1.2"
58-
source = "registry+https://github.com/rust-lang/crates.io-index"
59-
checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf"
60-
dependencies = [
61-
"cc",
62-
"libc",
63-
]
64-
65-
[[package]]
66-
name = "fastrand"
67-
version = "2.0.0"
68-
source = "registry+https://github.com/rust-lang/crates.io-index"
69-
checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764"
70-
7120
[[package]]
7221
name = "fm"
7322
version = "0.2.2"
@@ -132,12 +81,6 @@ version = "0.2.150"
13281
source = "registry+https://github.com/rust-lang/crates.io-index"
13382
checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c"
13483

135-
[[package]]
136-
name = "linux-raw-sys"
137-
version = "0.4.5"
138-
source = "registry+https://github.com/rust-lang/crates.io-index"
139-
checksum = "57bcfdad1b858c2db7c38303a6d2ad4dfaf5eb53dfeb0910128b2c26d6158503"
140-
14184
[[package]]
14285
name = "memchr"
14386
version = "2.5.0"
@@ -154,24 +97,6 @@ dependencies = [
15497
"libc",
15598
]
15699

157-
[[package]]
158-
name = "object"
159-
version = "0.30.4"
160-
source = "registry+https://github.com/rust-lang/crates.io-index"
161-
checksum = "03b4680b86d9cfafba8fc491dc9b6df26b68cf40e9e6cd73909194759a63c385"
162-
dependencies = [
163-
"memchr",
164-
]
165-
166-
[[package]]
167-
name = "redox_syscall"
168-
version = "0.3.5"
169-
source = "registry+https://github.com/rust-lang/crates.io-index"
170-
checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29"
171-
dependencies = [
172-
"bitflags 1.3.2",
173-
]
174-
175100
[[package]]
176101
name = "regex"
177102
version = "1.8.4"
@@ -196,22 +121,6 @@ dependencies = [
196121
"boml",
197122
"gccjit",
198123
"lang_tester",
199-
"object",
200-
"smallvec",
201-
"tempfile",
202-
]
203-
204-
[[package]]
205-
name = "rustix"
206-
version = "0.38.8"
207-
source = "registry+https://github.com/rust-lang/crates.io-index"
208-
checksum = "19ed4fa021d81c8392ce04db050a3da9a60299050b7ae1cf482d862b54a7218f"
209-
dependencies = [
210-
"bitflags 2.4.0",
211-
"errno",
212-
"libc",
213-
"linux-raw-sys",
214-
"windows-sys",
215124
]
216125

217126
[[package]]
@@ -223,25 +132,6 @@ dependencies = [
223132
"winapi-util",
224133
]
225134

226-
[[package]]
227-
name = "smallvec"
228-
version = "1.10.0"
229-
source = "registry+https://github.com/rust-lang/crates.io-index"
230-
checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0"
231-
232-
[[package]]
233-
name = "tempfile"
234-
version = "3.7.1"
235-
source = "registry+https://github.com/rust-lang/crates.io-index"
236-
checksum = "dc02fddf48964c42031a0b3fe0428320ecf3a73c401040fc0096f97794310651"
237-
dependencies = [
238-
"cfg-if",
239-
"fastrand",
240-
"redox_syscall",
241-
"rustix",
242-
"windows-sys",
243-
]
244-
245135
[[package]]
246136
name = "termcolor"
247137
version = "1.2.0"
@@ -315,69 +205,3 @@ name = "winapi-x86_64-pc-windows-gnu"
315205
version = "0.4.0"
316206
source = "registry+https://github.com/rust-lang/crates.io-index"
317207
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
318-
319-
[[package]]
320-
name = "windows-sys"
321-
version = "0.48.0"
322-
source = "registry+https://github.com/rust-lang/crates.io-index"
323-
checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9"
324-
dependencies = [
325-
"windows-targets",
326-
]
327-
328-
[[package]]
329-
name = "windows-targets"
330-
version = "0.48.1"
331-
source = "registry+https://github.com/rust-lang/crates.io-index"
332-
checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f"
333-
dependencies = [
334-
"windows_aarch64_gnullvm",
335-
"windows_aarch64_msvc",
336-
"windows_i686_gnu",
337-
"windows_i686_msvc",
338-
"windows_x86_64_gnu",
339-
"windows_x86_64_gnullvm",
340-
"windows_x86_64_msvc",
341-
]
342-
343-
[[package]]
344-
name = "windows_aarch64_gnullvm"
345-
version = "0.48.0"
346-
source = "registry+https://github.com/rust-lang/crates.io-index"
347-
checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc"
348-
349-
[[package]]
350-
name = "windows_aarch64_msvc"
351-
version = "0.48.0"
352-
source = "registry+https://github.com/rust-lang/crates.io-index"
353-
checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3"
354-
355-
[[package]]
356-
name = "windows_i686_gnu"
357-
version = "0.48.0"
358-
source = "registry+https://github.com/rust-lang/crates.io-index"
359-
checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241"
360-
361-
[[package]]
362-
name = "windows_i686_msvc"
363-
version = "0.48.0"
364-
source = "registry+https://github.com/rust-lang/crates.io-index"
365-
checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00"
366-
367-
[[package]]
368-
name = "windows_x86_64_gnu"
369-
version = "0.48.0"
370-
source = "registry+https://github.com/rust-lang/crates.io-index"
371-
checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1"
372-
373-
[[package]]
374-
name = "windows_x86_64_gnullvm"
375-
version = "0.48.0"
376-
source = "registry+https://github.com/rust-lang/crates.io-index"
377-
checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953"
378-
379-
[[package]]
380-
name = "windows_x86_64_msvc"
381-
version = "0.48.0"
382-
source = "registry+https://github.com/rust-lang/crates.io-index"
383-
checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a"

compiler/rustc_codegen_gcc/Cargo.toml

-10
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,11 @@ default = ["master"]
2323

2424
[dependencies]
2525
gccjit = "2.1"
26-
2726
# Local copy.
2827
#gccjit = { path = "../gccjit.rs" }
2928

30-
object = { version = "0.30.1", default-features = false, features = [
31-
"std",
32-
"read",
33-
] }
34-
smallvec = { version = "1.6.1", features = ["union", "may_dangle"] }
35-
# TODO(antoyo): make tempfile optional.
36-
tempfile = "3.7.1"
37-
3829
[dev-dependencies]
3930
lang_tester = "0.8.0"
40-
tempfile = "3.1.0"
4131
boml = "0.3.1"
4232

4333
[profile.dev]

compiler/rustc_codegen_gcc/src/lib.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@
2424
#![deny(clippy::pattern_type_mismatch)]
2525
#![allow(clippy::needless_lifetimes)]
2626

27+
// Some "regular" crates we want to share with rustc
28+
extern crate object;
29+
extern crate smallvec;
30+
extern crate tempfile;
31+
#[macro_use]
32+
extern crate tracing;
33+
34+
// The rustc crates we need
2735
extern crate rustc_apfloat;
2836
extern crate rustc_ast;
2937
extern crate rustc_attr;
@@ -42,8 +50,6 @@ extern crate rustc_middle;
4250
extern crate rustc_session;
4351
extern crate rustc_span;
4452
extern crate rustc_target;
45-
#[macro_use]
46-
extern crate tracing;
4753

4854
// This prevents duplicating functions and statics that are already part of the host rustc process.
4955
#[allow(unused_extern_crates)]

compiler/rustc_hir_typeck/src/expr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
447447
// this time with enough precision to check that the value
448448
// whose address was taken can actually be made to live as long
449449
// as it needs to live.
450-
let region = self.next_region_var(infer::AddrOfRegion(expr.span));
450+
let region = self.next_region_var(infer::BorrowRegion(expr.span));
451451
Ty::new_ref(self.tcx, region, ty, mutbl)
452452
}
453453
}

compiler/rustc_infer/src/infer/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -458,8 +458,8 @@ pub enum RegionVariableOrigin {
458458
PatternRegion(Span),
459459

460460
/// Regions created by `&` operator.
461-
///
462-
AddrOfRegion(Span),
461+
BorrowRegion(Span),
462+
463463
/// Regions created as part of an autoref of a method receiver.
464464
Autoref(Span),
465465

@@ -1741,7 +1741,7 @@ impl RegionVariableOrigin {
17411741
match *self {
17421742
MiscVariable(a)
17431743
| PatternRegion(a)
1744-
| AddrOfRegion(a)
1744+
| BorrowRegion(a)
17451745
| Autoref(a)
17461746
| Coercion(a)
17471747
| RegionParameterDefinition(a, ..)

compiler/rustc_target/src/spec/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1645,6 +1645,7 @@ supported_targets! {
16451645
("x86_64-unknown-haiku", x86_64_unknown_haiku),
16461646

16471647
("i686-unknown-hurd-gnu", i686_unknown_hurd_gnu),
1648+
("x86_64-unknown-hurd-gnu", x86_64_unknown_hurd_gnu),
16481649

16491650
("aarch64-apple-darwin", aarch64_apple_darwin),
16501651
("arm64e-apple-darwin", arm64e_apple_darwin),

compiler/rustc_target/src/spec/targets/wasm32_wasip2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! The `wasm32-wasip2` target is the next evolution of the
22
//! wasm32-wasi target. While the wasi specification is still under
3-
//! active development, the {review 2 iteration is considered an "island
3+
//! active development, the preview 2 iteration is considered an "island
44
//! of stability" that should allow users to rely on it indefinitely.
55
//!
66
//! The `wasi` target is a proposal to define a standardized set of WebAssembly
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
use crate::spec::{base, Cc, LinkerFlavor, Lld, StackProbeType, Target};
2+
3+
pub(crate) fn target() -> Target {
4+
let mut base = base::hurd_gnu::opts();
5+
base.cpu = "x86-64".into();
6+
base.plt_by_default = false;
7+
base.max_atomic_width = Some(64);
8+
base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m64"]);
9+
base.stack_probes = StackProbeType::Inline;
10+
base.supports_xray = true;
11+
12+
Target {
13+
llvm_target: "x86_64-unknown-hurd-gnu".into(),
14+
metadata: crate::spec::TargetMetadata {
15+
description: Some("64-bit GNU/Hurd".into()),
16+
tier: Some(3),
17+
host_tools: Some(true),
18+
std: Some(true),
19+
},
20+
pointer_width: 64,
21+
data_layout:
22+
"e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
23+
arch: "x86_64".into(),
24+
options: base,
25+
}
26+
}

compiler/rustc_trait_selection/src/error_reporting/infer/region.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1018,7 +1018,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
10181018
let var_description = match var_origin {
10191019
infer::MiscVariable(_) => String::new(),
10201020
infer::PatternRegion(_) => " for pattern".to_string(),
1021-
infer::AddrOfRegion(_) => " for borrow expression".to_string(),
1021+
infer::BorrowRegion(_) => " for borrow expression".to_string(),
10221022
infer::Autoref(_) => " for autoref".to_string(),
10231023
infer::Coercion(_) => " for automatic coercion".to_string(),
10241024
infer::BoundRegion(_, br, infer::FnCall) => {

library/alloc/src/collections/vec_deque/iter.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ impl<'a, T> Iterator for Iter<'a, T> {
7373
fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>> {
7474
let remaining = self.i1.advance_by(n);
7575
match remaining {
76-
Ok(()) => return Ok(()),
76+
Ok(()) => Ok(()),
7777
Err(n) => {
7878
mem::swap(&mut self.i1, &mut self.i2);
7979
self.i1.advance_by(n.get())
@@ -144,7 +144,7 @@ impl<'a, T> DoubleEndedIterator for Iter<'a, T> {
144144

145145
fn advance_back_by(&mut self, n: usize) -> Result<(), NonZero<usize>> {
146146
match self.i2.advance_back_by(n) {
147-
Ok(()) => return Ok(()),
147+
Ok(()) => Ok(()),
148148
Err(n) => {
149149
mem::swap(&mut self.i1, &mut self.i2);
150150
self.i2.advance_back_by(n.get())

library/alloc/src/collections/vec_deque/iter_mut.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ impl<'a, T> Iterator for IterMut<'a, T> {
6464

6565
fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>> {
6666
match self.i1.advance_by(n) {
67-
Ok(()) => return Ok(()),
67+
Ok(()) => Ok(()),
6868
Err(remaining) => {
6969
mem::swap(&mut self.i1, &mut self.i2);
7070
self.i1.advance_by(remaining.get())
@@ -135,7 +135,7 @@ impl<'a, T> DoubleEndedIterator for IterMut<'a, T> {
135135

136136
fn advance_back_by(&mut self, n: usize) -> Result<(), NonZero<usize>> {
137137
match self.i2.advance_back_by(n) {
138-
Ok(()) => return Ok(()),
138+
Ok(()) => Ok(()),
139139
Err(remaining) => {
140140
mem::swap(&mut self.i1, &mut self.i2);
141141
self.i2.advance_back_by(remaining.get())

library/alloc/src/vec/in_place_collect.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ const fn needs_realloc<SRC, DEST>(src_cap: usize, dst_cap: usize) -> bool {
208208

209209
// type layouts don't guarantee a fit, so do a runtime check to see if
210210
// the allocations happen to match
211-
return src_cap > 0 && src_cap * mem::size_of::<SRC>() != dst_cap * mem::size_of::<DEST>();
211+
src_cap > 0 && src_cap * mem::size_of::<SRC>() != dst_cap * mem::size_of::<DEST>()
212212
}
213213

214214
/// This provides a shorthand for the source type since local type aliases aren't a thing.

0 commit comments

Comments
 (0)