diff options
| author | bors <bors@rust-lang.org> | 2023-01-13 21:25:50 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-01-13 21:25:50 +0000 |
| commit | a11eb4f267ddfe4f00cb40bf94aef508c11e0862 (patch) | |
| tree | 0cd26953eeeccf097f1448f09912abe8c6cbeab2 /compiler/rustc_interface/src | |
| parent | 0b90256ada21c6a81b4c18f2c7a23151ab5fc232 (diff) | |
| parent | f7093826a4f3bdd69cdec0171baf78a99bc94675 (diff) | |
| download | rust-a11eb4f267ddfe4f00cb40bf94aef508c11e0862.tar.gz rust-a11eb4f267ddfe4f00cb40bf94aef508c11e0862.zip | |
Auto merge of #106822 - matthiaskrgr:rollup-46bi4pi, r=matthiaskrgr
Rollup of 10 pull requests Successful merges: - #104645 (Add log-backtrace option to show backtraces along with logging) - #106465 (Bump `IMPLIED_BOUNDS_ENTAILMENT` to Deny + ReportNow) - #106489 (Fix linker detection for linker (drivers) with a version postfix (e.g. clang-12 instead of clang)) - #106585 (When suggesting writing a fully qualified path probe for appropriate types) - #106641 (Provide help on closures capturing self causing borrow checker errors) - #106678 (Warn when using panic-strategy abort for proc-macro crates) - #106701 (Fix `mpsc::SyncSender` spinning behavior) - #106793 (Normalize test output more thoroughly) - #106797 (riscv: Fix ELF header flags) - #106813 (Remove redundant session field) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_interface/src')
| -rw-r--r-- | compiler/rustc_interface/src/errors.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_interface/src/passes.rs | 8 | ||||
| -rw-r--r-- | compiler/rustc_interface/src/tests.rs | 1 |
3 files changed, 12 insertions, 1 deletions
diff --git a/compiler/rustc_interface/src/errors.rs b/compiler/rustc_interface/src/errors.rs index f5135c78dc8..15d7e977bbe 100644 --- a/compiler/rustc_interface/src/errors.rs +++ b/compiler/rustc_interface/src/errors.rs @@ -87,3 +87,7 @@ pub struct FailedWritingFile<'a> { pub path: &'a Path, pub error: io::Error, } + +#[derive(Diagnostic)] +#[diag(interface_proc_macro_crate_panic_abort)] +pub struct ProcMacroCratePanicAbort; diff --git a/compiler/rustc_interface/src/passes.rs b/compiler/rustc_interface/src/passes.rs index 2a6852d44eb..50c40206d80 100644 --- a/compiler/rustc_interface/src/passes.rs +++ b/compiler/rustc_interface/src/passes.rs @@ -1,7 +1,8 @@ use crate::errors::{ CantEmitMIR, EmojiIdentifier, ErrorWritingDependencies, FerrisIdentifier, GeneratedFileConflictsWithDirectory, InputFileWouldBeOverWritten, MixedBinCrate, - MixedProcMacroCrate, OutDirError, ProcMacroDocWithoutArg, TempsDirError, + MixedProcMacroCrate, OutDirError, ProcMacroCratePanicAbort, ProcMacroDocWithoutArg, + TempsDirError, }; use crate::interface::{Compiler, Result}; use crate::proc_macro_decls; @@ -36,6 +37,7 @@ use rustc_session::search_paths::PathKind; use rustc_session::{Limit, Session}; use rustc_span::symbol::{sym, Symbol}; use rustc_span::FileName; +use rustc_target::spec::PanicStrategy; use rustc_trait_selection::traits; use std::any::Any; @@ -380,6 +382,10 @@ pub fn configure_and_expand( } } + if is_proc_macro_crate && sess.panic_strategy() == PanicStrategy::Abort { + sess.emit_warning(ProcMacroCratePanicAbort); + } + // For backwards compatibility, we don't try to run proc macro injection // if rustdoc is run on a proc macro crate without '--crate-type proc-macro' being // specified. This should only affect users who manually invoke 'rustdoc', as diff --git a/compiler/rustc_interface/src/tests.rs b/compiler/rustc_interface/src/tests.rs index a3b9891ee64..07b28cc86ce 100644 --- a/compiler/rustc_interface/src/tests.rs +++ b/compiler/rustc_interface/src/tests.rs @@ -748,6 +748,7 @@ fn test_unstable_options_tracking_hash() { tracked!(link_only, true); tracked!(llvm_plugins, vec![String::from("plugin_name")]); tracked!(location_detail, LocationDetail { file: true, line: false, column: false }); + tracked!(log_backtrace, Some("filter".to_string())); tracked!(maximal_hir_to_mir_coverage, true); tracked!(merge_functions, Some(MergeFunctions::Disabled)); tracked!(mir_emit_retag, true); |
