-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Slightly improve no return for returning function error #102650
Conversation
r? @estebank (rust-highfive has picked a reviewer for you, use r? to override) |
Can you rebase on top of a recent master and run |
This comment has been minimized.
This comment has been minimized.
Fixed the CI failure. Thanks. |
@bors r+ |
…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.
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
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.
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.
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.
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.
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.