Skip to content

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

@SnailShea

Description

@SnailShea
┌─╼[~/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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions