Skip to content

Commit

Permalink
Use format string in bootstrap panic instead of a string directly
Browse files Browse the repository at this point in the history
This fixes the following warning when compiling with nightly:

```
warning: panic message is not a string literal
    --> src/bootstrap/builder.rs:1515:24
     |
1515 |                 panic!(out);
     |                        ^^^
     |
     = note: `#[warn(non_fmt_panic)]` on by default
     = note: this is no longer accepted in Rust 2021
help: add a "{}" format string to Display the message
     |
1515 |                 panic!("{}", out);
     |                        ^^^^^
help: or use std::panic::panic_any instead
     |
1515 |                 std::panic::panic_any(out);
     |                 ^^^^^^^^^^^^^^^^^^^^^^
```
  • Loading branch information
jyn514 committed Feb 9, 2021
1 parent 9a1d617 commit 31c9339
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/bootstrap/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1490,7 +1490,7 @@ impl<'a> Builder<'a> {
for el in stack.iter().rev() {
out += &format!("\t{:?}\n", el);
}
panic!(out);
panic!("{}", out);
}
if let Some(out) = self.cache.get(&step) {
self.verbose(&format!("{}c {:?}", " ".repeat(stack.len()), step));
Expand Down

0 comments on commit 31c9339

Please sign in to comment.