rust-osdev / linked-list-allocator

Apache License 2.0
219 stars 53 forks source link

Fix use of unstable library feature #9

Closed cmontella closed 6 years ago

cmontella commented 6 years ago

Tried compiling with rust nightly (1/21/18) and got the following error:

error[E0658]: use of unstable library feature 'ptr_internals': use NonNull instead and consider PhantomData<T> (if you also use #[may_dangle]), Send, and/or Sync (see issue #0)
 --> ~/.cargo/registry/src/github.com-1ecc6299db9ec823/linked_list_allocator-0.4.3/src/hole.rs:1:5
  |
1 | use core::ptr::Unique;
  |     ^^^^^^^^^^^^^^^^^
  |
  = help: add #![feature(ptr_internals)] to the crate attributes to enable

The proposed fix should turn off this warning, but goes against the advice presented in the error to use NonNull and PhantomData.

phil-opp commented 6 years ago

Thanks! I decided to merge it to get the library compiling again. I try to replace the uses of ptr::Unique soon.

phil-opp commented 6 years ago

I replaced all uses of Unique with mutable references in https://github.com/phil-opp/linked-list-allocator/commit/a4bf336ac2d612765865734bd0fd8473f0e6270e. Published as 0.5.0.

cmontella commented 6 years ago

Awesome, thanks for the fix!