Skip to content
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

Slightly improve no return for returning function error #102650

Merged
merged 1 commit into from
Oct 5, 2022
Merged

Slightly improve no return for returning function error #102650

merged 1 commit into from
Oct 5, 2022

Conversation

Rageking8
Copy link
Contributor

Fixes #100607

The rationale is that absolute beginners will be slightly confused as to why certain lines of code in a function does not require a semicolon. (I have actually witness a beginner having this confusion). Hence, a slight rationale is added "to return this value", which signals to the user that after removing said semicolon the value is returned resolving that error.

However, if this is not desirable, I welcome any other suggestions. Thanks.

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Oct 4, 2022
@rust-highfive
Copy link
Collaborator

r? @estebank

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 4, 2022
@estebank
Copy link
Contributor

estebank commented Oct 4, 2022

Can you rebase on top of a recent master and run ./x.py test src/test/ui --bless? There are some small discrepancies in the .stderr files that the test suite is failing on.

@rust-log-analyzer

This comment has been minimized.

@Rageking8
Copy link
Contributor Author

Can you rebase on top of a recent master and run ./x.py test src/test/ui --bless? There are some small discrepancies in the .stderr files that the test suite is failing on.

Fixed the CI failure. Thanks.

@compiler-errors
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Oct 4, 2022

📌 Commit 5ddaece has been approved by compiler-errors

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-review Status: Awaiting review from the assignee but also interested parties. labels Oct 4, 2022
notriddle added a commit to notriddle/rust that referenced this pull request Oct 5, 2022
…rn-for-returning-function-error, r=compiler-errors

Slightly improve no return for returning function error

Fixes rust-lang#100607

The rationale is that absolute beginners will be slightly confused as to why certain lines of code in a function does not require a semicolon. (I have actually witness a beginner having this confusion). Hence, a slight rationale is added "to return this value", which signals to the user that after removing said semicolon the value is returned resolving that error.

However, if this is not desirable, I welcome any other suggestions. Thanks.
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 5, 2022
Rollup of 5 pull requests

Successful merges:

 - rust-lang#102574 (Make Hash{Set,Map}::with_hasher unstably const)
 - rust-lang#102650 (Slightly improve no return for returning function error)
 - rust-lang#102662 (rustdoc: remove no-op CSS `.code-header { display: block }`)
 - rust-lang#102670 (follow-up fix about 101866 to print the self type.)
 - rust-lang#102686 (Don't build the compiler before building rls)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 55ebb61 into rust-lang:master Oct 5, 2022
@rustbot rustbot added this to the 1.66.0 milestone Oct 5, 2022
@Rageking8 Rageking8 deleted the slightly-improve-no-return-for-returning-function-error branch October 5, 2022 13:38
hds added a commit to tokio-rs/tracing that referenced this pull request Dec 27, 2022
The error message suggesting that you remove a semicolon to return a
value (instead of unit) was updated slightly in rust-lang/rust#102650,
which was included in Rust 1.66.0.

This causes one of the tests in tracing-attributes to fail. We fix it by
using the updated error message.
hds added a commit to tokio-rs/tracing that referenced this pull request Dec 27, 2022
The error message suggesting that you remove a semicolon to return a
value (instead of unit) was updated slightly in rust-lang/rust#102650,
which was included in Rust 1.66.0.

This causes one of the tests in tracing-attributes to fail. We fix it by
using the updated error message.
hawkw pushed a commit to tokio-rs/tracing that referenced this pull request Dec 27, 2022
The error message suggesting that you remove a semicolon to return a
value (instead of unit) was updated slightly in rust-lang/rust#102650,
which was included in Rust 1.66.0.

This causes one of the tests in tracing-attributes to fail. We fix it by
using the updated error message.
davidbarsky pushed a commit to tokio-rs/tracing that referenced this pull request Sep 27, 2023
The error message suggesting that you remove a semicolon to return a
value (instead of unit) was updated slightly in rust-lang/rust#102650,
which was included in Rust 1.66.0.

This causes one of the tests in tracing-attributes to fail. We fix it by
using the updated error message.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

Slightly improve no return for returning function error
7 participants