From 53238c3db6b293546f0b3bbd835ca85517ae9d8f Mon Sep 17 00:00:00 2001 From: Flakebi Date: Thu, 2 Jan 2025 13:15:21 +0100 Subject: Target option to require explicit cpu Some targets have many different CPUs and no generic CPU that can be used as a default. For these targets, the user needs to explicitly specify a CPU through `-C target-cpu=`. Add an option for targets and an error message if no CPU is set. This affects the proposed amdgpu and avr targets. --- compiler/rustc_codegen_ssa/src/errors.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'compiler/rustc_codegen_ssa/src/errors.rs') diff --git a/compiler/rustc_codegen_ssa/src/errors.rs b/compiler/rustc_codegen_ssa/src/errors.rs index c7213bbc801..7132219fb3d 100644 --- a/compiler/rustc_codegen_ssa/src/errors.rs +++ b/compiler/rustc_codegen_ssa/src/errors.rs @@ -491,6 +491,10 @@ pub(crate) struct CheckInstalledVisualStudio; #[diag(codegen_ssa_insufficient_vs_code_product)] pub(crate) struct InsufficientVSCodeProduct; +#[derive(Diagnostic)] +#[diag(codegen_ssa_cpu_required)] +pub(crate) struct CpuRequired; + #[derive(Diagnostic)] #[diag(codegen_ssa_processing_dymutil_failed)] #[note] -- cgit 1.4.1-3-g733a5