Skip to content

Commit 3a4bc97

Browse files
committed
Auto merge of rust-lang#122955 - WaffleLapkin:no-more-fallback, r=<try>
[experiment] Turn off never type fallback Crater experiment
2 parents ceab612 + 517f677 commit 3a4bc97

File tree

162 files changed

+39635
-141
lines changed

Some content is hidden

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

162 files changed

+39635
-141
lines changed

Cargo.lock

+66-15
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,7 @@ dependencies = [
774774
"tracing-subscriber",
775775
"unified-diff",
776776
"walkdir",
777-
"windows",
777+
"windows 0.52.0",
778778
]
779779

780780
[[package]]
@@ -875,8 +875,10 @@ dependencies = [
875875
[[package]]
876876
name = "crossbeam-utils"
877877
version = "0.8.19"
878-
source = "registry+https://github.com/rust-lang/crates.io-index"
879-
checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345"
878+
dependencies = [
879+
"loom",
880+
"rand",
881+
]
880882

881883
[[package]]
882884
name = "crypto-common"
@@ -891,8 +893,7 @@ dependencies = [
891893
[[package]]
892894
name = "ctrlc"
893895
version = "3.4.4"
894-
source = "registry+https://github.com/rust-lang/crates.io-index"
895-
checksum = "672465ae37dc1bc6380a6547a8883d5dd397b0f1faaad4f265726cc7042a5345"
896+
source = "git+https://github.com/WaffleLapkin/rust-ctrlc.git?rev=17e3ee4b35f7988489a3d9fd7a3b10e81ca94809#17e3ee4b35f7988489a3d9fd7a3b10e81ca94809"
896897
dependencies = [
897898
"nix",
898899
"windows-sys 0.52.0",
@@ -1533,6 +1534,19 @@ dependencies = [
15331534
"windows-bindgen",
15341535
]
15351536

1537+
[[package]]
1538+
name = "generator"
1539+
version = "0.7.5"
1540+
source = "registry+https://github.com/rust-lang/crates.io-index"
1541+
checksum = "5cc16584ff22b460a382b7feec54b23d2908d858152e5739a120b949293bd74e"
1542+
dependencies = [
1543+
"cc",
1544+
"libc",
1545+
"log",
1546+
"rustversion",
1547+
"windows 0.48.0",
1548+
]
1549+
15361550
[[package]]
15371551
name = "generic-array"
15381552
version = "0.14.7"
@@ -2304,6 +2318,19 @@ version = "0.4.21"
23042318
source = "registry+https://github.com/rust-lang/crates.io-index"
23052319
checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c"
23062320

2321+
[[package]]
2322+
name = "loom"
2323+
version = "0.7.1"
2324+
source = "registry+https://github.com/rust-lang/crates.io-index"
2325+
checksum = "7e045d70ddfbc984eacfa964ded019534e8f6cbf36f6410aee0ed5cefa5a9175"
2326+
dependencies = [
2327+
"cfg-if",
2328+
"generator",
2329+
"scoped-tls",
2330+
"tracing",
2331+
"tracing-subscriber",
2332+
]
2333+
23072334
[[package]]
23082335
name = "lzma-sys"
23092336
version = "0.1.20"
@@ -2461,13 +2488,12 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
24612488
[[package]]
24622489
name = "miniz_oxide"
24632490
version = "0.7.2"
2464-
source = "registry+https://github.com/rust-lang/crates.io-index"
2465-
checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7"
24662491
dependencies = [
24672492
"adler",
24682493
"compiler_builtins",
24692494
"rustc-std-workspace-alloc",
24702495
"rustc-std-workspace-core",
2496+
"simd-adler32",
24712497
]
24722498

24732499
[[package]]
@@ -3093,6 +3119,15 @@ version = "0.4.1"
30933119
source = "registry+https://github.com/rust-lang/crates.io-index"
30943120
checksum = "e9e1dcb320d6839f6edb64f7a4a59d39b30480d4d1765b56873f7c858538a5fe"
30953121

3122+
[[package]]
3123+
name = "quickcheck"
3124+
version = "1.0.3"
3125+
source = "registry+https://github.com/rust-lang/crates.io-index"
3126+
checksum = "588f6378e4dd99458b60ec275b4477add41ce4fa9f64dcba6f15adccb19b50d6"
3127+
dependencies = [
3128+
"rand",
3129+
]
3130+
30963131
[[package]]
30973132
name = "quine-mc_cluskey"
30983133
version = "0.2.4"
@@ -3220,11 +3255,12 @@ dependencies = [
32203255
[[package]]
32213256
name = "regex"
32223257
version = "1.8.4"
3223-
source = "registry+https://github.com/rust-lang/crates.io-index"
3224-
checksum = "d0ab3ca65655bb1e41f2a8c8cd662eb4fb035e67c3f78da1d61dffe89d07300f"
32253258
dependencies = [
32263259
"aho-corasick",
3260+
"lazy_static",
32273261
"memchr",
3262+
"quickcheck",
3263+
"rand",
32283264
"regex-syntax 0.7.5",
32293265
]
32303266

@@ -3723,7 +3759,7 @@ dependencies = [
37233759
"thorin-dwp",
37243760
"tracing",
37253761
"wasm-encoder",
3726-
"windows",
3762+
"windows 0.52.0",
37273763
]
37283764

37293765
[[package]]
@@ -3780,7 +3816,7 @@ dependencies = [
37803816
"tempfile",
37813817
"thin-vec",
37823818
"tracing",
3783-
"windows",
3819+
"windows 0.52.0",
37843820
]
37853821

37863822
[[package]]
@@ -3843,7 +3879,7 @@ dependencies = [
38433879
"shlex",
38443880
"time",
38453881
"tracing",
3846-
"windows",
3882+
"windows 0.52.0",
38473883
]
38483884

38493885
[[package]]
@@ -3895,7 +3931,7 @@ dependencies = [
38953931
"termize",
38963932
"tracing",
38973933
"unicode-width",
3898-
"windows",
3934+
"windows 0.52.0",
38993935
]
39003936

39013937
[[package]]
@@ -4593,7 +4629,7 @@ dependencies = [
45934629
"smallvec",
45944630
"termize",
45954631
"tracing",
4596-
"windows",
4632+
"windows 0.52.0",
45974633
]
45984634

45994635
[[package]]
@@ -5114,6 +5150,12 @@ version = "1.3.0"
51145150
source = "registry+https://github.com/rust-lang/crates.io-index"
51155151
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
51165152

5153+
[[package]]
5154+
name = "simd-adler32"
5155+
version = "0.3.7"
5156+
source = "registry+https://github.com/rust-lang/crates.io-index"
5157+
checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe"
5158+
51175159
[[package]]
51185160
name = "siphasher"
51195161
version = "0.3.11"
@@ -5379,7 +5421,7 @@ dependencies = [
53795421
"libc",
53805422
"ntapi",
53815423
"once_cell",
5382-
"windows",
5424+
"windows 0.52.0",
53835425
]
53845426

53855427
[[package]]
@@ -6310,6 +6352,15 @@ version = "0.4.0"
63106352
source = "registry+https://github.com/rust-lang/crates.io-index"
63116353
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
63126354

6355+
[[package]]
6356+
name = "windows"
6357+
version = "0.48.0"
6358+
source = "registry+https://github.com/rust-lang/crates.io-index"
6359+
checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f"
6360+
dependencies = [
6361+
"windows-targets 0.48.5",
6362+
]
6363+
63136364
[[package]]
63146365
name = "windows"
63156366
version = "0.52.0"

Cargo.toml

+8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
[workspace]
22
resolver = "1"
33
members = [
4+
"miniz_oxide-0.7.2",
5+
"regex-1.8.4",
6+
"crossbeam-utils-0.8.19",
47
"compiler/rustc",
58
"library/std",
69
"library/sysroot",
@@ -112,5 +115,10 @@ rustc-std-workspace-core = { path = 'library/rustc-std-workspace-core' }
112115
rustc-std-workspace-alloc = { path = 'library/rustc-std-workspace-alloc' }
113116
rustc-std-workspace-std = { path = 'library/rustc-std-workspace-std' }
114117

118+
miniz_oxide = { path = 'miniz_oxide-0.7.2' }
119+
regex = { path = 'regex-1.8.4' }
120+
crossbeam-utils = { path = 'crossbeam-utils-0.8.19' }
121+
ctrlc = { git = "https://github.com/WaffleLapkin/rust-ctrlc.git", rev = "17e3ee4b35f7988489a3d9fd7a3b10e81ca94809" }
122+
115123
[patch."https://github.com/rust-lang/rust-clippy"]
116124
clippy_lints = { path = "src/tools/clippy/clippy_lints" }

compiler/rustc_codegen_ssa/src/back/metadata.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ pub(super) fn get_metadata_xcoff<'a>(path: &Path, data: &'a [u8]) -> Result<&'a
174174
return Ok(&info_data[offset..(offset + len)]);
175175
} else {
176176
return Err(format!("Unable to find symbol {AIX_METADATA_SYMBOL_NAME}"));
177-
};
177+
}
178178
}
179179

180180
pub(crate) fn create_object_file(sess: &Session) -> Option<write::Object<'static>> {

compiler/rustc_const_eval/src/const_eval/dummy_machine.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@ impl<'mir, 'tcx: 'mir> interpret::Machine<'mir, 'tcx> for DummyMachine {
6464
is_write: bool,
6565
) -> InterpResult<'tcx> {
6666
if is_write {
67-
throw_machine_stop_str!("can't write to global");
67+
throw_machine_stop_str!("can't write to global")
6868
}
6969

7070
// If the static allocation is mutable, then we can't const prop it as its content
7171
// might be different at runtime.
7272
if alloc.inner().mutability.is_mut() {
73-
throw_machine_stop_str!("can't access mutable globals in ConstProp");
73+
throw_machine_stop_str!("can't access mutable globals in ConstProp")
7474
}
7575

7676
Ok(())

compiler/rustc_const_eval/src/const_eval/eval_queries.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,7 @@ pub fn eval_to_const_value_raw_provider<'tcx>(
264264
// Catch such calls and evaluate them instead of trying to load a constant's MIR.
265265
if let ty::InstanceDef::Intrinsic(def_id) = key.value.instance.def {
266266
let ty = key.value.instance.ty(tcx, key.param_env);
267-
let ty::FnDef(_, args) = ty.kind() else {
268-
bug!("intrinsic with type {:?}", ty);
269-
};
267+
let ty::FnDef(_, args) = ty.kind() else { bug!("intrinsic with type {:?}", ty) };
270268
return eval_nullary_intrinsic(tcx, key.param_env, def_id, args).map_err(|error| {
271269
let span = tcx.def_span(def_id);
272270

compiler/rustc_const_eval/src/interpret/validity.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, '
476476
Some(CtfeValidationMode::Const { .. }) => {
477477
// We can't recursively validate `extern static`, so we better reject them.
478478
if self.ecx.tcx.is_foreign_item(did) {
479-
throw_validation_failure!(self.path, ConstRefToExtern);
479+
throw_validation_failure!(self.path, ConstRefToExtern)
480480
}
481481
}
482482
None => {}
@@ -518,14 +518,14 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, '
518518
if ptr_expected_mutbl == Mutability::Mut
519519
&& alloc_actual_mutbl == Mutability::Not
520520
{
521-
throw_validation_failure!(self.path, MutableRefToImmutable);
521+
throw_validation_failure!(self.path, MutableRefToImmutable)
522522
}
523523
// In a const, everything must be completely immutable.
524524
if matches!(self.ctfe_mode, Some(CtfeValidationMode::Const { .. })) {
525525
if ptr_expected_mutbl == Mutability::Mut
526526
|| alloc_actual_mutbl == Mutability::Mut
527527
{
528-
throw_validation_failure!(self.path, ConstRefToMutable);
528+
throw_validation_failure!(self.path, ConstRefToMutable)
529529
}
530530
}
531531
}
@@ -621,7 +621,7 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, '
621621
} else {
622622
// Otherwise (for standalone Miri), we have to still check it to be non-null.
623623
if self.ecx.scalar_may_be_null(value)? {
624-
throw_validation_failure!(self.path, NullFnPtr);
624+
throw_validation_failure!(self.path, NullFnPtr)
625625
}
626626
}
627627
Ok(true)
@@ -786,7 +786,7 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValueVisitor<'mir, 'tcx, M>
786786
if self.ctfe_mode.is_some_and(|c| !c.allow_immutable_unsafe_cell()) {
787787
if !op.layout.is_zst() && !op.layout.ty.is_freeze(*self.ecx.tcx, self.ecx.param_env) {
788788
if !self.in_mutable_memory(op) {
789-
throw_validation_failure!(self.path, UnsafeCellInImmutable);
789+
throw_validation_failure!(self.path, UnsafeCellInImmutable)
790790
}
791791
}
792792
}
@@ -819,7 +819,7 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValueVisitor<'mir, 'tcx, M>
819819
&& def.is_unsafe_cell()
820820
{
821821
if !self.in_mutable_memory(op) {
822-
throw_validation_failure!(self.path, UnsafeCellInImmutable);
822+
throw_validation_failure!(self.path, UnsafeCellInImmutable)
823823
}
824824
}
825825
}
@@ -934,7 +934,7 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValueVisitor<'mir, 'tcx, M>
934934
match op.layout.abi {
935935
Abi::Uninhabited => {
936936
let ty = op.layout.ty;
937-
throw_validation_failure!(self.path, UninhabitedVal { ty });
937+
throw_validation_failure!(self.path, UninhabitedVal { ty })
938938
}
939939
Abi::Scalar(scalar_layout) => {
940940
if !scalar_layout.is_uninit_valid() {

compiler/rustc_driver_impl/src/lib.rs

+13-15
Original file line numberDiff line numberDiff line change
@@ -643,21 +643,19 @@ fn process_rlink(sess: &Session, compiler: &interface::Compiler) {
643643
});
644644
let (codegen_results, outputs) = match CodegenResults::deserialize_rlink(sess, rlink_data) {
645645
Ok((codegen, outputs)) => (codegen, outputs),
646-
Err(err) => {
647-
match err {
648-
CodegenErrors::WrongFileType => dcx.emit_fatal(RLinkWrongFileType),
649-
CodegenErrors::EmptyVersionNumber => dcx.emit_fatal(RLinkEmptyVersionNumber),
650-
CodegenErrors::EncodingVersionMismatch { version_array, rlink_version } => sess
651-
.dcx()
652-
.emit_fatal(RLinkEncodingVersionMismatch { version_array, rlink_version }),
653-
CodegenErrors::RustcVersionMismatch { rustc_version } => {
654-
dcx.emit_fatal(RLinkRustcVersionMismatch {
655-
rustc_version,
656-
current_version: sess.cfg_version,
657-
})
658-
}
659-
};
660-
}
646+
Err(err) => match err {
647+
CodegenErrors::WrongFileType => dcx.emit_fatal(RLinkWrongFileType),
648+
CodegenErrors::EmptyVersionNumber => dcx.emit_fatal(RLinkEmptyVersionNumber),
649+
CodegenErrors::EncodingVersionMismatch { version_array, rlink_version } => sess
650+
.dcx()
651+
.emit_fatal(RLinkEncodingVersionMismatch { version_array, rlink_version }),
652+
CodegenErrors::RustcVersionMismatch { rustc_version } => {
653+
dcx.emit_fatal(RLinkRustcVersionMismatch {
654+
rustc_version,
655+
current_version: sess.cfg_version,
656+
})
657+
}
658+
},
661659
};
662660
if compiler.codegen_backend.link(sess, codegen_results, &outputs).is_err() {
663661
FatalError.raise();

compiler/rustc_hir_analysis/src/collect/type_of.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,7 @@ fn anon_const_type_of<'tcx>(tcx: TyCtxt<'tcx>, def_id: LocalDefId) -> Ty<'tcx> {
125125
.filter(|arg| arg.is_ty_or_const())
126126
.position(|arg| arg.hir_id() == hir_id)
127127
})
128-
.unwrap_or_else(|| {
129-
bug!("no arg matching AnonConst in segment");
130-
});
128+
.unwrap_or_else(|| bug!("no arg matching AnonConst in segment"));
131129

132130
(generics, arg_index)
133131
} else {
@@ -164,9 +162,7 @@ fn anon_const_type_of<'tcx>(tcx: TyCtxt<'tcx>, def_id: LocalDefId) -> Ty<'tcx> {
164162
.filter(|arg| arg.is_ty_or_const())
165163
.position(|arg| arg.hir_id() == hir_id)
166164
})
167-
.unwrap_or_else(|| {
168-
bug!("no arg matching AnonConst in segment");
169-
});
165+
.unwrap_or_else(|| bug!("no arg matching AnonConst in segment"));
170166

171167
(tcx.generics_of(type_dependent_def), idx)
172168
}

compiler/rustc_hir_typeck/src/fn_ctxt/mod.rs

+5
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,11 @@ fn parse_never_type_options_attr(
438438
}
439439

440440
let fallback = fallback.unwrap_or_else(|| {
441+
if true {
442+
// For a crater experiment, turn off all fallback
443+
return NoFallback;
444+
}
445+
441446
if tcx.features().never_type_fallback { FallbackToNiko } else { FallbackToUnit }
442447
});
443448

0 commit comments

Comments
 (0)