mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-08-05 21:37:15 +02:00
30 lines
933 B
Diff
30 lines
933 B
Diff
Patch-Source: https://github.com/afnanenayet/diffsitter/pull/612 (backported)
|
|
--
|
|
From a9a05bbad821e96e29fb5e9316f8e6bf7d9d01b1 Mon Sep 17 00:00:00 2001
|
|
From: Jakub Jirutka <jakub@jirutka.cz>
|
|
Date: Sat, 29 Apr 2023 23:36:29 +0200
|
|
Subject: [PATCH] feat: Use human_panic only when building with panic =
|
|
"unwind"
|
|
|
|
If diffsitter is built with `panic = "abort"`, it doesn't make much
|
|
sense to include human_panic.
|
|
|
|
--- a/src/main.rs
|
|
+++ b/src/main.rs
|
|
@@ -16,6 +16,7 @@
|
|
use cli::Args;
|
|
use config::{Config, ReadError};
|
|
use formatting::{DisplayParameters, DocumentDiffData};
|
|
+#[cfg(panic = "unwind")]
|
|
use human_panic::setup_panic;
|
|
use input_processing::VectorData;
|
|
use log::{debug, error, info, warn, LevelFilter};
|
|
@@ -226,6 +227,7 @@
|
|
|
|
fn main() -> Result<()> {
|
|
// Set up a panic handler that will yield more human-readable errors.
|
|
+ #[cfg(panic = "unwind")]
|
|
setup_panic!();
|
|
|
|
#[cfg(feature = "better-build-info")]
|