Add tracking issue to async_drop API · model-checking/verify-rust-std@2238945 (original) (raw)

1

``

`-

#![unstable(feature = "async_drop", issue = "none")]

`

``

1

`+

#![unstable(feature = "async_drop", issue = "126482")]

`

2

2

``

3

3

`use crate::fmt;

`

4

4

`use crate::future::{Future, IntoFuture};

`

`@@ -10,27 +10,27 @@ use crate::task::{ready, Context, Poll};

`

10

10

``

11

11

`` /// Asynchronously drops a value by running AsyncDrop::async_drop

``

12

12

`/// on a value and its fields recursively.

`

13

``

`-

#[unstable(feature = "async_drop", issue = "none")]

`

``

13

`+

#[unstable(feature = "async_drop", issue = "126482")]

`

14

14

`pub fn async_drop(value: T) -> AsyncDropOwning {

`

15

15

`AsyncDropOwning { value: MaybeUninit::new(value), dtor: None, _pinned: PhantomPinned }

`

16

16

`}

`

17

17

``

18

18

`` /// A future returned by the [async_drop].

``

19

``

`-

#[unstable(feature = "async_drop", issue = "none")]

`

``

19

`+

#[unstable(feature = "async_drop", issue = "126482")]

`

20

20

`pub struct AsyncDropOwning {

`

21

21

`value: MaybeUninit,

`

22

22

`dtor: Option<AsyncDropInPlace>,

`

23

23

`_pinned: PhantomPinned,

`

24

24

`}

`

25

25

``

26

``

`-

#[unstable(feature = "async_drop", issue = "none")]

`

``

26

`+

#[unstable(feature = "async_drop", issue = "126482")]

`

27

27

`impl fmt::Debug for AsyncDropOwning {

`

28

28

`fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {

`

29

29

` f.debug_struct("AsyncDropOwning").finish_non_exhaustive()

`

30

30

`}

`

31

31

`}

`

32

32

``

33

``

`-

#[unstable(feature = "async_drop", issue = "none")]

`

``

33

`+

#[unstable(feature = "async_drop", issue = "126482")]

`

34

34

`impl Future for AsyncDropOwning {

`

35

35

`type Output = ();

`

36

36

``

`@@ -86,24 +86,24 @@ unsafe fn async_drop_in_place_raw<T: ?Sized>(

`

86

86

`` /// returned future stores the to_drop pointer and user is required

``

87

87

`/// to guarantee that dropped value doesn't move.

`

88

88

`///

`

89

``

`-

#[unstable(feature = "async_drop", issue = "none")]

`

``

89

`+

#[unstable(feature = "async_drop", issue = "126482")]

`

90

90

`pub unsafe fn async_drop_in_place<T: ?Sized>(to_drop: *mut T) -> AsyncDropInPlace {

`

91

91

`` // SAFETY: async_drop_in_place_raw has the same safety requirements

``

92

92

`unsafe { AsyncDropInPlace(async_drop_in_place_raw(to_drop)) }

`

93

93

`}

`

94

94

``

95

95

`` /// A future returned by the [async_drop_in_place].

``

96

``

`-

#[unstable(feature = "async_drop", issue = "none")]

`

``

96

`+

#[unstable(feature = "async_drop", issue = "126482")]

`

97

97

`pub struct AsyncDropInPlace<T: ?Sized>(::AsyncDestructor);

`

98

98

``

99

``

`-

#[unstable(feature = "async_drop", issue = "none")]

`

``

99

`+

#[unstable(feature = "async_drop", issue = "126482")]

`

100

100

`impl<T: ?Sized> fmt::Debug for AsyncDropInPlace {

`

101

101

`fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {

`

102

102

` f.debug_struct("AsyncDropInPlace").finish_non_exhaustive()

`

103

103

`}

`

104

104

`}

`

105

105

``

106

``

`-

#[unstable(feature = "async_drop", issue = "none")]

`

``

106

`+

#[unstable(feature = "async_drop", issue = "126482")]

`

107

107

`impl<T: ?Sized> Future for AsyncDropInPlace {

`

108

108

`type Output = ();

`

109

109

``

`@@ -117,18 +117,18 @@ impl<T: ?Sized> Future for AsyncDropInPlace {

`

117

117

`// FIXME(zetanumbers): Add same restrictions on AsyncDrop impls as

`

118

118

`// with Drop impls

`

119

119

`/// Custom code within the asynchronous destructor.

`

120

``

`-

#[unstable(feature = "async_drop", issue = "none")]

`

``

120

`+

#[unstable(feature = "async_drop", issue = "126482")]

`

121

121

`#[lang = "async_drop"]

`

122

122

`pub trait AsyncDrop {

`

123

123

`` /// A future returned by the [AsyncDrop::async_drop] to be part

``

124

124

`/// of the async destructor.

`

125

``

`-

#[unstable(feature = "async_drop", issue = "none")]

`

``

125

`+

#[unstable(feature = "async_drop", issue = "126482")]

`

126

126

`type Dropper<'a>: Future<Output = ()>

`

127

127

`where

`

128

128

`Self: 'a;

`

129

129

``

130

130

`/// Constructs the asynchronous destructor for this type.

`

131

``

`-

#[unstable(feature = "async_drop", issue = "none")]

`

``

131

`+

#[unstable(feature = "async_drop", issue = "126482")]

`

132

132

`fn async_drop(self: Pin<&mut Self>) -> Self::Dropper<'_>;

`

133

133

`}

`

134

134

``