Skip to content

panic message is not a string literal #137

Closed
@sebastianv89

Description

@sebastianv89

Running the OS tutorial (https://os.phil-opp.com/), I get a warning every time I run the OS. I traced back the issue to this line:

format!("KERNEL does not exist: {}", kernel.display())

This is the warning:

warning: panic message is not a string literal
   --> build.rs:128:9
    |
128 |         format!("KERNEL does not exist: {}", kernel.display())
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: `#[warn(non_fmt_panic)]` on by default
    = note: this is no longer accepted in Rust 2021
    = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

I run the following versions:

$ cargo --version
cargo 1.52.0-nightly (bf5a5d5e5 2021-02-18)
$ rustc --version
rustc 1.52.0-nightly (9b471a3f5 2021-02-19)
$ bootimage --version
bootimage 0.10.2

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