Skip to content

Conversation

camsteffen
Copy link
Contributor

changelog: none

  • Split is_diagnostic_assoc_item into is_diag_item_method and is_diag_trait_item
    • is_diag_item_method is a bit more nuanced with the tcx.type_of(impl_id).ty_adt_def() step, so it seems better to keep that separate.
    • No need to generalize over traits and Adt's since we know which one we want at compile time
    • "item" vs. "method" because a trait may have associated items.
  • Replaces the usage of the sym::slice diagnostic item with the slice_alloc lang item. The diagnostic item should be removed from rustc because it is on the slice_alloc impl, not slice itself (and it's not needed).

@rust-highfive
Copy link

r? @llogiq

(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 13, 2021
@llogiq
Copy link
Contributor

llogiq commented Apr 13, 2021

Thank you! Are you going to push a PR removing sym::slice to rust?

@bors r+

@bors
Copy link
Contributor

bors commented Apr 13, 2021

📌 Commit 76bd5d2 has been approved by llogiq

@bors
Copy link
Contributor

bors commented Apr 13, 2021

⌛ Testing commit 76bd5d2 with merge 8f3c245...

@camsteffen
Copy link
Contributor Author

Are you going to push a PR removing sym::slice to rust?

Yes I can do that.

@bors
Copy link
Contributor

bors commented Apr 13, 2021

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: llogiq
Pushing 8f3c245 to master...

@bors bors merged commit 8f3c245 into rust-lang:master Apr 13, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 26, 2021
Remove slice diagnostic item

...because it is unusally placed on an impl and is redundant with a lang item.

Depends on rust-lang/rust-clippy#7074 (next clippy sync). ~I expect clippy tests to fail in the meantime.~ Nope tests passed...

CC `@flip1995`
@camsteffen camsteffen deleted the diag-methods branch July 8, 2021 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants