Skip to content

Commit 1ebe009

Browse files
typo
1 parent 3e678e2 commit 1ebe009

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

crates/bevy_ecs/src/error/handler.rs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,13 @@ mod global_error_handler {
8282
Ordering::{AcqRel, Acquire, Relaxed},
8383
};
8484

85-
// The default global error handler, cast to a data pointer as Rust doesn't
86-
// currently have a way to express atomic function pointers.
87-
// Should we add support for a platform on which function pointers and data pointers
88-
// have different sizes, the transmutation back will fail to compile. In that case,
89-
// we can replace the atomic pointer with a regular pointer protected by a `RwLock`
90-
// on only those platforms.
91-
// SAFETY: Only accessible from within this module.
85+
/// The default global error handler, cast to a data pointer as Rust doesn't
86+
/// currently have a way to express atomic function pointers.
87+
/// Should we add support for a platform on which function pointers and data pointers
88+
/// have different sizes, the transmutation back will fail to compile. In that case,
89+
/// we can replace the atomic pointer with a regular pointer protected by a `RwLock`
90+
/// on only those platforms.
91+
/// SAFETY: Only accessible from within this module.
9292
static HANDLER: AtomicPtr<()> = AtomicPtr::new(panic as *mut ());
9393

9494
/// Set the global error handler.
@@ -107,7 +107,7 @@ mod global_error_handler {
107107
/// To use this error handler in your app for custom error handling logic:
108108
///
109109
/// ```rust
110-
/// use bevy_ecs::error::{default_error_handler, BevyError, ErrorContext, panic};
110+
/// use bevy_ecs::error::{default_error_handler, BevyError, ErrorContext};
111111
///
112112
/// fn handle_errors(error: BevyError, ctx: ErrorContext) {
113113
/// let error_handler = default_error_handler();
@@ -123,7 +123,7 @@ mod global_error_handler {
123123
/// [`default_error_handler`]: super::default_error_handler
124124
pub fn set_global_default_error_handler(handler: fn(BevyError, ErrorContext)) {
125125
// Prevent the handler from being set multiple times.
126-
// We use a seperate atomic instead of trying `compare_exchange` on `HANDLER_ADDRESS`
126+
// We use a separate atomic instead of trying `compare_exchange` on `HANDLER_ADDRESS`
127127
// because Rust doesn't guarantee that function addresses are unique.
128128
static INITIALIZED: AtomicBool = AtomicBool::new(false);
129129
if INITIALIZED
@@ -137,6 +137,8 @@ mod global_error_handler {
137137

138138
/// The default error handler. This defaults to [`panic`],
139139
/// but you can override this behavior via [`set_global_default_error_handler`].
140+
///
141+
/// [`panic`]: super::panic
140142
#[inline]
141143
pub fn default_error_handler() -> fn(BevyError, ErrorContext) {
142144
// The error handler must have been already set from the perspective of this thread,

0 commit comments

Comments
 (0)