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

[beta] Revert heterogeneous SocketAddr PartialEq impls #73318

Closed
wants to merge 2 commits into from

Commits on Jun 13, 2020

  1. Revert heterogeneous SocketAddr PartialEq impls

    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());
          |
    dtolnay committed Jun 13, 2020
    Configuration menu
    Copy the full SHA
    6ec9fdf View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b6e9a9a View commit details
    Browse the repository at this point in the history