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

Add test for suggestion to borrow unsized function parameters #84728

Merged
merged 1 commit into from
May 7, 2021

Conversation

camelid
Copy link
Member

@camelid camelid commented Apr 29, 2021

Closes #82820.

This is a regression test for #82820.

This test case is included in more general tests, but I think the error
regressed because there were a bunch of other diagnostic changes in the
test that obscured this regression.

Hopefully, having a test specific to the suggestion, and running rustfix
for the test, will prevent this error from regressing in the future.

@camelid camelid added A-diagnostics Area: Messages for errors, warnings, and lints A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix`. A-testsuite Area: The testsuite used to check the correctness of rustc labels Apr 29, 2021
@rust-highfive
Copy link
Collaborator

r? @Mark-Simulacrum

(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 Apr 29, 2021
@camelid
Copy link
Member Author

camelid commented Apr 29, 2021

This PR is draft because I'm waiting for CI to fail so I can copy-paste the output.

@camelid camelid 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 Apr 29, 2021
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@camelid camelid marked this pull request as ready for review April 30, 2021 20:17
@camelid
Copy link
Member Author

camelid commented Apr 30, 2021

Ok, CI should pass now.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@camelid camelid added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 2, 2021
@hellow554
Copy link
Contributor

Would it make sense to to add fn baz(_baz: str) as well, because how _ was handled differently than baz? Not sure, if there is a different codepath for underscore variables as well.

@camelid
Copy link
Member Author

camelid commented May 5, 2021

Done :)

@camelid camelid force-pushed the sized-param-sugg-test branch 2 times, most recently from 9ebbd73 to a7762be Compare May 5, 2021 01:36
@rust-log-analyzer

This comment has been minimized.

@Mark-Simulacrum Mark-Simulacrum 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 May 6, 2021
@Mark-Simulacrum
Copy link
Member

r=me once CI is fixed

This is a regression test for rust-lang#82820.

This test case is included in more general tests, but I think the error
regressed because there were a bunch of other diagnostic changes in the
test that obscured this regression.

Hopefully, having a test specific to the suggestion, and running rustfix
for the test, will prevent this error from regressing in the future.
@camelid
Copy link
Member Author

camelid commented May 6, 2021

@bors r=@Mark-Simulacrum rollup

@bors
Copy link
Contributor

bors commented May 6, 2021

📌 Commit a7500e5 has been approved by Mark-Simulacrum

@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 May 6, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request May 7, 2021
Rollup of 11 pull requests

Successful merges:

 - rust-lang#84409 (Ensure TLS destructors run before thread joins in SGX)
 - rust-lang#84500 (Add --run flag to compiletest)
 - rust-lang#84728 (Add test for suggestion to borrow unsized function parameters)
 - rust-lang#84734 (Add `needs-unwind` and beginning of support for testing `panic=abort` std to compiletest)
 - rust-lang#84755 (Allow using `core::` in intra-doc links within core itself)
 - rust-lang#84871 (Disallows `#![feature(no_coverage)]` on stable and beta (using standard crate-level gating))
 - rust-lang#84872 (Wire up tidy dependency checks for cg_clif)
 - rust-lang#84896 (Handle incorrect placement of parentheses in trait bounds more gracefully)
 - rust-lang#84905 (CTFE engine: rename copy → copy_intrinsic, move to intrinsics.rs)
 - rust-lang#84953 (Remove unneeded call to with_default_session_globals in rustdoc highlight)
 - rust-lang#84987 (small nits)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 3a0d6be into rust-lang:master May 7, 2021
@rustbot rustbot added this to the 1.54.0 milestone May 7, 2021
@camelid camelid deleted the sized-param-sugg-test branch May 7, 2021 19:20
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 A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix`. A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect suggestion for function parameter of type str
7 participants