-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Empty struct lifetime bug #11681
Comments
Oh, my apologies, I missed the |
Nominating, this sounds bad. |
Accepted for 1.0, P-backcompat-lang. Also, cc @nikomatsakis |
I'm digging into this. @nikomatsakis if you've any pointers that would help debugging the issue, please let me know 😄 |
I dug a bit into this. If what I looked into is correct, This is the borrowck log for the
|
@flaper87 you are correct, and it's just wrong all the time. We should treat unary structs and nullary enum variants as rvalues, not static items. |
reopening to ensure a test gets added. |
@huonw it is fixed. The issue had nothing to do w/ the |
…_is_some, r=llogiq Improve help message for `search_is_some` lint Fixes rust-lang#11681. Like mentioned in the issue, we tend to use the formulation "consider using", which we didn't in this case. I think it clears both the confusion and also makes help message more coherent overall. r? `@llogiq` changelog: Improve help message for `search_is_some` lint
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.
createTest
function creates and returns r-value reference. and when it returns a reference,testValue
is 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?
The text was updated successfully, but these errors were encountered: