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

Make sure that some stdlib method signatures aren't accidental refinements #110958

Merged
merged 1 commit into from
Apr 29, 2023

Conversation

compiler-errors
Copy link
Member

@compiler-errors compiler-errors commented Apr 28, 2023

In the process of implementing https://rust-lang.github.io/rfcs/3245-refined-impls.html, I found a bunch of stdlib implementations that accidentally "refined" their method signatures by dropping (unnecessary) bounds.

This isn't currently a problem, but may become one if/when method signature refining is stabilized in the future. Shouldn't hurt to make these signatures a bit more accurate anyways.

NOTE (just to be clear lol): This does not affect behavior at all, since we don't actually take advantage of refined implementations yet!

@rustbot
Copy link
Collaborator

rustbot commented Apr 28, 2023

r? @cuviper

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Apr 28, 2023
@rustbot
Copy link
Collaborator

rustbot commented Apr 28, 2023

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@cuviper
Copy link
Member

cuviper commented Apr 28, 2023

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Apr 28, 2023

📌 Commit 33871c9 has been approved by cuviper

It is now in the queue for this repository.

@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-review Status: Awaiting review from the assignee but also interested parties. labels Apr 28, 2023
@Mark-Simulacrum
Copy link
Member

Can we add a lint for std/core to use to prevent this by default? (IIRC, there was some discussion of not implicitly refining anyway, so maybe that's the plan still).

@compiler-errors
Copy link
Member Author

@Mark-Simulacrum: Yeah, that'll eventually come around, but I've gotta work out some problems with lifetime false positives first

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Apr 29, 2023
… r=cuviper

Make sure that some stdlib method signatures aren't accidental refinements

In the process of implementing https://rust-lang.github.io/rfcs/3245-refined-impls.html, I found a bunch of stdlib implementations that accidentally "refined" their method signatures by dropping  (unnecessary) bounds.

This isn't currently a problem, but may become one if/when method  signature refining is stabilized in the future. Shouldn't hurt to make these signatures a bit more accurate anyways.

NOTE (just to be clear lol): This does not affect behavior at all, since we don't actually take advantage of refined implementations yet!
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 29, 2023
Rollup of 6 pull requests

Successful merges:

 - rust-lang#110614 (Clear response values for overflow in new solver)
 - rust-lang#110894 (Bump libffi-sys to 2.3.0)
 - rust-lang#110932 (include source error for LoadLibraryExW)
 - rust-lang#110958 (Make sure that some stdlib method signatures aren't accidental refinements)
 - rust-lang#110962 (Make drop_flags an IndexVec.)
 - rust-lang#110965 (Don't duplicate anonymous lifetimes for async fn in traits)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 339786e into rust-lang:master Apr 29, 2023
@rustbot rustbot added this to the 1.71.0 milestone Apr 29, 2023
@compiler-errors compiler-errors deleted the stdlib-refinement branch August 11, 2023 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants