about summary refs log tree commit diff
path: root/src/test/run-pass/thinlto
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-01-24 01:17:09 +0000
committerbors <bors@rust-lang.org>2017-01-24 01:17:09 +0000
commit18b6b8fb8fe781014a63b7523dfa73113213332b (patch)
treeb30c6ce14428ae79d4c43b41dd18a1e3f90bdb4a /src/test/run-pass/thinlto
parenta583f6f47cbfc4f0a21f70f7e4ed3e0fbe514c10 (diff)
parenta5f2f36ebdad455cbff8d6cb1b2647698299020a (diff)
downloadrust-18b6b8fb8fe781014a63b7523dfa73113213332b.tar.gz
rust-18b6b8fb8fe781014a63b7523dfa73113213332b.zip
Auto merge of #39048 - lambda:impl-tosocketaddrs-for-string, r=alexcrichton
impl ToSocketAddrs for String

`ToSocketAddrs` is implemented for a number of different types,
including `(IpAddr, u16)`, `&str`, and various others, for the
convenience of being able to run things like
`TcpListener::bind("10.11.12.13:1415")`.  However, because this is a
generic parameter with a trait bound, if you have a `String` you cannot
pass it in, either directly as `TcpListener::bind(string)`, or the
`TcpListener::bind(&string)` as you might expect due to deref coercion;
you have to use `TcpListener::bind(&*string)`, which is noisy and hard
to discover (though #39029 suggests better error messages to make it
more discoverable).

Rather than making people stumble over this, just implement
`ToSocketAddrs` for `String`.
Diffstat (limited to 'src/test/run-pass/thinlto')
0 files changed, 0 insertions, 0 deletions