Open
Description
https://godbolt.org/z/Wx1rvE6vq
use std::borrow::Cow;
pub struct Error {
message: Cow<'static, str>,
cause: Option<Box<[u8]>>,
}
#[no_mangle]
pub fn declear_before(v: u64) -> Error {
let s = format!("{v}");
let mut e = Error {
message: Cow::Borrowed(""),
cause: None,
};
e.message = s.into();
e
}
Declear s
before Error
produces better codegen than declear after.
Metadata
Metadata
Assignees
Labels
Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generationArea: Panicking machineryCategory: An issue highlighting optimization opportunities or PRs implementing suchIssue: Problems and improvements with respect to binary size of generated code.Relevant to the compiler team, which will review and decide on the PR/issue.