Skip to content

The return behavior of Block expressions in manual is unclear description #14849

Closed
@tetsuharuohzeki

Description

@tetsuharuohzeki
Contributor

The descriptions of Block expressions in the reference manual describes about its returning behavior:

If the final expression is omitted, the type and return value of the block are (), but if it is provided, the type and return value of the block are that of the expression itself.

I think this description has some unclear points,

  • Is this "return" means same as return expressions, or simply means "returning value"?
  • If this behave like return expressions, whether will value moved or copied?
    • if this behavior is under the terminology for rvalue, I seem we should describe it explicitly.

So how should we make this part more clearly description?

Activity

added a commit that references this issue on Feb 13, 2015
148d90b
added 2 commits that reference this issue on Feb 14, 2015

Rollup merge of rust-lang#22307 - steveklabnik:gh14849, r=huonw

b1a7cde

Rollup merge of rust-lang#22307 - steveklabnik:gh14849, r=huonw

6aaf535
added a commit that references this issue on Nov 29, 2018
7242ffe
added a commit that references this issue on Jun 5, 2023

Auto merge of rust-lang#14849 - alibektas:14557n, r=Veykril

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @steveklabnik@tetsuharuohzeki

      Issue actions

        The return behavior of Block expressions in manual is unclear description · Issue #14849 · rust-lang/rust