You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The type of a block is the type of the final operand, or () if the final operand is omitted.
In this case, the final operand is (). However, the code could be compiled only if the block type is a never type !`, which could be coerced to any output type.
we may need to add the extra case to define the type of the block
If the final operand is evaluated, the type of a block is the type of the final operand, or () if the final operand is omitted. Otherwise, if the block contains any diverging expression, the block type is a never type.
The text was updated successfully, but these errors were encountered:
Consider this example:
According [items.fn.body], the function's body is conceptually rewritten as
However, https://doc.rust-lang.org/stable/reference/expressions/block-expr.html#block-expressions says:
In this case, the final operand is
(). However, the code could be compiled only if the block type is a never type
!`, which could be coerced to any output type.we may need to add the extra case to define the type of the block
The text was updated successfully, but these errors were encountered: