mmastrac / rust-libc-print

#[no_std] print equivalent for Rust
Apache License 2.0
59 stars 9 forks source link

feat #17: add dbg macro #70

Closed SteveLauC closed 2 years ago

SteveLauC commented 2 years ago

changes:

  1. add dbg! macro. Closes #17
  2. update libc version from 0.2.120 to 0.2.126 so that we can directly close #69 instead of merging it.

Something I am not sure:

Before I made this PR, if I build this crate, the compiler gives the following error:

warning: attribute should be applied to an `extern` block
  --> src/lib.rs:24:1
   |
24 |   #[link(name = "c")]
   |   ^^^^^^^^^^^^^^^^^^^
25 | / mod c {
26 | |     extern "C" {}
27 | | }
   | |_- not an `extern` block
   |
   = note: `#[warn(unused_attributes)]` on by default
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!

And my PR relies on core::{file, line, stringify}, to silence the unused warning of these macros, I added #![allow(unused)]

warning: unused imports: `file`, `line`, `stringify`
  --> src/lib.rs:20:12
   |
20 | use core::{file, line, stringify};
   |            ^^^^  ^^^^  ^^^^^^^^^
   |
   = note: `#[warn(unused_imports)]` on by default

And after I added this attribute, the first warning is also killed. I am not sure if this is fine:(

mmastrac commented 2 years ago

Merged.. I'll push a new release shortly. Thanks!

mmastrac commented 2 years ago

Published as 0.1.20 (with some minor tweaks!). Thanks again