This commit is contained in:
Carl Fredrik Samson
2020-04-13 14:21:00 +02:00
3 changed files with 3 additions and 3 deletions

View File

@@ -139,7 +139,7 @@ fn main() {
// length of the array is encoded in the array itself as the second value.
let vtable = vec![
0, // pointer to `Drop` (which we're not implementing here)
6, // lenght of vtable
6, // length of vtable
8, // alignment
// we need to make sure we add these in the same order as defined in the Trait.

View File

@@ -326,7 +326,7 @@ Let's see what happens if we run our example now:
pub fn main() {
// test1 is safe to move before we initialize it
let mut test1 = Test::new("test1");
// Notice how we shadow `test1` to prevent it from beeing accessed again
// Notice how we shadow `test1` to prevent it from being accessed again
let mut test1 = unsafe { Pin::new_unchecked(&mut test1) };
Test::init(test1.as_mut());

View File

@@ -173,7 +173,7 @@ const VTABLE: RawWakerVTable = unsafe {
)
};
// Instead of implementing this on the `MyWaker` oject in `impl Mywaker...` we
// Instead of implementing this on the `MyWaker` object in `impl Mywaker...` we
// just use this pattern instead since it saves us some lines of code.
fn waker_into_waker(s: *const MyWaker) -> Waker {
let raw_waker = RawWaker::new(s as *const (), &VTABLE);