diff options
| author | Taylor Cramer <cramertj@google.com> | 2019-04-05 11:49:46 -0700 |
|---|---|---|
| committer | Taylor Cramer <cramertj@google.com> | 2019-04-08 14:22:31 -0700 |
| commit | 6786fa7795880a899d85058831a1fd719edb43e1 (patch) | |
| tree | 37b780b6a8fcdc47e84b20d66470f1d2ef3c5305 /src/libcore/task | |
| parent | 01be78d69ff69daa5f1ad20888446779656e191c (diff) | |
| download | rust-6786fa7795880a899d85058831a1fd719edb43e1.tar.gz rust-6786fa7795880a899d85058831a1fd719edb43e1.zip | |
Rename Waker::new_unchecked to Waker::from_raw
Diffstat (limited to 'src/libcore/task')
| -rw-r--r-- | src/libcore/task/wake.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libcore/task/wake.rs b/src/libcore/task/wake.rs index 085695b9022..006cbbb6ce6 100644 --- a/src/libcore/task/wake.rs +++ b/src/libcore/task/wake.rs @@ -215,7 +215,7 @@ impl Waker { // Don't call `drop` -- the waker will be consumed by `wake`. crate::mem::forget(self); - // SAFETY: This is safe because `Waker::new_unchecked` is the only way + // SAFETY: This is safe because `Waker::from_raw` is the only way // to initialize `wake` and `data` requiring the user to acknowledge // that the contract of `RawWaker` is upheld. unsafe { (wake)(data) }; @@ -253,7 +253,7 @@ impl Waker { /// in [`RawWaker`]'s and [`RawWakerVTable`]'s documentation is not upheld. /// Therefore this method is unsafe. #[inline] - pub unsafe fn new_unchecked(waker: RawWaker) -> Waker { + pub unsafe fn from_raw(waker: RawWaker) -> Waker { Waker { waker, } @@ -264,7 +264,7 @@ impl Clone for Waker { #[inline] fn clone(&self) -> Self { Waker { - // SAFETY: This is safe because `Waker::new_unchecked` is the only way + // SAFETY: This is safe because `Waker::from_raw` is the only way // to initialize `clone` and `data` requiring the user to acknowledge // that the contract of [`RawWaker`] is upheld. waker: unsafe { (self.waker.vtable.clone)(self.waker.data) }, @@ -275,7 +275,7 @@ impl Clone for Waker { impl Drop for Waker { #[inline] fn drop(&mut self) { - // SAFETY: This is safe because `Waker::new_unchecked` is the only way + // SAFETY: This is safe because `Waker::from_raw` is the only way // to initialize `drop` and `data` requiring the user to acknowledge // that the contract of `RawWaker` is upheld. unsafe { (self.waker.vtable.drop)(self.waker.data) } |
