Skip to content

Commit

Permalink
-Zembed-source: Don't try to warn about incompatible codegen backends
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrmaxmeier committed Aug 6, 2024
1 parent 608901b commit 6899f5a
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 13 deletions.
2 changes: 0 additions & 2 deletions compiler/rustc_session/messages.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ session_embed_source_insufficient_dwarf_version = `-Zembed-source=y` requires at
session_embed_source_requires_debug_info = `-Zembed-source=y` requires debug information to be enabled
session_embed_source_requires_llvm_backend = `-Zembed-source=y` is only supported on the LLVM codegen backend
session_expr_parentheses_needed = parentheses are required to parse this as an expression
session_failed_to_create_profiler = failed to create profiler: {$err}
Expand Down
4 changes: 0 additions & 4 deletions compiler/rustc_session/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,6 @@ pub(crate) struct EmbedSourceInsufficientDwarfVersion {
#[diag(session_embed_source_requires_debug_info)]
pub(crate) struct EmbedSourceRequiresDebugInfo;

#[derive(Diagnostic)]
#[diag(session_embed_source_requires_llvm_backend)]
pub(crate) struct EmbedSourceRequiresLLVMBackend;

#[derive(Diagnostic)]
#[diag(session_target_stack_protector_not_supported)]
pub(crate) struct StackProtectorNotSupportedForTarget<'a> {
Expand Down
7 changes: 0 additions & 7 deletions compiler/rustc_session/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1305,20 +1305,13 @@ fn validate_commandline_args_with_session_available(sess: &Session) {
let dwarf_version =
sess.opts.unstable_opts.dwarf_version.unwrap_or(sess.target.default_dwarf_version);

let uses_llvm_backend =
matches!(sess.opts.unstable_opts.codegen_backend.as_deref(), None | Some("llvm"));

if dwarf_version < 5 {
sess.dcx().emit_warn(errors::EmbedSourceInsufficientDwarfVersion { dwarf_version });
}

if sess.opts.debuginfo == DebugInfo::None {
sess.dcx().emit_warn(errors::EmbedSourceRequiresDebugInfo);
}

if !uses_llvm_backend {
sess.dcx().emit_warn(errors::EmbedSourceRequiresLLVMBackend);
}
}

if sess.opts.unstable_opts.instrument_xray.is_some() && !sess.target.options.supports_xray {
Expand Down

0 comments on commit 6899f5a

Please sign in to comment.