Closed
Description
#![crate_type="rlib"]
pub fn banana() -> String {
String::from("")
}
pub fn peach() -> String {
"".to_owned()
}
pub fn expected() -> String {
unsafe {
String::from_utf8_unchecked("".as_bytes().to_owned())
}
}
Playground (Use show assembly or llvm-ir, make sure to turn on optimisations)
All these functions should be equivalent.
Metadata
Metadata
Assignees
Labels
Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Issue: Problems and improvements with respect to performance of generated code.Relevant to the library API team, which will review and decide on the PR/issue.