1
Fork 0

rename the trait to validity and place a feature gate afront

This commit is contained in:
Ding Xiang Fei 2025-01-29 06:15:56 +08:00
parent de405dcb8f
commit c067324637
No known key found for this signature in database
GPG key ID: 3CD748647EEF6359
10 changed files with 43 additions and 26 deletions

View file

@ -110,10 +110,10 @@ pub(crate) fn expand_deriving_coerce_pointee(
// Declare helper function that adds implementation blocks.
// FIXME(dingxiangfei2009): Investigate the set of attributes on target struct to be propagated to impls
let attrs = thin_vec![cx.attr_word(sym::automatically_derived, span),];
// # Wellformed-ness assertion
// # Validity assertion which will be checked later in `rustc_hir_analysis::coherence::builtins`.
{
let trait_path =
cx.path_all(span, true, path!(span, core::marker::CoercePointeeWellformed), vec![]);
cx.path_all(span, true, path!(span, core::marker::CoercePointeeValidated), vec![]);
let trait_ref = cx.trait_ref(trait_path);
push(Annotatable::Item(
cx.item(