fork download
  1. lazy_static! {
  2. pub static ref DISP: Displ = Displ::new();
  3. }
  4.  
  5. pub struct Displ(pub *mut Display);
  6.  
  7. unsafe impl Sync for Displ {}
  8.  
  9. impl Displ {
  10. pub fn new() -> Self {
  11. match xopen_display() {
  12. Ok(rv) => Displ(rv),
  13. Err(e) => panic!("{}", e),
  14. }
  15. }
  16. }
  17.  
  18. impl Drop for Displ {
  19. fn drop(&mut self) {
  20. xclose_display(self.0);
  21. }
  22. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
error: cannot find macro `lazy_static!` in this scope
 --> prog.rs:1:1
  |
1 | lazy_static! {
  | ^^^^^^^^^^^

error[E0412]: cannot find type `Display` in this scope
 --> prog.rs:5:27
  |
5 | pub struct Displ(pub *mut Display);
  |                           ^^^^^^^
help: a struct with a similar name exists
  |
5 | pub struct Displ(pub *mut Displ);
  |                           ^^^^^
help: possible candidates are found in other modules, you can import them into scope
  |
5 | use std::fmt::Display;
  |
5 | use std::path::Display;
  |

error[E0425]: cannot find function `xopen_display` in this scope
  --> prog.rs:11:15
   |
11 |         match xopen_display() {
   |               ^^^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `xclose_display` in this scope
  --> prog.rs:20:9
   |
20 |         xclose_display(self.0);
   |         ^^^^^^^^^^^^^^ not found in this scope

error[E0601]: `main` function not found in crate `prog`
  |
  = note: consider adding a `main` function to `prog.rs`

error: aborting due to 5 previous errors

Some errors occurred: E0412, E0425, E0601.
For more information about an error, try `rustc --explain E0412`.
stdout
Standard output is empty