From 3561dc948c1a2a24c2b49992099954a96be3c8ee Mon Sep 17 00:00:00 2001 From: Oleksii Lozovskyi Date: Sun, 2 Oct 2022 10:55:35 +0900 Subject: Emit an error if -Z instrument-xray is not supported This is somewhat important because LLVM enables the pass based on target architecture, but support by the target OS also matters. For example, XRay attributes are processed by codegen for macOS targets, but Apple linker fails to process relocations in XRay data sections, so the feature as a whole is not supported there for the time being. --- compiler/rustc_session/src/errors.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'compiler/rustc_session/src/errors.rs') diff --git a/compiler/rustc_session/src/errors.rs b/compiler/rustc_session/src/errors.rs index 8e8fba5e236..c851145440b 100644 --- a/compiler/rustc_session/src/errors.rs +++ b/compiler/rustc_session/src/errors.rs @@ -71,6 +71,12 @@ pub struct ProfileSampleUseFileDoesNotExist<'a> { #[diag(session_target_requires_unwind_tables)] pub struct TargetRequiresUnwindTables; +#[derive(Diagnostic)] +#[diag(session_instrumentation_not_supported)] +pub struct InstrumentationNotSupported { + pub us: String, +} + #[derive(Diagnostic)] #[diag(session_sanitizer_not_supported)] pub struct SanitizerNotSupported { -- cgit 1.4.1-3-g733a5