Fail Non-Panicking Code with 'extern functions couldn't be found'
netzdoktor opened this issue · 1 comments
netzdoktor commented
Similar to #50, I get errors even when compiling non-panicking code. For example, this:
#[no_panic]
fn taut(s: &str) -> &str {
"foo"
}
fn main() {
println!("Hello, {}!", taut("world"));
}
This fails with 'extern functions couldn't be found'. Are there any third-party requirements before one can use no_panic
?
dtolnay commented
You would need to use opt-level = 1 or greater for that code. Setting this up is covered in https://github.com/dtolnay/no-panic/tree/0.1.26#caveats.