forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#131284 - dingxiangfei2009:rename-smart-ptr-…
…to-coerce-referent, r=compiler-errors Rename macro `SmartPointer` to `CoercePointee` As per resolution rust-lang#129104 we will rename the macro to better reflect the technical specification of the feature and clarify the communication. - `SmartPointer` is renamed to `CoerceReferent` - `#[pointee]` attribute is renamed to `#[referent]` - `#![feature(derive_smart_pointer)]` gate is renamed to `#![feature(derive_coerce_referent)]`. - Any mention of `SmartPointer` in the file names are renamed accordingly. r? `@compiler-errors` cc `@nikomatsakis` `@Darksonn`
- Loading branch information
Showing
24 changed files
with
252 additions
and
234 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
//@ check-pass | ||
|
||
#![feature(derive_smart_pointer)] | ||
#![feature(derive_coerce_pointee)] | ||
|
||
#[derive(core::marker::SmartPointer)] | ||
#[derive(core::marker::CoercePointee)] | ||
#[repr(transparent)] | ||
pub struct Ptr<'a, #[pointee] T: OnDrop + ?Sized, X> { | ||
data: &'a mut T, | ||
|
@@ -13,7 +13,7 @@ pub trait OnDrop { | |
fn on_drop(&mut self); | ||
} | ||
|
||
#[derive(core::marker::SmartPointer)] | ||
#[derive(core::marker::CoercePointee)] | ||
#[repr(transparent)] | ||
pub struct Ptr2<'a, #[pointee] T: ?Sized, X> | ||
where | ||
|
@@ -25,7 +25,7 @@ where | |
|
||
pub trait MyTrait<T: ?Sized> {} | ||
|
||
#[derive(core::marker::SmartPointer)] | ||
#[derive(core::marker::CoercePointee)] | ||
#[repr(transparent)] | ||
pub struct Ptr3<'a, #[pointee] T: ?Sized, X> | ||
where | ||
|
@@ -35,14 +35,14 @@ where | |
x: core::marker::PhantomData<X>, | ||
} | ||
|
||
#[derive(core::marker::SmartPointer)] | ||
#[derive(core::marker::CoercePointee)] | ||
#[repr(transparent)] | ||
pub struct Ptr4<'a, #[pointee] T: MyTrait<T> + ?Sized, X> { | ||
data: &'a mut T, | ||
x: core::marker::PhantomData<X>, | ||
} | ||
|
||
#[derive(core::marker::SmartPointer)] | ||
#[derive(core::marker::CoercePointee)] | ||
#[repr(transparent)] | ||
pub struct Ptr5<'a, #[pointee] T: ?Sized, X> | ||
where | ||
|
@@ -56,7 +56,7 @@ where | |
pub struct Ptr5Companion<T: ?Sized>(core::marker::PhantomData<T>); | ||
pub struct Ptr5Companion2; | ||
|
||
#[derive(core::marker::SmartPointer)] | ||
#[derive(core::marker::CoercePointee)] | ||
#[repr(transparent)] | ||
pub struct Ptr6<'a, #[pointee] T: ?Sized, X: MyTrait<T> = (), const PARAM: usize = 0> { | ||
data: &'a mut T, | ||
|
@@ -65,7 +65,7 @@ pub struct Ptr6<'a, #[pointee] T: ?Sized, X: MyTrait<T> = (), const PARAM: usize | |
|
||
// a reduced example from https://lore.kernel.org/all/[email protected]/ | ||
#[repr(transparent)] | ||
#[derive(core::marker::SmartPointer)] | ||
#[derive(core::marker::CoercePointee)] | ||
pub struct ListArc<#[pointee] T, const ID: u64 = 0> | ||
where | ||
T: ListArcSafe<ID> + ?Sized, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.