Skip to content

Conversation

@sbstp
Copy link

@sbstp sbstp commented Jul 20, 2014

I was reading the lifetime guide and noticed that a word was missing from the sentence. I'm not sure if struct is the best word to describe what's happening here, let me know if you want something else.

@lilyball
Copy link
Contributor

The existing wording is correct and matches usage in other languages.

@huonw
Copy link
Contributor

huonw commented Jul 20, 2014

If we were to expand this, I think "temporary variable" would be the most correct thing, since e.g. &1 and &None are valid and neither of those are structs.

@lilyball
Copy link
Contributor

If we're fine with the term "rvalue" we should be fine with the term "temporary".

@huonw
Copy link
Contributor

huonw commented Jul 20, 2014

I wasn't arguing either way, just pointing out the correct expansion.

@sbstp
Copy link
Author

sbstp commented Jul 20, 2014

Ah, I see. Temporary is used as a noun. I thought it was used as an adjective and that it was missing a noun.

I think it's a bit confusing for newcomers, since this is one of the rare times this word is used.

@alexcrichton
Copy link
Member

Closing due to inactivity, but feel free to reopen with comments addressed!

flip1995 added a commit to flip1995/rust that referenced this pull request Oct 31, 2025
rust-lang#15817)

When matched against `Result` with copyable `Ok` variant, uncopyable
scrutinee won't actually be moved. But
`manual_unwrap_or`/`manual_unwrap_or_default` will force it to move,
which can cause problem if scrutinee is used later.

Fixes rust-lang/rust-clippy#15807

changelog: [`manual_unwrap_or`]: don't lint if not safe to move
scrutinee
changelog: [`manual_unwrap_or_default`]: don't lint if not safe to move
scrutinee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants