Merge pull request #256 from phil-opp/p1

Fix panic_fmt arguments: file is a &'static str
This commit is contained in:
Philipp Oppermann
2016-11-26 12:27:42 +01:00
committed by GitHub
2 changed files with 4 additions and 2 deletions

View File

@@ -112,7 +112,9 @@ Now we get a `PANIC` message. But we can do even better. The `panic_fmt` functio
```rust
#[lang = "panic_fmt"]
extern fn panic_fmt(fmt: core::fmt::Arguments, file: &str, line: u32) -> ! {
extern fn panic_fmt(fmt: core::fmt::Arguments, file: &'static str,
line: u32) -> !
{
println!("\n\nPANIC in {} at line {}:", file, line);
println!(" {}", fmt);
loop{}

View File

@@ -86,7 +86,7 @@ extern "C" fn eh_personality() {}
#[cfg(not(test))]
#[lang = "panic_fmt"]
extern "C" fn panic_fmt(fmt: core::fmt::Arguments, file: &str, line: u32) -> ! {
extern "C" fn panic_fmt(fmt: core::fmt::Arguments, file: &'static str, line: u32) -> ! {
println!("\n\nPANIC in {} at line {}:", file, line);
println!(" {}", fmt);
loop {}