Skip to content

Commit e3590fc

Browse files
committed
Auto merge of #114637 - matthiaskrgr:rollup-544y8p5, r=matthiaskrgr
Rollup of 11 pull requests Successful merges: - #106425 (Make ExitStatus implement Default) - #113480 (add aarch64-unknown-teeos target) - #113586 (Mention style for new syntax in tracking issue template) - #113593 (CFI: Fix error compiling core with LLVM CFI enabled) - #114612 (update llvm-wrapper include to silence deprecation warning) - #114613 (Prevent constant rebuilds of `rustc-main` (and thus everything else)) - #114615 (interpret: remove incomplete protection against invalid where clauses) - #114628 (Allowing re-implementation of mir_drops_elaborated query) - #114629 (tests: Uncomment now valid GAT code behind FIXME) - #114630 (Migrate GUI colors test to original CSS color format) - #114631 (add provisional cache test for new solver) r? `@ghost` `@rustbot` modify labels: rollup
2 parents f88a8b7 + a5e91ed commit e3590fc

Some content is hidden

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

46 files changed

+439
-205
lines changed

.github/ISSUE_TEMPLATE/tracking_issue.md

+3
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,13 @@ for larger features an implementation could be broken up into multiple PRs.
3939
- [ ] Implement the RFC (cc @rust-lang/XXX -- can anyone write up mentoring
4040
instructions?)
4141
- [ ] Adjust documentation ([see instructions on rustc-dev-guide][doc-guide])
42+
- [ ] Formatting for new syntax has been added to the [Style Guide] ([nightly-style-procedure])
4243
- [ ] Stabilization PR ([see instructions on rustc-dev-guide][stabilization-guide])
4344

4445
[stabilization-guide]: https://rustc-dev-guide.rust-lang.org/stabilization_guide.html#stabilization-pr
4546
[doc-guide]: https://rustc-dev-guide.rust-lang.org/stabilization_guide.html#documentation-prs
47+
[nightly-style-procedure]: https://github.com/rust-lang/style-team/blob/master/nightly-style-procedure.md
48+
[Style Guide]: https://github.com/rust-lang/rust/tree/master/src/doc/style-guide
4649

4750
### Unresolved Questions
4851
<!--

compiler/rustc_codegen_llvm/src/back/write.rs

+3
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,8 @@ pub(crate) unsafe fn llvm_optimize(
472472
Some(llvm::SanitizerOptions {
473473
sanitize_address: config.sanitizer.contains(SanitizerSet::ADDRESS),
474474
sanitize_address_recover: config.sanitizer_recover.contains(SanitizerSet::ADDRESS),
475+
sanitize_cfi: config.sanitizer.contains(SanitizerSet::CFI),
476+
sanitize_kcfi: config.sanitizer.contains(SanitizerSet::KCFI),
475477
sanitize_memory: config.sanitizer.contains(SanitizerSet::MEMORY),
476478
sanitize_memory_recover: config.sanitizer_recover.contains(SanitizerSet::MEMORY),
477479
sanitize_memory_track_origins: config.sanitizer_memory_track_origins as c_int,
@@ -507,6 +509,7 @@ pub(crate) unsafe fn llvm_optimize(
507509
&*module.module_llvm.tm,
508510
to_pass_builder_opt_level(opt_level),
509511
opt_stage,
512+
cgcx.opts.cg.linker_plugin_lto.enabled(),
510513
config.no_prepopulate_passes,
511514
config.verify_llvm_ir,
512515
using_thin_buffers,

compiler/rustc_codegen_llvm/src/builder.rs

+22-21
Original file line numberDiff line numberDiff line change
@@ -1512,9 +1512,9 @@ impl<'a, 'll, 'tcx> Builder<'a, 'll, 'tcx> {
15121512
fn_abi: Option<&FnAbi<'tcx, Ty<'tcx>>>,
15131513
llfn: &'ll Value,
15141514
) {
1515-
let is_indirect_call = unsafe { llvm::LLVMIsAFunction(llfn).is_none() };
1516-
if is_indirect_call && fn_abi.is_some() && self.tcx.sess.is_sanitizer_cfi_enabled() {
1517-
if fn_attrs.is_some() && fn_attrs.unwrap().no_sanitize.contains(SanitizerSet::CFI) {
1515+
let is_indirect_call = unsafe { llvm::LLVMRustIsNonGVFunctionPointerTy(llfn) };
1516+
if self.tcx.sess.is_sanitizer_cfi_enabled() && let Some(fn_abi) = fn_abi && is_indirect_call {
1517+
if let Some(fn_attrs) = fn_attrs && fn_attrs.no_sanitize.contains(SanitizerSet::CFI) {
15181518
return;
15191519
}
15201520

@@ -1526,7 +1526,7 @@ impl<'a, 'll, 'tcx> Builder<'a, 'll, 'tcx> {
15261526
options.insert(TypeIdOptions::NORMALIZE_INTEGERS);
15271527
}
15281528

1529-
let typeid = typeid_for_fnabi(self.tcx, fn_abi.unwrap(), options);
1529+
let typeid = typeid_for_fnabi(self.tcx, fn_abi, options);
15301530
let typeid_metadata = self.cx.typeid_metadata(typeid).unwrap();
15311531

15321532
// Test whether the function pointer is associated with the type identifier.
@@ -1550,25 +1550,26 @@ impl<'a, 'll, 'tcx> Builder<'a, 'll, 'tcx> {
15501550
fn_abi: Option<&FnAbi<'tcx, Ty<'tcx>>>,
15511551
llfn: &'ll Value,
15521552
) -> Option<llvm::OperandBundleDef<'ll>> {
1553-
let is_indirect_call = unsafe { llvm::LLVMIsAFunction(llfn).is_none() };
1554-
let kcfi_bundle = if is_indirect_call && self.tcx.sess.is_sanitizer_kcfi_enabled() {
1555-
if fn_attrs.is_some() && fn_attrs.unwrap().no_sanitize.contains(SanitizerSet::KCFI) {
1556-
return None;
1557-
}
1553+
let is_indirect_call = unsafe { llvm::LLVMRustIsNonGVFunctionPointerTy(llfn) };
1554+
let kcfi_bundle =
1555+
if self.tcx.sess.is_sanitizer_kcfi_enabled() && let Some(fn_abi) = fn_abi && is_indirect_call {
1556+
if let Some(fn_attrs) = fn_attrs && fn_attrs.no_sanitize.contains(SanitizerSet::KCFI) {
1557+
return None;
1558+
}
15581559

1559-
let mut options = TypeIdOptions::empty();
1560-
if self.tcx.sess.is_sanitizer_cfi_generalize_pointers_enabled() {
1561-
options.insert(TypeIdOptions::GENERALIZE_POINTERS);
1562-
}
1563-
if self.tcx.sess.is_sanitizer_cfi_normalize_integers_enabled() {
1564-
options.insert(TypeIdOptions::NORMALIZE_INTEGERS);
1565-
}
1560+
let mut options = TypeIdOptions::empty();
1561+
if self.tcx.sess.is_sanitizer_cfi_generalize_pointers_enabled() {
1562+
options.insert(TypeIdOptions::GENERALIZE_POINTERS);
1563+
}
1564+
if self.tcx.sess.is_sanitizer_cfi_normalize_integers_enabled() {
1565+
options.insert(TypeIdOptions::NORMALIZE_INTEGERS);
1566+
}
15661567

1567-
let kcfi_typeid = kcfi_typeid_for_fnabi(self.tcx, fn_abi.unwrap(), options);
1568-
Some(llvm::OperandBundleDef::new("kcfi", &[self.const_u32(kcfi_typeid)]))
1569-
} else {
1570-
None
1571-
};
1568+
let kcfi_typeid = kcfi_typeid_for_fnabi(self.tcx, fn_abi, options);
1569+
Some(llvm::OperandBundleDef::new("kcfi", &[self.const_u32(kcfi_typeid)]))
1570+
} else {
1571+
None
1572+
};
15721573
kcfi_bundle
15731574
}
15741575
}

compiler/rustc_codegen_llvm/src/llvm/ffi.rs

+4
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,8 @@ pub enum OptStage {
475475
pub struct SanitizerOptions {
476476
pub sanitize_address: bool,
477477
pub sanitize_address_recover: bool,
478+
pub sanitize_cfi: bool,
479+
pub sanitize_kcfi: bool,
478480
pub sanitize_memory: bool,
479481
pub sanitize_memory_recover: bool,
480482
pub sanitize_memory_track_origins: c_int,
@@ -894,6 +896,7 @@ extern "C" {
894896
pub fn LLVMRustGlobalAddMetadata<'a>(Val: &'a Value, KindID: c_uint, Metadata: &'a Metadata);
895897
pub fn LLVMValueAsMetadata(Node: &Value) -> &Metadata;
896898
pub fn LLVMIsAFunction(Val: &Value) -> Option<&Value>;
899+
pub fn LLVMRustIsNonGVFunctionPointerTy(Val: &Value) -> bool;
897900

898901
// Operations on constants of any type
899902
pub fn LLVMConstNull(Ty: &Type) -> &Value;
@@ -2138,6 +2141,7 @@ extern "C" {
21382141
TM: &'a TargetMachine,
21392142
OptLevel: PassBuilderOptLevel,
21402143
OptStage: OptStage,
2144+
IsLinkerPluginLTO: bool,
21412145
NoPrepopulatePasses: bool,
21422146
VerifyIR: bool,
21432147
UseThinLTOBuffers: bool,

compiler/rustc_const_eval/messages.ftl

-2
Original file line numberDiff line numberDiff line change
@@ -303,8 +303,6 @@ const_eval_remainder_overflow =
303303
overflow in signed remainder (dividing MIN by -1)
304304
const_eval_scalar_size_mismatch =
305305
scalar size mismatch: expected {$target_size} bytes but got {$data_size} bytes instead
306-
const_eval_size_of_unsized =
307-
size_of called on unsized type `{$ty}`
308306
const_eval_size_overflow =
309307
overflow computing total size of `{$name}`
310308

compiler/rustc_const_eval/src/errors.rs

-4
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,6 @@ impl<'tcx> ReportErrorExt for InvalidProgramInfo<'tcx> {
862862
InvalidProgramInfo::FnAbiAdjustForForeignAbi(_) => {
863863
rustc_middle::error::middle_adjust_for_foreign_abi_error
864864
}
865-
InvalidProgramInfo::SizeOfUnsizedType(_) => const_eval_size_of_unsized,
866865
InvalidProgramInfo::ConstPropNonsense => {
867866
panic!("We had const-prop nonsense, this should never be printed")
868867
}
@@ -890,9 +889,6 @@ impl<'tcx> ReportErrorExt for InvalidProgramInfo<'tcx> {
890889
builder.set_arg("arch", arch);
891890
builder.set_arg("abi", abi.name());
892891
}
893-
InvalidProgramInfo::SizeOfUnsizedType(ty) => {
894-
builder.set_arg("ty", ty);
895-
}
896892
}
897893
}
898894
}

compiler/rustc_const_eval/src/interpret/step.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -269,13 +269,10 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
269269
let ty = self.subst_from_current_frame_and_normalize_erasing_regions(ty)?;
270270
let layout = self.layout_of(ty)?;
271271
if let mir::NullOp::SizeOf | mir::NullOp::AlignOf = null_op && layout.is_unsized() {
272-
// FIXME: This should be a span_bug, but const generics can run MIR
273-
// that is not properly type-checked yet (#97477).
274-
self.tcx.sess.delay_span_bug(
272+
span_bug!(
275273
self.frame().current_span(),
276-
format!("{null_op:?} MIR operator called for unsized type {ty}"),
274+
"{null_op:?} MIR operator called for unsized type {ty}",
277275
);
278-
throw_inval!(SizeOfUnsizedType(ty));
279276
}
280277
let val = match null_op {
281278
mir::NullOp::SizeOf => layout.size.bytes(),

compiler/rustc_llvm/llvm-wrapper/LLVMWrapper.h

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include "llvm/Support/DynamicLibrary.h"
1616
#include "llvm/Support/FormattedStream.h"
1717
#include "llvm/Support/JSON.h"
18-
#include "llvm/Support/Host.h"
1918
#include "llvm/Support/Memory.h"
2019
#include "llvm/Support/SourceMgr.h"
2120
#include "llvm/Support/TargetSelect.h"

compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp

+16-1
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@
2525
#if LLVM_VERSION_GE(17, 0)
2626
#include "llvm/Support/VirtualFileSystem.h"
2727
#endif
28-
#include "llvm/Support/Host.h"
2928
#include "llvm/Target/TargetMachine.h"
3029
#include "llvm/Transforms/IPO/AlwaysInliner.h"
3130
#include "llvm/Transforms/IPO/FunctionImport.h"
3231
#include "llvm/Transforms/IPO/Internalize.h"
32+
#include "llvm/Transforms/IPO/LowerTypeTests.h"
3333
#include "llvm/Transforms/IPO/ThinLTOBitcodeWriter.h"
3434
#include "llvm/Transforms/Utils/AddDiscriminators.h"
3535
#include "llvm/Transforms/Utils/FunctionImportUtils.h"
@@ -609,6 +609,8 @@ enum class LLVMRustOptStage {
609609
struct LLVMRustSanitizerOptions {
610610
bool SanitizeAddress;
611611
bool SanitizeAddressRecover;
612+
bool SanitizeCFI;
613+
bool SanitizeKCFI;
612614
bool SanitizeMemory;
613615
bool SanitizeMemoryRecover;
614616
int SanitizeMemoryTrackOrigins;
@@ -625,6 +627,7 @@ LLVMRustOptimize(
625627
LLVMTargetMachineRef TMRef,
626628
LLVMRustPassBuilderOptLevel OptLevelRust,
627629
LLVMRustOptStage OptStage,
630+
bool IsLinkerPluginLTO,
628631
bool NoPrepopulatePasses, bool VerifyIR, bool UseThinLTOBuffers,
629632
bool MergeFunctions, bool UnrollLoops, bool SLPVectorize, bool LoopVectorize,
630633
bool DisableSimplifyLibCalls, bool EmitLifetimeMarkers,
@@ -736,6 +739,18 @@ LLVMRustOptimize(
736739
std::vector<std::function<void(ModulePassManager &, OptimizationLevel)>>
737740
OptimizerLastEPCallbacks;
738741

742+
if (!IsLinkerPluginLTO
743+
&& SanitizerOptions && SanitizerOptions->SanitizeCFI
744+
&& !NoPrepopulatePasses) {
745+
PipelineStartEPCallbacks.push_back(
746+
[](ModulePassManager &MPM, OptimizationLevel Level) {
747+
MPM.addPass(LowerTypeTestsPass(/*ExportSummary=*/nullptr,
748+
/*ImportSummary=*/nullptr,
749+
/*DropTypeTests=*/false));
750+
}
751+
);
752+
}
753+
739754
if (VerifyIR) {
740755
PipelineStartEPCallbacks.push_back(
741756
[VerifyIR](ModulePassManager &MPM, OptimizationLevel Level) {

compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp

+11
Original file line numberDiff line numberDiff line change
@@ -2033,3 +2033,14 @@ extern "C" int32_t LLVMRustGetElementTypeArgIndex(LLVMValueRef CallSite) {
20332033
extern "C" bool LLVMRustIsBitcode(char *ptr, size_t len) {
20342034
return identify_magic(StringRef(ptr, len)) == file_magic::bitcode;
20352035
}
2036+
2037+
extern "C" bool LLVMRustIsNonGVFunctionPointerTy(LLVMValueRef V) {
2038+
if (unwrap<Value>(V)->getType()->isPointerTy()) {
2039+
if (auto *GV = dyn_cast<GlobalValue>(unwrap<Value>(V))) {
2040+
if (GV->getValueType()->isFunctionTy())
2041+
return false;
2042+
}
2043+
return true;
2044+
}
2045+
return false;
2046+
}

compiler/rustc_middle/src/mir/interpret/error.rs

-2
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,6 @@ pub enum InvalidProgramInfo<'tcx> {
184184
/// (which unfortunately typeck does not reject).
185185
/// Not using `FnAbiError` as that contains a nested `LayoutError`.
186186
FnAbiAdjustForForeignAbi(call::AdjustForForeignAbiError),
187-
/// SizeOf of unsized type was requested.
188-
SizeOfUnsizedType(Ty<'tcx>),
189187
/// We are runnning into a nonsense situation due to ConstProp violating our invariants.
190188
ConstPropNonsense,
191189
}

compiler/rustc_mir_transform/src/lib.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ mod errors;
7575
mod ffi_unwind_calls;
7676
mod function_item_references;
7777
mod generator;
78-
mod inline;
78+
pub mod inline;
7979
mod instsimplify;
8080
mod large_enums;
8181
mod lower_intrinsics;
@@ -431,7 +431,9 @@ fn mir_drops_elaborated_and_const_checked(tcx: TyCtxt<'_>, def: LocalDefId) -> &
431431
tcx.alloc_steal_mir(body)
432432
}
433433

434-
fn run_analysis_to_runtime_passes<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
434+
// Made public such that `mir_drops_elaborated_and_const_checked` can be overridden
435+
// by custom rustc drivers, running all the steps by themselves.
436+
pub fn run_analysis_to_runtime_passes<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
435437
assert!(body.phase == MirPhase::Analysis(AnalysisPhase::Initial));
436438
let did = body.source.def_id();
437439

compiler/rustc_session/messages.ftl

+3-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ session_sanitizer_cfi_generalize_pointers_requires_cfi = `-Zsanitizer-cfi-genera
8989
9090
session_sanitizer_cfi_normalize_integers_requires_cfi = `-Zsanitizer-cfi-normalize-integers` requires `-Zsanitizer=cfi` or `-Zsanitizer=kcfi`
9191
92-
session_sanitizer_cfi_requires_lto = `-Zsanitizer=cfi` requires `-Clto`, `-Clto=thin`, or `-Clinker-plugin-lto`
92+
session_sanitizer_cfi_requires_lto = `-Zsanitizer=cfi` requires `-Clto` or `-Clinker-plugin-lto`
93+
94+
session_sanitizer_cfi_requires_single_codegen_unit = `-Zsanitizer=cfi` with `-Clto` requires `-Ccodegen-units=1`
9395
9496
session_sanitizer_not_supported = {$us} sanitizer is not supported for this target
9597

compiler/rustc_session/src/errors.rs

+4
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@ pub struct CannotEnableCrtStaticLinux;
114114
#[diag(session_sanitizer_cfi_requires_lto)]
115115
pub struct SanitizerCfiRequiresLto;
116116

117+
#[derive(Diagnostic)]
118+
#[diag(session_sanitizer_cfi_requires_single_codegen_unit)]
119+
pub struct SanitizerCfiRequiresSingleCodegenUnit;
120+
117121
#[derive(Diagnostic)]
118122
#[diag(session_sanitizer_cfi_canonical_jump_tables_requires_cfi)]
119123
pub struct SanitizerCfiCanonicalJumpTablesRequiresCfi;

compiler/rustc_session/src/session.rs

+9-3
Original file line numberDiff line numberDiff line change
@@ -1619,13 +1619,19 @@ fn validate_commandline_args_with_session_available(sess: &Session) {
16191619

16201620
// LLVM CFI requires LTO.
16211621
if sess.is_sanitizer_cfi_enabled()
1622-
&& !(sess.lto() == config::Lto::Fat
1623-
|| sess.lto() == config::Lto::Thin
1624-
|| sess.opts.cg.linker_plugin_lto.enabled())
1622+
&& !(sess.lto() == config::Lto::Fat || sess.opts.cg.linker_plugin_lto.enabled())
16251623
{
16261624
sess.emit_err(errors::SanitizerCfiRequiresLto);
16271625
}
16281626

1627+
// LLVM CFI using rustc LTO requires a single codegen unit.
1628+
if sess.is_sanitizer_cfi_enabled()
1629+
&& sess.lto() == config::Lto::Fat
1630+
&& !(sess.codegen_units().as_usize() == 1)
1631+
{
1632+
sess.emit_err(errors::SanitizerCfiRequiresSingleCodegenUnit);
1633+
}
1634+
16291635
// LLVM CFI is incompatible with LLVM KCFI.
16301636
if sess.is_sanitizer_cfi_enabled() && sess.is_sanitizer_kcfi_enabled() {
16311637
sess.emit_err(errors::CannotMixAndMatchSanitizers {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
use crate::spec::Target;
2+
3+
pub fn target() -> Target {
4+
let mut base = super::teeos_base::opts();
5+
base.features = "+strict-align,+neon,+fp-armv8".into();
6+
base.max_atomic_width = Some(128);
7+
base.linker = Some("aarch64-linux-gnu-ld".into());
8+
9+
Target {
10+
llvm_target: "aarch64-unknown-none".into(),
11+
pointer_width: 64,
12+
data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".into(),
13+
arch: "aarch64".into(),
14+
options: base,
15+
}
16+
}

compiler/rustc_target/src/spec/mod.rs

+3
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ mod openbsd_base;
8383
mod redox_base;
8484
mod solaris_base;
8585
mod solid_base;
86+
mod teeos_base;
8687
mod thumb_base;
8788
mod uefi_msvc_base;
8889
mod unikraft_linux_musl_base;
@@ -1494,6 +1495,8 @@ supported_targets! {
14941495

14951496
("x86_64-unknown-none", x86_64_unknown_none),
14961497

1498+
("aarch64-unknown-teeos", aarch64_unknown_teeos),
1499+
14971500
("mips64-openwrt-linux-musl", mips64_openwrt_linux_musl),
14981501

14991502
("aarch64-unknown-nto-qnx710", aarch64_unknown_nto_qnx_710),
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
use super::{Cc, LinkerFlavor, Lld, PanicStrategy};
2+
use crate::spec::{RelroLevel, TargetOptions};
3+
4+
pub fn opts() -> TargetOptions {
5+
let lld_args = &["-zmax-page-size=4096", "-znow", "-ztext", "--execute-only"];
6+
let cc_args = &["-Wl,-zmax-page-size=4096", "-Wl,-znow", "-Wl,-ztext", "-mexecute-only"];
7+
8+
let mut pre_link_args = TargetOptions::link_args(LinkerFlavor::Gnu(Cc::No, Lld::No), lld_args);
9+
super::add_link_args(&mut pre_link_args, LinkerFlavor::Gnu(Cc::Yes, Lld::No), cc_args);
10+
11+
TargetOptions {
12+
os: "teeos".into(),
13+
vendor: "unknown".into(),
14+
dynamic_linking: true,
15+
linker_flavor: LinkerFlavor::Gnu(Cc::Yes, Lld::No),
16+
// rpath hardcodes -Wl, so it can't be used together with ld.lld.
17+
// C TAs also don't support rpath, so this is fine.
18+
has_rpath: false,
19+
// Note: Setting has_thread_local to true causes an error when
20+
// loading / dyn-linking the TA
21+
has_thread_local: false,
22+
position_independent_executables: true,
23+
relro_level: RelroLevel::Full,
24+
crt_static_respected: true,
25+
pre_link_args,
26+
panic_strategy: PanicStrategy::Abort,
27+
..Default::default()
28+
}
29+
}

library/std/src/process.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1528,7 +1528,7 @@ impl From<fs::File> for Stdio {
15281528
// vs `_exit`. Naming of Unix system calls is not standardised across Unices, so terminology is a
15291529
// matter of convention and tradition. For clarity we usually speak of `exit`, even when we might
15301530
// mean an underlying system call such as `_exit`.
1531-
#[derive(PartialEq, Eq, Clone, Copy, Debug)]
1531+
#[derive(PartialEq, Eq, Clone, Copy, Debug, Default)]
15321532
#[stable(feature = "process", since = "1.0.0")]
15331533
pub struct ExitStatus(imp::ExitStatus);
15341534

library/std/src/sys/unix/process/process_fuchsia.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ impl Process {
235235
}
236236
}
237237

238-
#[derive(PartialEq, Eq, Clone, Copy, Debug)]
238+
#[derive(PartialEq, Eq, Clone, Copy, Debug, Default)]
239239
pub struct ExitStatus(i64);
240240

241241
impl ExitStatus {

0 commit comments

Comments
 (0)