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

Add dbg! macro from std #483

Merged
merged 1 commit into from
Oct 5, 2021
Merged

Commits on Aug 18, 2021

  1. Add dbg! macro from Rust standard library

    The Rust standard library has a really handy macro, `dbg!`. It prints
    the source location (filename and line) along with the raw source code
    that is is invoked with and the `Debug` representation of the given
    expression. This patch ports the macro over to the kernel crate.
    
    For use in the kernel, we don't print with `eprintln!` (stderr),
    but `pr_info!`.
    
    Since the source code for the macro is taken from the standard library
    source (with only minor adjustments), the designated file
    (`std_vendor.rs`) is licensed under "Apache 2.0 OR MIT", just like its
    origin. This is the same approach as with the vendored `alloc` crate.
    
    Signed-off-by: Niklas Mohrin <dev@niklasmohrin.de>
    niklasmohrin committed Aug 18, 2021
    Configuration menu
    Copy the full SHA
    1611373 View commit details
    Browse the repository at this point in the history