Skip to content

Commit 1dfcabf

Browse files
dingxiangfei2009gitbot
authored and
gitbot
committed
rename the trait to validity and place a feature gate afront
1 parent cafca3b commit 1dfcabf

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

core/src/marker.rs

+13-4
Original file line numberDiff line numberDiff line change
@@ -1284,14 +1284,23 @@ pub trait FnPtr: Copy + Clone {
12841284
/// }
12851285
/// ```
12861286
#[rustc_builtin_macro(CoercePointee, attributes(pointee))]
1287-
#[allow_internal_unstable(dispatch_from_dyn, coerce_unsized, unsize)]
1287+
#[allow_internal_unstable(dispatch_from_dyn, coerce_unsized, unsize, coerce_pointee_validated)]
12881288
#[unstable(feature = "derive_coerce_pointee", issue = "123430")]
12891289
pub macro CoercePointee($item:item) {
12901290
/* compiler built-in */
12911291
}
12921292

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

0 commit comments

Comments
 (0)