Skip to content

Commit 8d1f3ef

Browse files
authored
Merge branch 'rust-lang:master' into master
2 parents 50d7b9d + d287f3e commit 8d1f3ef

File tree

446 files changed

+6262
-3951
lines changed

Some content is hidden

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

446 files changed

+6262
-3951
lines changed

Cargo.lock

+87-17
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,28 @@ dependencies = [
512512
"windows-targets 0.52.4",
513513
]
514514

515+
[[package]]
516+
name = "chrono-tz"
517+
version = "0.9.0"
518+
source = "registry+https://github.com/rust-lang/crates.io-index"
519+
checksum = "93698b29de5e97ad0ae26447b344c482a7284c737d9ddc5f9e52b74a336671bb"
520+
dependencies = [
521+
"chrono",
522+
"chrono-tz-build",
523+
"phf 0.11.2",
524+
]
525+
526+
[[package]]
527+
name = "chrono-tz-build"
528+
version = "0.3.0"
529+
source = "registry+https://github.com/rust-lang/crates.io-index"
530+
checksum = "0c088aee841df9c3041febbb73934cfc39708749bf96dc827e3359cd39ef11b1"
531+
dependencies = [
532+
"parse-zoneinfo",
533+
"phf 0.11.2",
534+
"phf_codegen 0.11.2",
535+
]
536+
515537
[[package]]
516538
name = "cipher"
517539
version = "0.4.4"
@@ -2197,7 +2219,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
21972219
checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19"
21982220
dependencies = [
21992221
"cfg-if",
2200-
"windows-targets 0.52.4",
2222+
"windows-targets 0.48.5",
22012223
]
22022224

22032225
[[package]]
@@ -2318,8 +2340,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
23182340
checksum = "7a2629bb1404f3d34c2e921f21fd34ba00b206124c81f65c50b43b6aaefeb016"
23192341
dependencies = [
23202342
"log",
2321-
"phf",
2322-
"phf_codegen",
2343+
"phf 0.10.1",
2344+
"phf_codegen 0.10.0",
23232345
"string_cache",
23242346
"string_cache_codegen",
23252347
"tendril",
@@ -2480,6 +2502,7 @@ version = "0.1.0"
24802502
dependencies = [
24812503
"aes",
24822504
"chrono",
2505+
"chrono-tz",
24832506
"colored",
24842507
"ctrlc",
24852508
"directories",
@@ -2835,6 +2858,15 @@ dependencies = [
28352858
"windows-targets 0.48.5",
28362859
]
28372860

2861+
[[package]]
2862+
name = "parse-zoneinfo"
2863+
version = "0.3.1"
2864+
source = "registry+https://github.com/rust-lang/crates.io-index"
2865+
checksum = "1f2a05b18d44e2957b88f96ba460715e295bc1d7510468a2f3d3b44535d26c24"
2866+
dependencies = [
2867+
"regex",
2868+
]
2869+
28382870
[[package]]
28392871
name = "pathdiff"
28402872
version = "0.2.1"
@@ -2907,7 +2939,16 @@ version = "0.10.1"
29072939
source = "registry+https://github.com/rust-lang/crates.io-index"
29082940
checksum = "fabbf1ead8a5bcbc20f5f8b939ee3f5b0f6f281b6ad3468b84656b658b455259"
29092941
dependencies = [
2910-
"phf_shared",
2942+
"phf_shared 0.10.0",
2943+
]
2944+
2945+
[[package]]
2946+
name = "phf"
2947+
version = "0.11.2"
2948+
source = "registry+https://github.com/rust-lang/crates.io-index"
2949+
checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc"
2950+
dependencies = [
2951+
"phf_shared 0.11.2",
29112952
]
29122953

29132954
[[package]]
@@ -2916,8 +2957,18 @@ version = "0.10.0"
29162957
source = "registry+https://github.com/rust-lang/crates.io-index"
29172958
checksum = "4fb1c3a8bc4dd4e5cfce29b44ffc14bedd2ee294559a294e2a4d4c9e9a6a13cd"
29182959
dependencies = [
2919-
"phf_generator",
2920-
"phf_shared",
2960+
"phf_generator 0.10.0",
2961+
"phf_shared 0.10.0",
2962+
]
2963+
2964+
[[package]]
2965+
name = "phf_codegen"
2966+
version = "0.11.2"
2967+
source = "registry+https://github.com/rust-lang/crates.io-index"
2968+
checksum = "e8d39688d359e6b34654d328e262234662d16cc0f60ec8dcbe5e718709342a5a"
2969+
dependencies = [
2970+
"phf_generator 0.11.2",
2971+
"phf_shared 0.11.2",
29212972
]
29222973

29232974
[[package]]
@@ -2926,7 +2977,17 @@ version = "0.10.0"
29262977
source = "registry+https://github.com/rust-lang/crates.io-index"
29272978
checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6"
29282979
dependencies = [
2929-
"phf_shared",
2980+
"phf_shared 0.10.0",
2981+
"rand",
2982+
]
2983+
2984+
[[package]]
2985+
name = "phf_generator"
2986+
version = "0.11.2"
2987+
source = "registry+https://github.com/rust-lang/crates.io-index"
2988+
checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0"
2989+
dependencies = [
2990+
"phf_shared 0.11.2",
29302991
"rand",
29312992
]
29322993

@@ -2939,6 +3000,15 @@ dependencies = [
29393000
"siphasher",
29403001
]
29413002

3003+
[[package]]
3004+
name = "phf_shared"
3005+
version = "0.11.2"
3006+
source = "registry+https://github.com/rust-lang/crates.io-index"
3007+
checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b"
3008+
dependencies = [
3009+
"siphasher",
3010+
]
3011+
29423012
[[package]]
29433013
name = "pin-project-lite"
29443014
version = "0.2.14"
@@ -3354,9 +3424,9 @@ dependencies = [
33543424

33553425
[[package]]
33563426
name = "rustc-build-sysroot"
3357-
version = "0.4.6"
3427+
version = "0.4.7"
33583428
source = "registry+https://github.com/rust-lang/crates.io-index"
3359-
checksum = "a9bf37423495cd3a6a9ef8c75fc4566de0d26de0ab75f36f67a426e58df5768c"
3429+
checksum = "ab1dbbd1bdf65fdac44c885f6cca147ba179108ce284b60a08ccc04b1f1dbac0"
33603430
dependencies = [
33613431
"anyhow",
33623432
"rustc_version",
@@ -3906,7 +3976,6 @@ dependencies = [
39063976
"rustc_session",
39073977
"rustc_span",
39083978
"smallvec",
3909-
"termcolor",
39103979
"thin-vec",
39113980
"tracing",
39123981
]
@@ -4394,6 +4463,7 @@ dependencies = [
43944463
"rustc_macros",
43954464
"rustc_session",
43964465
"rustc_span",
4466+
"termcolor",
43974467
"thin-vec",
43984468
"tracing",
43994469
"unicode-normalization",
@@ -5285,7 +5355,7 @@ dependencies = [
52855355
"new_debug_unreachable",
52865356
"once_cell",
52875357
"parking_lot",
5288-
"phf_shared",
5358+
"phf_shared 0.10.0",
52895359
"precomputed-hash",
52905360
"serde",
52915361
]
@@ -5296,8 +5366,8 @@ version = "0.5.2"
52965366
source = "registry+https://github.com/rust-lang/crates.io-index"
52975367
checksum = "6bb30289b722be4ff74a408c3cc27edeaad656e06cb1fe8fa9231fa59c728988"
52985368
dependencies = [
5299-
"phf_generator",
5300-
"phf_shared",
5369+
"phf_generator 0.10.0",
5370+
"phf_shared 0.10.0",
53015371
"proc-macro2",
53025372
"quote",
53035373
]
@@ -5597,9 +5667,9 @@ version = "0.1.0"
55975667

55985668
[[package]]
55995669
name = "time"
5600-
version = "0.3.34"
5670+
version = "0.3.36"
56015671
source = "registry+https://github.com/rust-lang/crates.io-index"
5602-
checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749"
5672+
checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885"
56035673
dependencies = [
56045674
"deranged",
56055675
"itoa",
@@ -5618,9 +5688,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3"
56185688

56195689
[[package]]
56205690
name = "time-macros"
5621-
version = "0.2.17"
5691+
version = "0.2.18"
56225692
source = "registry+https://github.com/rust-lang/crates.io-index"
5623-
checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774"
5693+
checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf"
56245694
dependencies = [
56255695
"num-conv",
56265696
"time-core",

compiler/rustc_ast/src/entry.rs

+25-1
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,35 @@ use rustc_span::Symbol;
44

55
#[derive(Debug)]
66
pub enum EntryPointType {
7+
/// This function is not an entrypoint.
78
None,
9+
/// This is a function called `main` at the root level.
10+
/// ```
11+
/// fn main() {}
12+
/// ```
813
MainNamed,
14+
/// This is a function with the `#[rustc_main]` attribute.
15+
/// Used by the testing harness to create the test entrypoint.
16+
/// ```ignore (clashes with test entrypoint)
17+
/// #[rustc_main]
18+
/// fn main() {}
19+
/// ```
920
RustcMainAttr,
21+
/// This is a function with the `#[start]` attribute.
22+
/// ```ignore (clashes with test entrypoint)
23+
/// #[start]
24+
/// fn main() {}
25+
/// ```
1026
Start,
11-
OtherMain, // Not an entry point, but some other function named main
27+
/// This function is **not** an entrypoint but simply named `main` (not at the root).
28+
/// This is only used for diagnostics.
29+
/// ```
30+
/// #[allow(dead_code)]
31+
/// mod meow {
32+
/// fn main() {}
33+
/// }
34+
/// ```
35+
OtherMain,
1236
}
1337

1438
pub fn entry_point_type(

compiler/rustc_ast_passes/src/feature_gate.rs

+1-14
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use rustc_ast as ast;
22
use rustc_ast::visit::{self, AssocCtxt, FnCtxt, FnKind, Visitor};
33
use rustc_ast::{attr, AssocConstraint, AssocConstraintKind, NodeId};
4-
use rustc_ast::{token, PatKind, RangeEnd};
4+
use rustc_ast::{token, PatKind};
55
use rustc_feature::{AttributeGate, BuiltinAttribute, Features, GateIssue, BUILTIN_ATTRIBUTE_MAP};
66
use rustc_session::parse::{feature_err, feature_err_issue, feature_warn};
77
use rustc_session::Session;
@@ -418,15 +418,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
418418
PatKind::Box(..) => {
419419
gate!(&self, box_patterns, pattern.span, "box pattern syntax is experimental");
420420
}
421-
PatKind::Range(_, Some(_), Spanned { node: RangeEnd::Excluded, .. }) => {
422-
gate!(
423-
&self,
424-
exclusive_range_pattern,
425-
pattern.span,
426-
"exclusive range pattern syntax is experimental",
427-
"use an inclusive range pattern, like N..=M"
428-
);
429-
}
430421
_ => {}
431422
}
432423
visit::walk_pat(self, pattern)
@@ -619,10 +610,6 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session, features: &Features) {
619610
// be too.
620611
gate_all_legacy_dont_use!(return_type_notation, "return type notation is experimental");
621612
gate_all_legacy_dont_use!(decl_macro, "`macro` is experimental");
622-
gate_all_legacy_dont_use!(
623-
exclusive_range_pattern,
624-
"exclusive range pattern syntax is experimental"
625-
);
626613
gate_all_legacy_dont_use!(try_blocks, "`try` blocks are unstable");
627614
gate_all_legacy_dont_use!(auto_traits, "`auto` traits are unstable");
628615

compiler/rustc_builtin_macros/src/test_harness.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ fn generate_test_harness(
266266
///
267267
/// By default this expands to
268268
///
269-
/// ```ignore UNSOLVED (I think I still need guidance for this one. Is it correct? Do we try to make it run? How do we nicely fill it out?)
269+
/// ```ignore (messes with test internals)
270270
/// #[rustc_main]
271271
/// pub fn main() {
272272
/// extern crate test;

compiler/rustc_codegen_ssa/src/mir/block.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
540540
// \-------/
541541
//
542542
let virtual_drop = Instance {
543-
def: ty::InstanceDef::Virtual(drop_fn.def_id(), 0),
543+
def: ty::InstanceDef::Virtual(drop_fn.def_id(), 0), // idx 0: the drop function
544544
args: drop_fn.args,
545545
};
546546
debug!("ty = {:?}", ty);
@@ -581,7 +581,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
581581
//
582582
// SO THEN WE CAN USE THE ABOVE CODE.
583583
let virtual_drop = Instance {
584-
def: ty::InstanceDef::Virtual(drop_fn.def_id(), 0),
584+
def: ty::InstanceDef::Virtual(drop_fn.def_id(), 0), // idx 0: the drop function
585585
args: drop_fn.args,
586586
};
587587
debug!("ty = {:?}", ty);
@@ -649,8 +649,8 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
649649
return helper.funclet_br(self, bx, target, mergeable_succ);
650650
}
651651

652-
// Pass the condition through llvm.expect for branch hinting.
653-
let cond = bx.expect(cond, expected);
652+
// Because we're branching to a panic block (either a `#[cold]` one
653+
// or an inlined abort), there's no need to `expect` it.
654654

655655
// Create the failure block and the conditional branch to it.
656656
let lltarget = helper.llbb_with_cleanup(self, target);

compiler/rustc_const_eval/src/const_eval/dummy_machine.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ impl<'mir, 'tcx: 'mir> interpret::Machine<'mir, 'tcx> for DummyMachine {
105105
_destination: &interpret::MPlaceTy<'tcx, Self::Provenance>,
106106
_target: Option<BasicBlock>,
107107
_unwind: UnwindAction,
108-
) -> interpret::InterpResult<'tcx> {
108+
) -> interpret::InterpResult<'tcx, Option<ty::Instance<'tcx>>> {
109109
unimplemented!()
110110
}
111111

compiler/rustc_const_eval/src/const_eval/machine.rs

+15-10
Original file line numberDiff line numberDiff line change
@@ -459,17 +459,14 @@ impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for CompileTimeInterpreter<'mir,
459459
dest: &MPlaceTy<'tcx, Self::Provenance>,
460460
target: Option<mir::BasicBlock>,
461461
_unwind: mir::UnwindAction,
462-
) -> InterpResult<'tcx> {
462+
) -> InterpResult<'tcx, Option<ty::Instance<'tcx>>> {
463463
// Shared intrinsics.
464464
if ecx.emulate_intrinsic(instance, args, dest, target)? {
465-
return Ok(());
465+
return Ok(None);
466466
}
467467
let intrinsic_name = ecx.tcx.item_name(instance.def_id());
468468

469469
// CTFE-specific intrinsics.
470-
let Some(ret) = target else {
471-
throw_unsup_format!("intrinsic `{intrinsic_name}` is not supported at compile-time");
472-
};
473470
match intrinsic_name {
474471
sym::ptr_guaranteed_cmp => {
475472
let a = ecx.read_scalar(&args[0])?;
@@ -536,14 +533,22 @@ impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for CompileTimeInterpreter<'mir,
536533
// not the optimization stage.)
537534
sym::is_val_statically_known => ecx.write_scalar(Scalar::from_bool(false), dest)?,
538535
_ => {
539-
throw_unsup_format!(
540-
"intrinsic `{intrinsic_name}` is not supported at compile-time"
541-
);
536+
// We haven't handled the intrinsic, let's see if we can use a fallback body.
537+
if ecx.tcx.intrinsic(instance.def_id()).unwrap().must_be_overridden {
538+
throw_unsup_format!(
539+
"intrinsic `{intrinsic_name}` is not supported at compile-time"
540+
);
541+
}
542+
return Ok(Some(ty::Instance {
543+
def: ty::InstanceDef::Item(instance.def_id()),
544+
args: instance.args,
545+
}));
542546
}
543547
}
544548

545-
ecx.go_to_block(ret);
546-
Ok(())
549+
// Intrinsic is done, jump to next block.
550+
ecx.return_to_block(target)?;
551+
Ok(None)
547552
}
548553

549554
fn assert_panic(

0 commit comments

Comments
 (0)