Skip to content

Conversation

erickt and others added 11 commits March 24, 2015 14:26
When built with `rustc -O`:

before:

test bench_read_slice  ... bench:        68 ns/iter (+/- 56)
test bench_read_vec    ... bench:        78 ns/iter (+/- 21)
test bench_write_slice ... bench:       133 ns/iter (+/- 46)
test bench_write_vec   ... bench:       308 ns/iter (+/- 69)

after:

test bench_read_slice  ... bench:        32 ns/iter (+/- 10)
test bench_read_vec    ... bench:        32 ns/iter (+/- 8)
test bench_write_slice ... bench:        53 ns/iter (+/- 12)
test bench_write_vec   ... bench:       247 ns/iter (+/- 172)
This commits adds back an `IpAddr` enum matching the `SocketAddr` enum, but
without a port. The enumeration is `#[unstable]`. The `lookup_host` function and
iterator are also destabilized behind a new feature gate due to questions around
the semantics of returning `SocketAddr` values.
This is technically a breaking change as it deprecates and unstables
some previously stable apis that were missed in the last round of
deprecations.

[breaking change]
This PR adds support for associated types to the `#[derive(...)]` syntax extension. In order to do this, it switches over to using where predicates to apply the type constraints. So now this:

```rust
type Trait {
    type Type;
}

#[derive(Clone)]
struct Foo<A> where A: Trait {
    a: A,
    b: <A as Trait>::Type,
}
```

Gets expended into this impl:

```rust
impl<A: Clone> Clone for Foo<A> where
    A: Trait,
    <A as Trait>::Type: Clone,
{
    fn clone(&self) -> Foo<T> {
        Foo {
            a: self.a.clone(),
            b: self.b.clone(),
        }
    }
}
```
before:

test bench_read_slice  ... bench:        68 ns/iter (+/- 56)
test bench_read_vec    ... bench:        78 ns/iter (+/- 21)
test bench_write_slice ... bench:       133 ns/iter (+/- 46)
test bench_write_vec   ... bench:       308 ns/iter (+/- 69)

after:

test bench_read_slice  ... bench:        32 ns/iter (+/- 10)
test bench_read_vec    ... bench:        32 ns/iter (+/- 8)
test bench_write_slice ... bench:        53 ns/iter (+/- 12)
test bench_write_vec   ... bench:       247 ns/iter (+/- 172)
This commits adds back an `IpAddr` enum matching the `SocketAddr` enum, but
without a port. The enumeration is `#[unstable]`. The `lookup_host` function and
iterator are also destabilized behind a new feature gate due to questions around
the semantics of returning `SocketAddr` values.
This is technically a breaking change as it deprecates and unstables some previously stable apis that were missed in the last round of deprecations.

[breaking change]
@rust-highfive
Copy link
Contributor

r? @huonw

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

@erickt
Copy link
Contributor Author

erickt commented Mar 26, 2015

@bors: r+ p=21

@bors
Copy link
Collaborator

bors commented Mar 26, 2015

📌 Commit 1dbcb5c has been approved by erickt

@bors
Copy link
Collaborator

bors commented Mar 26, 2015

⌛ Testing commit 1dbcb5c with merge a2d93b8...

@bors
Copy link
Collaborator

bors commented Mar 26, 2015

💔 Test failed - auto-mac-64-nopt-t

@Manishearth
Copy link
Member

error: aborting due to previous error
thread 'distributions::WeightedChoice_0' panicked at 'Box<Any>', /Users/rustbuild/src/rust-buildbot/slave/auto-mac-64-nopt-t/build/src/libsyntax/diagnostic.rs:152



failures:
    distributions::WeightedChoice_0

@alexcrichton
Copy link
Member

Closing in favor of #23796, but thanks!

@Centril Centril added the rollup A PR which is a rollup label Oct 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rollup A PR which is a rollup

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants