Skip to content

Commit d2e446d

Browse files
committed
Auto merge of rust-lang#3296 - RalfJung:rustup, r=RalfJung
Rustup, more pthread tests
2 parents cad872a + 781190f commit d2e446d

File tree

626 files changed

+19667
-5897
lines changed

Some content is hidden

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

626 files changed

+19667
-5897
lines changed

.github/workflows/ci.yml

+6-4
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ jobs:
322322
RUST_CONFIGURE_ARGS: "--enable-full-tools --enable-sanitizers --enable-profiler --set rust.jemalloc --set rust.lto=thin"
323323
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
324324
MACOSX_DEPLOYMENT_TARGET: 10.12
325-
SELECT_XCODE: /Applications/Xcode_13.4.1.app
325+
SELECT_XCODE: /Applications/Xcode_14.3.1.app
326326
NO_LLVM_ASSERTIONS: 1
327327
NO_DEBUG_ASSERTIONS: 1
328328
NO_OVERFLOW_CHECKS: 1
@@ -335,7 +335,7 @@ jobs:
335335
RUST_CONFIGURE_ARGS: "--enable-sanitizers --enable-profiler --set rust.jemalloc"
336336
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
337337
MACOSX_DEPLOYMENT_TARGET: 10.12
338-
SELECT_XCODE: /Applications/Xcode_13.4.1.app
338+
SELECT_XCODE: /Applications/Xcode_14.3.1.app
339339
NO_LLVM_ASSERTIONS: 1
340340
NO_DEBUG_ASSERTIONS: 1
341341
NO_OVERFLOW_CHECKS: 1
@@ -347,6 +347,7 @@ jobs:
347347
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
348348
MACOSX_DEPLOYMENT_TARGET: 10.12
349349
MACOSX_STD_DEPLOYMENT_TARGET: 10.12
350+
SELECT_XCODE: /Applications/Xcode_14.3.1.app
350351
NO_LLVM_ASSERTIONS: 1
351352
NO_DEBUG_ASSERTIONS: 1
352353
NO_OVERFLOW_CHECKS: 1
@@ -358,6 +359,7 @@ jobs:
358359
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
359360
MACOSX_DEPLOYMENT_TARGET: 10.12
360361
MACOSX_STD_DEPLOYMENT_TARGET: 10.12
362+
SELECT_XCODE: /Applications/Xcode_14.3.1.app
361363
NO_LLVM_ASSERTIONS: 1
362364
NO_DEBUG_ASSERTIONS: 1
363365
NO_OVERFLOW_CHECKS: 1
@@ -367,7 +369,7 @@ jobs:
367369
SCRIPT: "./x.py dist bootstrap --include-default-paths --host=aarch64-apple-darwin --target=aarch64-apple-darwin"
368370
RUST_CONFIGURE_ARGS: "--enable-full-tools --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false --set rust.lto=thin"
369371
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
370-
SELECT_XCODE: /Applications/Xcode_13.4.1.app
372+
SELECT_XCODE: /Applications/Xcode_14.3.1.app
371373
USE_XCODE_CLANG: 1
372374
MACOSX_DEPLOYMENT_TARGET: 11.0
373375
MACOSX_STD_DEPLOYMENT_TARGET: 11.0
@@ -381,7 +383,7 @@ jobs:
381383
SCRIPT: "./x.py --stage 2 test --host=aarch64-apple-darwin --target=aarch64-apple-darwin"
382384
RUST_CONFIGURE_ARGS: "--enable-sanitizers --enable-profiler --set rust.jemalloc"
383385
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
384-
SELECT_XCODE: /Applications/Xcode_13.4.1.app
386+
SELECT_XCODE: /Applications/Xcode_14.3.1.app
385387
USE_XCODE_CLANG: 1
386388
MACOSX_DEPLOYMENT_TARGET: 11.0
387389
MACOSX_STD_DEPLOYMENT_TARGET: 11.0

Cargo.lock

+81-16
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,21 @@ dependencies = [
147147
"anstyle",
148148
"anstyle-parse",
149149
"anstyle-query",
150-
"anstyle-wincon",
150+
"anstyle-wincon 2.1.0",
151+
"colorchoice",
152+
"utf8parse",
153+
]
154+
155+
[[package]]
156+
name = "anstream"
157+
version = "0.6.11"
158+
source = "registry+https://github.com/rust-lang/crates.io-index"
159+
checksum = "6e2e1ebcb11de5c03c67de28a7df593d32191b44939c482e97702baaaa6ab6a5"
160+
dependencies = [
161+
"anstyle",
162+
"anstyle-parse",
163+
"anstyle-query",
164+
"anstyle-wincon 3.0.2",
151165
"colorchoice",
152166
"utf8parse",
153167
]
@@ -186,6 +200,16 @@ dependencies = [
186200
"windows-sys 0.48.0",
187201
]
188202

203+
[[package]]
204+
name = "anstyle-wincon"
205+
version = "3.0.2"
206+
source = "registry+https://github.com/rust-lang/crates.io-index"
207+
checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7"
208+
dependencies = [
209+
"anstyle",
210+
"windows-sys 0.52.0",
211+
]
212+
189213
[[package]]
190214
name = "anyhow"
191215
version = "1.0.75"
@@ -520,7 +544,7 @@ version = "4.4.4"
520544
source = "registry+https://github.com/rust-lang/crates.io-index"
521545
checksum = "5179bb514e4d7c2051749d8fcefa2ed6d06a9f4e6d69faf3805f5d80b8cf8d56"
522546
dependencies = [
523-
"anstream",
547+
"anstream 0.5.0",
524548
"anstyle",
525549
"clap_lex",
526550
"strsim",
@@ -558,7 +582,7 @@ checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b"
558582
name = "clippy"
559583
version = "0.1.78"
560584
dependencies = [
561-
"anstream",
585+
"anstream 0.5.0",
562586
"clippy_config",
563587
"clippy_lints",
564588
"clippy_utils",
@@ -1234,6 +1258,16 @@ dependencies = [
12341258
"cfg-if",
12351259
]
12361260

1261+
[[package]]
1262+
name = "env_filter"
1263+
version = "0.1.0"
1264+
source = "registry+https://github.com/rust-lang/crates.io-index"
1265+
checksum = "a009aa4810eb158359dda09d0c87378e4bbb89b5a801f016885a4707ba24f7ea"
1266+
dependencies = [
1267+
"log",
1268+
"regex",
1269+
]
1270+
12371271
[[package]]
12381272
name = "env_logger"
12391273
version = "0.10.0"
@@ -1247,6 +1281,19 @@ dependencies = [
12471281
"termcolor",
12481282
]
12491283

1284+
[[package]]
1285+
name = "env_logger"
1286+
version = "0.11.1"
1287+
source = "registry+https://github.com/rust-lang/crates.io-index"
1288+
checksum = "05e7cf40684ae96ade6232ed84582f40ce0a66efcd43a5117aef610534f8e0b8"
1289+
dependencies = [
1290+
"anstream 0.6.11",
1291+
"anstyle",
1292+
"env_filter",
1293+
"humantime",
1294+
"log",
1295+
]
1296+
12501297
[[package]]
12511298
name = "equivalent"
12521299
version = "1.0.0"
@@ -1638,9 +1685,9 @@ dependencies = [
16381685

16391686
[[package]]
16401687
name = "handlebars"
1641-
version = "4.3.7"
1688+
version = "5.1.0"
16421689
source = "registry+https://github.com/rust-lang/crates.io-index"
1643-
checksum = "83c3372087601b532857d332f5957cbae686da52bb7810bf038c3e3c3cc2fa0d"
1690+
checksum = "ab283476b99e66691dee3f1640fea91487a8d81f50fb5ecc75538f8f8879a1e4"
16441691
dependencies = [
16451692
"log",
16461693
"pest",
@@ -2227,6 +2274,7 @@ dependencies = [
22272274
name = "linkchecker"
22282275
version = "0.1.0"
22292276
dependencies = [
2277+
"html5ever",
22302278
"once_cell",
22312279
"regex",
22322280
]
@@ -2335,24 +2383,23 @@ dependencies = [
23352383

23362384
[[package]]
23372385
name = "mdbook"
2338-
version = "0.4.36"
2386+
version = "0.4.37"
23392387
source = "registry+https://github.com/rust-lang/crates.io-index"
2340-
checksum = "80992cb0e05f22cc052c99f8e883f1593b891014b96a8b4637fd274d7030c85e"
2388+
checksum = "0c33564061c3c640bed5ace7d6a2a1b65f2c64257d1ac930c15e94ed0fb561d3"
23412389
dependencies = [
23422390
"ammonia",
23432391
"anyhow",
23442392
"chrono",
23452393
"clap",
23462394
"clap_complete",
23472395
"elasticlunr-rs",
2348-
"env_logger",
2396+
"env_logger 0.11.1",
23492397
"handlebars",
23502398
"log",
23512399
"memchr",
23522400
"once_cell",
23532401
"opener",
2354-
"pathdiff",
2355-
"pulldown-cmark",
2402+
"pulldown-cmark 0.10.0",
23562403
"regex",
23572404
"serde",
23582405
"serde_json",
@@ -2471,7 +2518,7 @@ dependencies = [
24712518
"aes",
24722519
"colored",
24732520
"ctrlc",
2474-
"env_logger",
2521+
"env_logger 0.10.0",
24752522
"getrandom",
24762523
"jemalloc-sys",
24772524
"lazy_static",
@@ -2689,7 +2736,7 @@ dependencies = [
26892736
"camino",
26902737
"clap",
26912738
"derive_builder",
2692-
"env_logger",
2739+
"env_logger 0.10.0",
26932740
"fs_extra",
26942741
"glob",
26952742
"humansize",
@@ -3012,6 +3059,24 @@ dependencies = [
30123059
"unicase",
30133060
]
30143061

3062+
[[package]]
3063+
name = "pulldown-cmark"
3064+
version = "0.10.0"
3065+
source = "registry+https://github.com/rust-lang/crates.io-index"
3066+
checksum = "dce76ce678ffc8e5675b22aa1405de0b7037e2fdf8913fea40d1926c6fe1e6e7"
3067+
dependencies = [
3068+
"bitflags 2.4.1",
3069+
"memchr",
3070+
"pulldown-cmark-escape",
3071+
"unicase",
3072+
]
3073+
3074+
[[package]]
3075+
name = "pulldown-cmark-escape"
3076+
version = "0.10.0"
3077+
source = "registry+https://github.com/rust-lang/crates.io-index"
3078+
checksum = "d5d8f9aa0e3cbcfaf8bf00300004ee3b72f74770f9cbac93f6928771f613276b"
3079+
30153080
[[package]]
30163081
name = "punycode"
30173082
version = "0.4.1"
@@ -3271,7 +3336,7 @@ name = "rustbook"
32713336
version = "0.1.0"
32723337
dependencies = [
32733338
"clap",
3274-
"env_logger",
3339+
"env_logger 0.10.0",
32753340
"mdbook",
32763341
]
32773342

@@ -4427,7 +4492,7 @@ name = "rustc_resolve"
44274492
version = "0.0.0"
44284493
dependencies = [
44294494
"bitflags 2.4.1",
4430-
"pulldown-cmark",
4495+
"pulldown-cmark 0.9.6",
44314496
"rustc_arena",
44324497
"rustc_ast",
44334498
"rustc_ast_pretty",
@@ -4971,9 +5036,9 @@ checksum = "45bb67a18fa91266cc7807181f62f9178a6873bfad7dc788c42e6430db40184f"
49715036

49725037
[[package]]
49735038
name = "shlex"
4974-
version = "1.1.0"
5039+
version = "1.3.0"
49755040
source = "registry+https://github.com/rust-lang/crates.io-index"
4976-
checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3"
5041+
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
49775042

49785043
[[package]]
49795044
name = "siphasher"

compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -403,8 +403,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
403403
}
404404
}
405405
let typeck = self.infcx.tcx.typeck(self.mir_def_id());
406-
let hir_id = hir.parent_id(expr.hir_id);
407-
let parent = self.infcx.tcx.hir_node(hir_id);
406+
let parent = self.infcx.tcx.parent_hir_node(expr.hir_id);
408407
let (def_id, args, offset) = if let hir::Node::Expr(parent_expr) = parent
409408
&& let hir::ExprKind::MethodCall(_, _, args, _) = parent_expr.kind
410409
&& let Some(def_id) = typeck.type_dependent_def_id(parent_expr.hir_id)
@@ -1660,8 +1659,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
16601659

16611660
// Check that the parent of the closure is a method call,
16621661
// with receiver matching with local's type (modulo refs)
1663-
let parent = hir.parent_id(closure_expr.hir_id);
1664-
if let hir::Node::Expr(parent) = tcx.hir_node(parent) {
1662+
if let hir::Node::Expr(parent) = tcx.parent_hir_node(closure_expr.hir_id) {
16651663
if let hir::ExprKind::MethodCall(_, recv, ..) = parent.kind {
16661664
let recv_ty = typeck_results.expr_ty(recv);
16671665

compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -944,7 +944,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
944944
let hir = self.infcx.tcx.hir();
945945
let closure_id = self.mir_hir_id();
946946
let closure_span = self.infcx.tcx.def_span(self.mir_def_id());
947-
let fn_call_id = hir.parent_id(closure_id);
947+
let fn_call_id = self.infcx.tcx.parent_hir_id(closure_id);
948948
let node = self.infcx.tcx.hir_node(fn_call_id);
949949
let def_id = hir.enclosing_body_owner(fn_call_id);
950950
let mut look_at_return = true;
@@ -1034,7 +1034,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
10341034
if let InstanceDef::Item(def_id) = source.instance
10351035
&& let Some(Node::Expr(hir::Expr { hir_id, kind, .. })) = hir.get_if_local(def_id)
10361036
&& let ExprKind::Closure(hir::Closure { kind: hir::ClosureKind::Closure, .. }) = kind
1037-
&& let Some(Node::Expr(expr)) = hir.find_parent(*hir_id)
1037+
&& let Node::Expr(expr) = self.infcx.tcx.parent_hir_node(*hir_id)
10381038
{
10391039
let mut cur_expr = expr;
10401040
while let ExprKind::MethodCall(path_segment, recv, _, _) = cur_expr.kind {

compiler/rustc_borrowck/src/diagnostics/region_errors.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,11 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
214214
if let Some(id) = placeholder.bound.kind.get_id()
215215
&& let Some(placeholder_id) = id.as_local()
216216
&& let gat_hir_id = self.infcx.tcx.local_def_id_to_hir_id(placeholder_id)
217-
&& let Some(generics_impl) =
218-
hir.get_parent(hir.parent_id(gat_hir_id)).generics()
217+
&& let Some(generics_impl) = self
218+
.infcx
219+
.tcx
220+
.parent_hir_node(self.infcx.tcx.parent_hir_id(gat_hir_id))
221+
.generics()
219222
{
220223
Some((gat_hir_id, generics_impl))
221224
} else {

compiler/rustc_const_eval/messages.ftl

+6-2
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ const_eval_error = {$error_kind ->
9898
const_eval_exact_div_has_remainder =
9999
exact_div: {$a} cannot be divided by {$b} without remainder
100100
101+
const_eval_extern_static =
102+
cannot access extern static ({$did})
101103
const_eval_fn_ptr_call =
102104
function pointers need an RFC before allowed to be called in {const_eval_const_context}s
103105
const_eval_for_loop_into_iter_non_const =
@@ -172,6 +174,10 @@ const_eval_invalid_meta =
172174
invalid metadata in wide pointer: total size is bigger than largest supported object
173175
const_eval_invalid_meta_slice =
174176
invalid metadata in wide pointer: slice is bigger than largest supported object
177+
178+
const_eval_invalid_niched_enum_variant_written =
179+
trying to set discriminant of a {$ty} to the niched variant, but the value does not match
180+
175181
const_eval_invalid_str =
176182
this string is not valid UTF-8: {$err}
177183
const_eval_invalid_tag =
@@ -298,8 +304,6 @@ const_eval_raw_ptr_to_int =
298304
.note = at compile-time, pointers do not have an integer value
299305
.note2 = avoiding this restriction via `transmute`, `union`, or raw pointers leads to compile-time undefined behavior
300306
301-
const_eval_read_extern_static =
302-
cannot read from extern static ({$did})
303307
const_eval_read_pointer_as_int =
304308
unable to turn pointer into integer
305309
const_eval_realloc_or_alloc_with_offset =

compiler/rustc_const_eval/src/errors.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,9 @@ impl<'a> ReportErrorExt for UndefinedBehaviorInfo<'a> {
497497
ScalarSizeMismatch(_) => const_eval_scalar_size_mismatch,
498498
UninhabitedEnumVariantWritten(_) => const_eval_uninhabited_enum_variant_written,
499499
UninhabitedEnumVariantRead(_) => const_eval_uninhabited_enum_variant_read,
500+
InvalidNichedEnumVariantWritten { .. } => {
501+
const_eval_invalid_niched_enum_variant_written
502+
}
500503
AbiMismatchArgument { .. } => const_eval_incompatible_types,
501504
AbiMismatchReturn { .. } => const_eval_incompatible_return_types,
502505
}
@@ -585,6 +588,9 @@ impl<'a> ReportErrorExt for UndefinedBehaviorInfo<'a> {
585588
builder.arg("target_size", info.target_size);
586589
builder.arg("data_size", info.data_size);
587590
}
591+
InvalidNichedEnumVariantWritten { enum_ty } => {
592+
builder.arg("ty", enum_ty.to_string());
593+
}
588594
AbiMismatchArgument { caller_ty, callee_ty }
589595
| AbiMismatchReturn { caller_ty, callee_ty } => {
590596
builder.arg("caller_ty", caller_ty.to_string());
@@ -793,7 +799,7 @@ impl ReportErrorExt for UnsupportedOpInfo {
793799
UnsupportedOpInfo::ReadPartialPointer(_) => const_eval_partial_pointer_copy,
794800
UnsupportedOpInfo::ReadPointerAsInt(_) => const_eval_read_pointer_as_int,
795801
UnsupportedOpInfo::ThreadLocalStatic(_) => const_eval_thread_local_static,
796-
UnsupportedOpInfo::ReadExternStatic(_) => const_eval_read_extern_static,
802+
UnsupportedOpInfo::ExternStatic(_) => const_eval_extern_static,
797803
}
798804
}
799805
fn add_args<G: EmissionGuarantee>(self, _: &DiagCtxt, builder: &mut DiagnosticBuilder<'_, G>) {
@@ -812,7 +818,7 @@ impl ReportErrorExt for UnsupportedOpInfo {
812818
OverwritePartialPointer(ptr) | ReadPartialPointer(ptr) => {
813819
builder.arg("ptr", ptr);
814820
}
815-
ThreadLocalStatic(did) | ReadExternStatic(did) => {
821+
ThreadLocalStatic(did) | ExternStatic(did) => {
816822
builder.arg("did", format!("{did:?}"));
817823
}
818824
}

compiler/rustc_const_eval/src/interpret/cast.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
415415
}
416416
}
417417

418-
fn unsize_into(
418+
pub fn unsize_into(
419419
&mut self,
420420
src: &OpTy<'tcx, M::Provenance>,
421421
cast_ty: TyAndLayout<'tcx>,

0 commit comments

Comments
 (0)