Skip to content

Commit

Permalink
rename the trait to validity and place a feature gate afront
Browse files Browse the repository at this point in the history
  • Loading branch information
dingxiangfei2009 authored and gitbot committed Mar 6, 2025
1 parent b04509b commit 7260481
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions core/src/marker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1284,14 +1284,23 @@ pub trait FnPtr: Copy + Clone {
/// }
/// ```
#[rustc_builtin_macro(CoercePointee, attributes(pointee))]
#[allow_internal_unstable(dispatch_from_dyn, coerce_unsized, unsize)]
#[allow_internal_unstable(dispatch_from_dyn, coerce_unsized, unsize, coerce_pointee_validated)]
#[unstable(feature = "derive_coerce_pointee", issue = "123430")]
pub macro CoercePointee($item:item) {
/* compiler built-in */
}

/// A validation trait that is implemented on data with `derive(CoercePointee)`
/// so that the compiler can enforce a set of rules that the target data must
/// conform to in order for the derived behaviours are safe and useful for
/// the purpose of the said macro.
///
/// This trait will not ever be exposed for use as public part of the library
/// and shall not ever be stabilised.
#[cfg(not(bootstrap))]
#[lang = "coerce_pointee_wellformed"]
#[unstable(feature = "derive_coerce_pointee", issue = "123430")]
#[lang = "coerce_pointee_validated"]
#[unstable(feature = "coerce_pointee_validated", issue = "123430")]
#[doc(hidden)]
pub trait CoercePointeeWellformed {}
pub trait CoercePointeeValidated {
/* compiler built-in */
}

0 comments on commit 7260481

Please sign in to comment.