@@ -215,7 +215,7 @@ impl Waker {
215
215
// Don't call `drop` -- the waker will be consumed by `wake`.
216
216
crate :: mem:: forget ( self ) ;
217
217
218
- // SAFETY: This is safe because `Waker::new_unchecked ` is the only way
218
+ // SAFETY: This is safe because `Waker::from_raw ` is the only way
219
219
// to initialize `wake` and `data` requiring the user to acknowledge
220
220
// that the contract of `RawWaker` is upheld.
221
221
unsafe { ( wake) ( data) } ;
@@ -253,7 +253,7 @@ impl Waker {
253
253
/// in [`RawWaker`]'s and [`RawWakerVTable`]'s documentation is not upheld.
254
254
/// Therefore this method is unsafe.
255
255
#[ inline]
256
- pub unsafe fn new_unchecked ( waker : RawWaker ) -> Waker {
256
+ pub unsafe fn from_raw ( waker : RawWaker ) -> Waker {
257
257
Waker {
258
258
waker,
259
259
}
@@ -264,7 +264,7 @@ impl Clone for Waker {
264
264
#[ inline]
265
265
fn clone ( & self ) -> Self {
266
266
Waker {
267
- // SAFETY: This is safe because `Waker::new_unchecked ` is the only way
267
+ // SAFETY: This is safe because `Waker::from_raw ` is the only way
268
268
// to initialize `clone` and `data` requiring the user to acknowledge
269
269
// that the contract of [`RawWaker`] is upheld.
270
270
waker : unsafe { ( self . waker . vtable . clone ) ( self . waker . data ) } ,
@@ -275,7 +275,7 @@ impl Clone for Waker {
275
275
impl Drop for Waker {
276
276
#[ inline]
277
277
fn drop ( & mut self ) {
278
- // SAFETY: This is safe because `Waker::new_unchecked ` is the only way
278
+ // SAFETY: This is safe because `Waker::from_raw ` is the only way
279
279
// to initialize `drop` and `data` requiring the user to acknowledge
280
280
// that the contract of `RawWaker` is upheld.
281
281
unsafe { ( self . waker . vtable . drop ) ( self . waker . data ) }
0 commit comments