Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error compiling when re-referencing ptr::Unique to ptr::NonNull #118

Open
SnailShea opened this issue Jan 25, 2018 · 1 comment
Open

Error compiling when re-referencing ptr::Unique to ptr::NonNull #118

SnailShea opened this issue Jan 25, 2018 · 1 comment

Comments

@SnailShea
Copy link
Contributor

SnailShea commented Jan 25, 2018

┌─╼[~/Projects/sos-kernel] [master*]
└────╼ make kernel
   Compiling vga v0.1.0 (file:///Users/shea/Projects/sos-kernel/vga)
error[E0277]: the trait bound `core::ptr::NonNull<[[Char; 80]; 25]>: core::marker::Send` is not satisfied in `Terminal`
  --> vga/src/lib.rs:91:1
   |
91 | / pub static CONSOLE: Mutex<Terminal>
92 | |     = Mutex::new(unsafe { Terminal::new(
93 | |          Palette::new(Color::LightGrey, Color::Black )
94 | |        , 0xB8000
95 | |     )});
   | |________^ `core::ptr::NonNull<[[Char; 80]; 25]>` cannot be sent between threads safely
   |
   = help: within `Terminal`, the trait `core::marker::Send` is not implemented for `core::ptr::NonNull<[[Char; 80]; 25]>`
   = note: required because it appears within the type `Terminal`
   = note: required because of the requirements on the impl of `core::marker::Sync` for `spin::Mutex<Terminal>`
   = note: shared static variables must have a type that implements `Sync`

error: aborting due to previous error

error: Could not compile `vga`.

To learn more, run the command again with --verbose.
make: *** [target/x86_64-sos-kernel-gnu/debug/sos_kernel] Error 101
@hawkw
Copy link
Member

hawkw commented Jan 25, 2018

yeah, this is because Unique makes Send + Sync guarantees that NotNull doesn't, I forgot about this when I opened the issue to rename them. I need to add markers there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants