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

Detect tuple variants used as struct pattern and suggest correct pattern #75354

Merged
merged 1 commit into from
Aug 12, 2020

Conversation

estebank
Copy link
Contributor

@estebank estebank commented Aug 10, 2020

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 10, 2020
@petrochenkov
Copy link
Contributor

r=me with the cleanup applied.

@petrochenkov petrochenkov 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 Aug 10, 2020
@estebank
Copy link
Contributor Author

@bors r=petrochenkov

@bors
Copy link
Contributor

bors commented Aug 10, 2020

📌 Commit ed3a1f551ca095c004e62c0082c20bbe7faeacce has been approved by petrochenkov

@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 Aug 10, 2020
@bors

This comment has been minimized.

@bors bors 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 11, 2020
@petrochenkov
Copy link
Contributor

Two tests failed on CI.

@petrochenkov
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Aug 11, 2020

📌 Commit 17ada05 has been approved by petrochenkov

@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 Aug 11, 2020
@bors
Copy link
Contributor

bors commented Aug 12, 2020

⌛ Testing commit 17ada05 with merge 0bcc9ec9854c62340ba8ff7e448e0e2da92e8660...

@rust-log-analyzer
Copy link
Collaborator

The job mingw-check of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
Build completed successfully in 0:01:47
+ /scripts/validate-toolstate.sh
Cloning into 'rust-toolstate'...
<Nothing changed>
error: embedded-book maintainer @thejpster is not assignable in the rust-lang/rust repo
error: embedded-book maintainer @ryankurte is not assignable in the rust-lang/rust repo
error: embedded-book maintainer @korken89 is not assignable in the rust-lang/rust repo

  To be assignable, a person needs to be explicitly listed as a
  collaborator in the repository settings. The simple way to
  fix this is to ask someone with 'admin' privileges on the repo
  to add the person or whole team as a collaborator with 'read'
  privileges. Those privileges don't grant any extra permissions
  so it's safe to apply them.
The build will fail due to this.
== clock drift check ==
  local time: Wed Aug 12 10:57:28 UTC 2020
  network time: Wed, 12 Aug 2020 10:57:28 GMT
  network time: Wed, 12 Aug 2020 10:57:28 GMT
== end clock drift check ==
##[error]Process completed with exit code 1.
Terminate orphan process: pid (6385) (node)
Terminate orphan process: pid (6413) (python)

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @rust-lang/infra. (Feature Requests)

@bors
Copy link
Contributor

bors commented Aug 12, 2020

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 12, 2020
@petrochenkov
Copy link
Contributor

Failed due to #75450.
@bors retry

@bors bors removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 12, 2020
@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Aug 12, 2020
@bors
Copy link
Contributor

bors commented Aug 12, 2020

⌛ Testing commit 17ada05 with merge ef1d58e...

@bors
Copy link
Contributor

bors commented Aug 12, 2020

☀️ Test successful - checks-actions, checks-azure
Approved by: petrochenkov
Pushing ef1d58e to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 12, 2020
@bors bors merged commit ef1d58e into rust-lang:master Aug 12, 2020
@@ -701,7 +701,16 @@ impl<'a> LateResolutionVisitor<'a, '_, '_> {
if let Some(span) = self.def_span(def_id) {
err.span_label(span, &format!("`{}` defined here", path_str));
}
err.span_label(span, format!("did you mean `{}( /* fields */ )`?", path_str));
let fields =
self.r.field_names.get(&def_id).map_or("/* fields */".to_string(), |fields| {
Copy link
Contributor

Choose a reason for hiding this comment

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

-.map_or("/* fields */".to_string()
+.map_or_else(|| "/* fields */".to_string()

@estebank estebank deleted the tuple-struct-as-struct-pat branch November 9, 2023 05:16
@cuviper cuviper added this to the 1.47.0 milestone May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. 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.

Handle Foo { a: usize, b: usize } used as Foo(1, 2) gracefully
7 participants