Skip to content

[beta] Revert heterogeneous SocketAddr PartialEq impls #73318

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
wants to merge 2 commits into from

Conversation

dtolnay
Copy link
Member

@dtolnay dtolnay commented Jun 13, 2020

Clean backport of #73304 which is fixing the regressions in #73242.

dtolnay added 2 commits June 13, 2020 10:28
These lead to inference regressions (mostly in tests) in code that looks
like:

    let socket = std::net::SocketAddrV4::new(std::net::Ipv4Addr::new(127, 0, 0, 1), 8080);
    assert_eq!(socket, "127.0.0.1:8080".parse().unwrap());

That compiles as of stable 1.44.0 but fails in beta with:

    error[E0284]: type annotations needed
     --> src/main.rs:3:41
      |
    3 |     assert_eq!(socket, "127.0.0.1:8080".parse().unwrap());
      |                                         ^^^^^ cannot infer type for type parameter `F` declared on the associated function `parse`
      |
      = note: cannot satisfy `<_ as std::str::FromStr>::Err == _`
    help: consider specifying the type argument in the method call
      |
    3 |     assert_eq!(socket, "127.0.0.1:8080".parse::<F>().unwrap());
      |
@rust-highfive
Copy link
Contributor

r? @withoutboats

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

@rust-highfive
Copy link
Contributor

⚠️ Warning ⚠️

  • Pull requests are usually filed against the master branch for this repo, but this one is against beta. Please double check that you specified the right target!

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 13, 2020
@dtolnay
Copy link
Member Author

dtolnay commented Jun 13, 2020

r? @Mark-Simulacrum

@Mark-Simulacrum
Copy link
Member

Seems good, but I'll include it in a beta backport rollup later today so not approving this. Thanks!

@Mark-Simulacrum
Copy link
Member

Closing, included in #73326.

@dtolnay dtolnay deleted the beta/socketeq branch June 14, 2020 01:39
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 15, 2020
…-morse,Mark-Simulacrum

[beta] backport

This is a beta backport rollup of the following:
* [beta] Revert heterogeneous SocketAddr PartialEq impls rust-lang#73318
* Fix emcc failure for wasm32. rust-lang#73213
* Revert rust-lang#71956 rust-lang#73153
* [beta] Update cargo rust-lang#73141
* Minor: off-by-one error in RELEASES.md rust-lang#72914
* normalize adt fields during structural match checking rust-lang#72897
* Revert pr 71840 rust-lang#72989
* rust-lang/cargo#8361
* e658200 from rust-lang#72901

r? @ghost
@dtolnay dtolnay added A-io Area: `std::io`, `std::fs`, `std::net` and `std::path` T-release Relevant to the release subteam, which will review and decide on the PR/issue. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 14, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-io Area: `std::io`, `std::fs`, `std::net` and `std::path` T-release Relevant to the release subteam, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants