Fix a error suggestion for E0121 when using placeholder _ as return types on function signature. by surechen · Pull Request #127110 · rust-lang/rust (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation3 Commits1 Checks6 Files changed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
Recommit after refactoring based on comment:
#126017 (comment)
But when changing return type's lifetime to ReError
will affect the subsequent borrow check process and cause test11 in typeck_type_placeholder_item.rs to lost E0515 message.
fn test11(x: &usize) -> &_ {
//^ ERROR the placeholder ERROR cannot return reference to function parameter(this E0515 msg will disappear)
}_
is not allowed within types on item signatures for return types
&x //
fixes #125488
r? @pnkfelix
…ypes on function signature.
Recommit after refactoring based on comment: rust-lang#126017 (comment)
But when changing return type's lifetime to ReError
will affect the subsequent borrow check process and cause test11 in typeck_type_placeholder_item.rs to lost E0515 message.
fn test11(x: &usize) -> &_ {
//~^ ERROR the placeholder `_` is not allowed within types on item signatures for return types
&x //~ ERROR cannot return reference to function parameter(this E0515 msg will disappear)
}
rustbot has assigned @compiler-errors.
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 added S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
surechen changed the title
Fix a error suggestion for E0121 when using placeholder _ as return t… Fix a error suggestion for E0121 when using placeholder _ as return types on function signature.
Thanks for applying the suggestion.
@bors r+
📌 Commit 50edb32 has been approved by compiler-errors
It is now in the queue for this repository.
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
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request
…-errors
Fix a error suggestion for E0121 when using placeholder _ as return types on function signature.
Recommit after refactoring based on comment: rust-lang#126017 (comment)
But when changing return type's lifetime to ReError
will affect the subsequent borrow check process and cause test11 in typeck_type_placeholder_item.rs to lost E0515 message.
fn test11(x: &usize) -> &_ {
//~^ ERROR the placeholder `_` is not allowed within types on item signatures for return types
&x //~ ERROR cannot return reference to function parameter(this E0515 msg will disappear)
}
fixes rust-lang#125488
r? @pnkfelix
bors added a commit to rust-lang-ci/rust that referenced this pull request
…iaskrgr
Rollup of 9 pull requests
Successful merges:
- rust-lang#123237 (Various rustc_codegen_ssa cleanups)
- rust-lang#126960 (Improve error message in tidy)
- rust-lang#127002 (Implement
x perf
as a separate tool) - rust-lang#127050 (Make mtime of reproducible tarballs dependent on git commit)
- rust-lang#127081 (Add a run-make test that LLD is not being used by default on the x64 beta/stable channel)
- rust-lang#127106 (Improve unsafe extern blocks diagnostics)
- rust-lang#127110 (Fix a error suggestion for E0121 when using placeholder _ as return types on function signature.)
- rust-lang#127114 (fix: prefer
(*p).clone
top.clone
if thep
is a raw pointer) - rust-lang#127118 (Show
used attribute
's kind for user when find it isn't applied to astatic
variable.)
r? @ghost
@rustbot
modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request
…iaskrgr
Rollup of 9 pull requests
Successful merges:
- rust-lang#123237 (Various rustc_codegen_ssa cleanups)
- rust-lang#126960 (Improve error message in tidy)
- rust-lang#127002 (Implement
x perf
as a separate tool) - rust-lang#127081 (Add a run-make test that LLD is not being used by default on the x64 beta/stable channel)
- rust-lang#127106 (Improve unsafe extern blocks diagnostics)
- rust-lang#127110 (Fix a error suggestion for E0121 when using placeholder _ as return types on function signature.)
- rust-lang#127114 (fix: prefer
(*p).clone
top.clone
if thep
is a raw pointer) - rust-lang#127118 (Show
used attribute
's kind for user when find it isn't applied to astatic
variable.) - rust-lang#127122 (Remove uneccessary condition in
div_ceil
)
r? @ghost
@rustbot
modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request
…iaskrgr
Rollup of 9 pull requests
Successful merges:
- rust-lang#123237 (Various rustc_codegen_ssa cleanups)
- rust-lang#126960 (Improve error message in tidy)
- rust-lang#127002 (Implement
x perf
as a separate tool) - rust-lang#127081 (Add a run-make test that LLD is not being used by default on the x64 beta/stable channel)
- rust-lang#127106 (Improve unsafe extern blocks diagnostics)
- rust-lang#127110 (Fix a error suggestion for E0121 when using placeholder _ as return types on function signature.)
- rust-lang#127114 (fix: prefer
(*p).clone
top.clone
if thep
is a raw pointer) - rust-lang#127118 (Show
used attribute
's kind for user when find it isn't applied to astatic
variable.) - rust-lang#127122 (Remove uneccessary condition in
div_ceil
)
r? @ghost
@rustbot
modify labels: rollup
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request
Rollup merge of rust-lang#127110 - surechen:fix_125488_06, r=compiler-errors
Fix a error suggestion for E0121 when using placeholder _ as return types on function signature.
Recommit after refactoring based on comment: rust-lang#126017 (comment)
But when changing return type's lifetime to ReError
will affect the subsequent borrow check process and cause test11 in typeck_type_placeholder_item.rs to lost E0515 message.
fn test11(x: &usize) -> &_ {
//~^ ERROR the placeholder `_` is not allowed within types on item signatures for return types
&x //~ ERROR cannot return reference to function parameter(this E0515 msg will disappear)
}
fixes rust-lang#125488
r? @pnkfelix
Labels
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Relevant to the compiler team, which will review and decide on the PR/issue.