Skip to content

Commit 614a1bf

Browse files
committed
Auto merge of rust-lang#122955 - WaffleLapkin:no-more-fallback, r=<try>
[experiment] Turn offf never type fallback Crater experiment
2 parents 2f090c3 + 45506e8 commit 614a1bf

File tree

159 files changed

+39607
-106
lines changed

Some content is hidden

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

159 files changed

+39607
-106
lines changed

Cargo.lock

+65-13
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"
@@ -1533,6 +1535,19 @@ dependencies = [
15331535
"windows-bindgen",
15341536
]
15351537

1538+
[[package]]
1539+
name = "generator"
1540+
version = "0.7.5"
1541+
source = "registry+https://github.com/rust-lang/crates.io-index"
1542+
checksum = "5cc16584ff22b460a382b7feec54b23d2908d858152e5739a120b949293bd74e"
1543+
dependencies = [
1544+
"cc",
1545+
"libc",
1546+
"log",
1547+
"rustversion",
1548+
"windows 0.48.0",
1549+
]
1550+
15361551
[[package]]
15371552
name = "generic-array"
15381553
version = "0.14.7"
@@ -2304,6 +2319,19 @@ version = "0.4.21"
23042319
source = "registry+https://github.com/rust-lang/crates.io-index"
23052320
checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c"
23062321

2322+
[[package]]
2323+
name = "loom"
2324+
version = "0.7.1"
2325+
source = "registry+https://github.com/rust-lang/crates.io-index"
2326+
checksum = "7e045d70ddfbc984eacfa964ded019534e8f6cbf36f6410aee0ed5cefa5a9175"
2327+
dependencies = [
2328+
"cfg-if",
2329+
"generator",
2330+
"scoped-tls",
2331+
"tracing",
2332+
"tracing-subscriber",
2333+
]
2334+
23072335
[[package]]
23082336
name = "lzma-sys"
23092337
version = "0.1.20"
@@ -2461,13 +2489,12 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
24612489
[[package]]
24622490
name = "miniz_oxide"
24632491
version = "0.7.2"
2464-
source = "registry+https://github.com/rust-lang/crates.io-index"
2465-
checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7"
24662492
dependencies = [
24672493
"adler",
24682494
"compiler_builtins",
24692495
"rustc-std-workspace-alloc",
24702496
"rustc-std-workspace-core",
2497+
"simd-adler32",
24712498
]
24722499

24732500
[[package]]
@@ -3084,6 +3111,15 @@ version = "0.4.1"
30843111
source = "registry+https://github.com/rust-lang/crates.io-index"
30853112
checksum = "e9e1dcb320d6839f6edb64f7a4a59d39b30480d4d1765b56873f7c858538a5fe"
30863113

3114+
[[package]]
3115+
name = "quickcheck"
3116+
version = "1.0.3"
3117+
source = "registry+https://github.com/rust-lang/crates.io-index"
3118+
checksum = "588f6378e4dd99458b60ec275b4477add41ce4fa9f64dcba6f15adccb19b50d6"
3119+
dependencies = [
3120+
"rand",
3121+
]
3122+
30873123
[[package]]
30883124
name = "quine-mc_cluskey"
30893125
version = "0.2.4"
@@ -3211,11 +3247,12 @@ dependencies = [
32113247
[[package]]
32123248
name = "regex"
32133249
version = "1.8.4"
3214-
source = "registry+https://github.com/rust-lang/crates.io-index"
3215-
checksum = "d0ab3ca65655bb1e41f2a8c8cd662eb4fb035e67c3f78da1d61dffe89d07300f"
32163250
dependencies = [
32173251
"aho-corasick",
3252+
"lazy_static",
32183253
"memchr",
3254+
"quickcheck",
3255+
"rand",
32193256
"regex-syntax 0.7.5",
32203257
]
32213258

@@ -3713,7 +3750,7 @@ dependencies = [
37133750
"thorin-dwp",
37143751
"tracing",
37153752
"wasm-encoder",
3716-
"windows",
3753+
"windows 0.52.0",
37173754
]
37183755

37193756
[[package]]
@@ -3770,7 +3807,7 @@ dependencies = [
37703807
"tempfile",
37713808
"thin-vec",
37723809
"tracing",
3773-
"windows",
3810+
"windows 0.52.0",
37743811
]
37753812

37763813
[[package]]
@@ -3832,7 +3869,7 @@ dependencies = [
38323869
"shlex",
38333870
"time",
38343871
"tracing",
3835-
"windows",
3872+
"windows 0.52.0",
38363873
]
38373874

38383875
[[package]]
@@ -3884,7 +3921,7 @@ dependencies = [
38843921
"termize",
38853922
"tracing",
38863923
"unicode-width",
3887-
"windows",
3924+
"windows 0.52.0",
38883925
]
38893926

38903927
[[package]]
@@ -4582,7 +4619,7 @@ dependencies = [
45824619
"smallvec",
45834620
"termize",
45844621
"tracing",
4585-
"windows",
4622+
"windows 0.52.0",
45864623
]
45874624

45884625
[[package]]
@@ -5100,6 +5137,12 @@ version = "1.3.0"
51005137
source = "registry+https://github.com/rust-lang/crates.io-index"
51015138
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
51025139

5140+
[[package]]
5141+
name = "simd-adler32"
5142+
version = "0.3.7"
5143+
source = "registry+https://github.com/rust-lang/crates.io-index"
5144+
checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe"
5145+
51035146
[[package]]
51045147
name = "siphasher"
51055148
version = "0.3.11"
@@ -5365,7 +5408,7 @@ dependencies = [
53655408
"libc",
53665409
"ntapi",
53675410
"once_cell",
5368-
"windows",
5411+
"windows 0.52.0",
53695412
]
53705413

53715414
[[package]]
@@ -6307,6 +6350,15 @@ version = "0.4.0"
63076350
source = "registry+https://github.com/rust-lang/crates.io-index"
63086351
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
63096352

6353+
[[package]]
6354+
name = "windows"
6355+
version = "0.48.0"
6356+
source = "registry+https://github.com/rust-lang/crates.io-index"
6357+
checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f"
6358+
dependencies = [
6359+
"windows-targets 0.48.5",
6360+
]
6361+
63106362
[[package]]
63116363
name = "windows"
63126364
version = "0.52.0"

Cargo.toml

+7
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,9 @@ 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+
115122
[patch."https://github.com/rust-lang/rust-clippy"]
116123
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/eval_queries.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,7 @@ pub fn eval_to_const_value_raw_provider<'tcx>(
257257
// Catch such calls and evaluate them instead of trying to load a constant's MIR.
258258
if let ty::InstanceDef::Intrinsic(def_id) = key.value.instance.def {
259259
let ty = key.value.instance.ty(tcx, key.param_env);
260-
let ty::FnDef(_, args) = ty.kind() else {
261-
bug!("intrinsic with type {:?}", ty);
262-
};
260+
let ty::FnDef(_, args) = ty.kind() else { bug!("intrinsic with type {:?}", ty) };
263261
return eval_nullary_intrinsic(tcx, key.param_env, def_id, args).map_err(|error| {
264262
let span = tcx.def_span(def_id);
265263

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
@@ -642,21 +642,19 @@ fn process_rlink(sess: &Session, compiler: &interface::Compiler) {
642642
});
643643
let (codegen_results, outputs) = match CodegenResults::deserialize_rlink(sess, rlink_data) {
644644
Ok((codegen, outputs)) => (codegen, outputs),
645-
Err(err) => {
646-
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-
};
659-
}
645+
Err(err) => match err {
646+
CodegenErrors::WrongFileType => dcx.emit_fatal(RLinkWrongFileType),
647+
CodegenErrors::EmptyVersionNumber => dcx.emit_fatal(RLinkEmptyVersionNumber),
648+
CodegenErrors::EncodingVersionMismatch { version_array, rlink_version } => sess
649+
.dcx()
650+
.emit_fatal(RLinkEncodingVersionMismatch { version_array, rlink_version }),
651+
CodegenErrors::RustcVersionMismatch { rustc_version } => {
652+
dcx.emit_fatal(RLinkRustcVersionMismatch {
653+
rustc_version,
654+
current_version: sess.cfg_version,
655+
})
656+
}
657+
},
660658
};
661659
if compiler.codegen_backend.link(sess, codegen_results, &outputs).is_err() {
662660
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

compiler/rustc_hir_typeck/src/lib.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -344,9 +344,8 @@ pub struct EnclosingBreakables<'tcx> {
344344

345345
impl<'tcx> EnclosingBreakables<'tcx> {
346346
fn find_breakable(&mut self, target_id: hir::HirId) -> &mut BreakableCtxt<'tcx> {
347-
self.opt_find_breakable(target_id).unwrap_or_else(|| {
348-
bug!("could not find enclosing breakable with id {}", target_id);
349-
})
347+
self.opt_find_breakable(target_id)
348+
.unwrap_or_else(|| bug!("could not find enclosing breakable with id {}", target_id))
350349
}
351350

352351
fn opt_find_breakable(&mut self, target_id: hir::HirId) -> Option<&mut BreakableCtxt<'tcx>> {

compiler/rustc_lint/src/types.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1118,7 +1118,7 @@ pub(crate) fn repr_nullable_ptr<'tcx>(
11181118
WrappingRange { start, end } => {
11191119
unreachable!("Unhandled start and end range: ({}, {})", start, end)
11201120
}
1121-
};
1121+
}
11221122
}
11231123
}
11241124
None

0 commit comments

Comments
 (0)