Skip to content

Don't refer to 'this tail expression' in expansion. #142024

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

Merged
merged 1 commit into from
Jun 5, 2025

Conversation

m-ou-se
Copy link
Member

@m-ou-se m-ou-se commented Jun 4, 2025

The user has no clue what the compiler is talking about when it says "this tail expression". It is an implementation detail of the macro that it uses a block with tail expression.

@rustbot
Copy link
Collaborator

rustbot commented Jun 4, 2025

r? @petrochenkov

rustbot has assigned @petrochenkov.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 4, 2025
@m-ou-se m-ou-se added the A-diagnostics Area: Messages for errors, warnings, and lints label Jun 4, 2025
Comment on lines -5 to -8
| --- ^^^^^^^^
| | |
| | the trait `T` is not implemented for `()`
| | this tail expression is of type `()`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remark: what's slightly amusing is that the Reference calls the tail expr of an block expr the "final operand"

The syntax for a block is [...] then an optional expression, called the final operand, and finally a }.
-- https://doc.rust-lang.org/reference/expressions/block-expr.html#r-expr.block.inner-attributes

@bjorn3
Copy link
Member

bjorn3 commented Jun 4, 2025

nit: s/hase/has in the commit message and PR description

@petrochenkov
Copy link
Contributor

r=me after #142024 (comment) is addressed and CI is green.
@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 4, 2025
The user has no clue what tail expression the compiler is talking
about: it is an implementation detail of the macro that it uses a block
with tail expression.
@m-ou-se
Copy link
Member Author

m-ou-se commented Jun 4, 2025

@bors r=petrochenkov rollup

@bors
Copy link
Collaborator

bors commented Jun 4, 2025

📌 Commit da2e33b has been approved by petrochenkov

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 4, 2025
bors added a commit that referenced this pull request Jun 5, 2025
Rollup of 11 pull requests

Successful merges:

 - #141890 (Add link to correct documentation in htmldocck.py)
 - #141932 (Fix for async drop inside async gen fn)
 - #141960 (Use non-2015 edition paths in tests that do not test for their resolution)
 - #141968 (Run wfcheck in one big loop instead of per module)
 - #141969 (Triagebot: Remove `assign.users_on_vacation`)
 - #141985 (Ensure query keys are printed with reduced queries)
 - #141999 (Visit the ident in `PreciseCapturingNonLifetimeArg`.)
 - #142005 (Change `tag_field` to `FieldIdx` in `Variants::Multiple`)
 - #142017 (Fix incorrect use of "recommend" over "recommended")
 - #142024 (Don't refer to 'this tail expression' in expansion.)
 - #142025 (Don't refer to 'local binding' in extern macro.)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit e081588 into rust-lang:master Jun 5, 2025
10 checks passed
@rustbot rustbot added this to the 1.89.0 milestone Jun 5, 2025
rust-timer added a commit that referenced this pull request Jun 5, 2025
Rollup merge of #142024 - m-ou-se:what-tail-expression, r=petrochenkov

Don't refer to 'this tail expression' in expansion.

The user has no clue what the compiler is talking about when it says "this tail expression". It is an implementation detail of the macro that it uses a block with tail expression.
@m-ou-se m-ou-se deleted the what-tail-expression branch June 5, 2025 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants