Skip to content

Commit

Permalink
Clarify # Safety section on Tagged
Browse files Browse the repository at this point in the history
  • Loading branch information
TimDiekmann committed Jan 3, 2022
1 parent 53d79e3 commit 637ccee
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/engine/lib/provider/src/internal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ use super::{TypeId, TypeTag};
///
/// # Safety
///
/// This trait must be exclusively implemented by the [`TagValue`] type.
/// This trait must be exclusively implemented by the [`TagValue`] type as [`Tagged::is`] relies on
/// `tag_id` and the [`TypeId`] must not be overwritten.
///
/// [`Tagged::is`]: #method.is
pub(super) unsafe trait Tagged<'p>: 'p {
/// The [`TypeId`] of the [`TypeTag`] this value was tagged with.
fn tag_id(&self) -> TypeId;
Expand Down

0 comments on commit 637ccee

Please sign in to comment.