2024-08-10 21:11:07 +08:00
|
|
|
#![feature(prelude_import)]
|
|
|
|
|
#![no_std]
|
|
|
|
|
//@ check-pass
|
2024-11-24 17:37:25 -08:00
|
|
|
//@ proc-macro: another-proc-macro.rs
|
2024-08-10 21:11:07 +08:00
|
|
|
//@ compile-flags: -Zunpretty=expanded
|
2025-04-16 10:45:03 +02:00
|
|
|
//@ edition:2015
|
2024-08-10 21:11:07 +08:00
|
|
|
|
2024-10-05 17:44:53 +08:00
|
|
|
#![feature(derive_coerce_pointee)]
|
2024-08-10 21:11:07 +08:00
|
|
|
#[macro_use]
|
|
|
|
|
extern crate std;
|
2025-07-28 17:24:28 +03:00
|
|
|
#[prelude_import]
|
|
|
|
|
use ::std::prelude::rust_2015::*;
|
2024-08-10 21:11:07 +08:00
|
|
|
|
|
|
|
|
#[macro_use]
|
|
|
|
|
extern crate another_proc_macro;
|
|
|
|
|
|
2024-10-05 17:44:53 +08:00
|
|
|
use another_proc_macro::{AnotherMacro, pointee};
|
2024-08-10 21:11:07 +08:00
|
|
|
|
|
|
|
|
#[repr(transparent)]
|
|
|
|
|
pub struct Ptr<'a, #[pointee] T: ?Sized> {
|
|
|
|
|
data: &'a mut T,
|
|
|
|
|
}
|
|
|
|
|
#[automatically_derived]
|
2025-01-29 06:15:56 +08:00
|
|
|
impl<'a, T: ?Sized> ::core::marker::CoercePointeeValidated for Ptr<'a, T> { }
|
2025-01-27 06:06:06 +08:00
|
|
|
#[automatically_derived]
|
2024-08-10 21:11:07 +08:00
|
|
|
impl<'a, T: ?Sized + ::core::marker::Unsize<__S>, __S: ?Sized>
|
|
|
|
|
::core::ops::DispatchFromDyn<Ptr<'a, __S>> for Ptr<'a, T> {
|
|
|
|
|
}
|
|
|
|
|
#[automatically_derived]
|
|
|
|
|
impl<'a, T: ?Sized + ::core::marker::Unsize<__S>, __S: ?Sized>
|
|
|
|
|
::core::ops::CoerceUnsized<Ptr<'a, __S>> for Ptr<'a, T> {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const _: () =
|
|
|
|
|
{
|
|
|
|
|
const POINTEE_MACRO_ATTR_DERIVED: () = ();
|
|
|
|
|
};
|
|
|
|
|
#[pointee]
|
|
|
|
|
struct MyStruct;
|
|
|
|
|
const _: () =
|
|
|
|
|
{
|
|
|
|
|
const ANOTHER_MACRO_DERIVED: () = ();
|
|
|
|
|
};
|
|
|
|
|
fn main() {}
|