jonhoo / haphazard

Hazard pointers in Rust.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Clarification of invalid operations in tests/lib.rs

emilHof opened this issue · comments

I was reading through the tests to better understand how tho use the crate, when i came across this line that confused me:

58    drop(hazptr_array);
59    // invalid:
60    // let _: i32 = my_y.0;
61    // invalid:
62    // let _: i32 = my_y.0;

It confused me a bit and I was wondering if this meant to say let: _: i32 = my_x.0 for one of the comments? I hope this is not a super annoying question haha!

Pro-tip: if you mark the lines in the GitHub code view, press y, and then paste that link, you get a code snippet that links back to the code:

haphazard/tests/lib.rs

Lines 58 to 62 in 6bcebbd

drop(hazptr_array);
// invalid:
// let _: i32 = my_y.0;
// invalid:
// let _: i32 = my_y.0;

But yes, you're entirely right, one of those should read my_x.0! Want to cut a PR?

Pro-tip: if you mark the lines in the GitHub code view, press y, and then paste that link, you get a code snippet that links back to the code:
Wow, that is awesome! I did not know this existed, thank you haha!

Yess, I definitely can! In the end it was a kind of nit-picky and probably quite unimportant thing to point out haha!

In a library this low level where the details matter so much, I think it's very much worth fixing!

Haha, I definitely appreciate your support of my very minuscule contribution ! :)