-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Empty struct lifetime bug #11681
Copy link
Copy link
Labels
A-destructorsArea: Destructors (`Drop`, …)Area: Destructors (`Drop`, …)A-lifetimesArea: Lifetimes / regionsArea: Lifetimes / regionsE-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
Milestone
Metadata
Metadata
Assignees
Labels
A-destructorsArea: Destructors (`Drop`, …)Area: Destructors (`Drop`, …)A-lifetimesArea: Lifetimes / regionsArea: Lifetimes / regionsE-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
Type
Fields
Give feedbackNo fields configured for issues without a type.
I asked stackoverflow about lifetime of variable. Original link is this : http://stackoverflow.com/questions/21226942/rust-lifetime-and-calling-member-function
** Question from link **
I have a question about lifetime of varable in Rust programming language.
createTestfunction creates and returns r-value reference. and when it returns a reference,testValueis destroyed. But test.print() doesn't lead to crash. Why?(Is Test::print function called as static function?)
Code
Result
It happened with empty struct only. Is it a really bug?