Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

- [`sentry_core::ClientOptions`](https://docs.rs/sentry-core/latest/sentry_core/struct.ClientOptions.html) fields [`before_send_log`](https://docs.rs/sentry-core/latest/sentry_core/struct.ClientOptions.html#structfield.before_send_log), [`enable_logs`](https://docs.rs/sentry-core/latest/sentry_core/struct.ClientOptions.html#structfield.enable_logs), [`auto_session_tracking`](https://docs.rs/sentry-core/latest/sentry_core/struct.ClientOptions.html#structfield.auto_session_tracking), and [`session_mode`](https://docs.rs/sentry-core/latest/sentry_core/struct.ClientOptions.html#structfield.session_mode) are no longer gated behind the `logs` and `release-health` feature flags ([#1091](https://github.com/getsentry/sentry-rust/pull/1091)). Code that constructs `ClientOptions` with a full struct literal (without `..Default::default()`), or which exhaustively matches against it, must now include all four fields regardless of enabled features.
- [`sentry_core::Scope`](https://docs.rs/sentry-core/latest/sentry_core/struct.Scope.html) can no longer be publicly constructed or exhaustively matched against, even when the `client` feature is disabled ([#1094](https://github.com/getsentry/sentry-rust/pull/1094)). Previously, both of these were possible when `client` was disabled.
- [`sentry_core::Scope::add_event_processor`](https://docs.rs/sentry-core/latest/sentry_core/struct.Scope.html#method.add_event_processor) now requires passed closures to be `RefUnwindSafe` ([#1093](https://github.com/getsentry/sentry-rust/pull/1093)). Thanks to this change, [`sentry_core::Scope`](https://docs.rs/sentry-core/latest/sentry_core/struct.Scope.html) is now [`UnwindSafe`](https://docs.rs/sentry-core/latest/sentry_core/struct.Scope.html#impl-UnwindSafe-for-Scope) regardless of feature flag configuration; previously, `Scope` was only `UnwindSafe` when the `client` feature was disabled. was disabled.
- [`sentry_tracing::EventMapping](https://docs.rs/sentry-tracing/latest/sentry_tracing/enum.EventMapping.html) is now ``#[non_exhaustive]`` ([#1097](https://github.com/getsentry/sentry-rust/pull/1097)).

## 0.47.0
Expand Down
3 changes: 2 additions & 1 deletion sentry-core/src/scope/noop.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use std::fmt;
use std::panic::RefUnwindSafe;

#[cfg(feature = "logs")]
use crate::protocol::Log;
Expand Down Expand Up @@ -101,7 +102,7 @@ impl Scope {
/// Add an event processor to the scope.
pub fn add_event_processor<F>(&mut self, f: F)
where
F: Fn(Event<'static>) -> Option<Event<'static>> + Send + Sync + 'static,
F: Fn(Event<'static>) -> Option<Event<'static>> + Send + Sync + RefUnwindSafe + 'static,
{
let _f = f;
minimal_unreachable!();
Expand Down
6 changes: 4 additions & 2 deletions sentry-core/src/scope/real.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use std::borrow::Cow;
use std::collections::{HashMap, VecDeque};
use std::fmt;
use std::panic::RefUnwindSafe;
#[cfg(feature = "release-health")]
use std::sync::Mutex;
use std::sync::{Arc, PoisonError, RwLock};
Expand All @@ -21,7 +22,8 @@ pub struct Stack {
layers: Vec<StackLayer>,
}

type EventProcessor = Arc<dyn Fn(Event<'static>) -> Option<Event<'static>> + Send + Sync>;
type EventProcessor =
Arc<dyn Fn(Event<'static>) -> Option<Event<'static>> + Send + Sync + RefUnwindSafe>;

/// Holds contextual data for the current scope.
///
Expand Down Expand Up @@ -252,7 +254,7 @@ impl Scope {
/// Add an event processor to the scope.
pub fn add_event_processor<F>(&mut self, f: F)
where
F: Fn(Event<'static>) -> Option<Event<'static>> + Send + Sync + 'static,
F: Fn(Event<'static>) -> Option<Event<'static>> + Send + Sync + RefUnwindSafe + 'static,
{
Arc::make_mut(&mut self.event_processors).push(Arc::new(f));
}
Expand Down
Loading