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-03-20 05:36:36 +0000
committerbors <bors@rust-lang.org>2017-03-20 05:36:36 +0000
commit6738cd4d473668f7af381826d634e573d15e1f11 (patch)
treeb6077561c35a1168f92af267eb84e15bc7abf654 /src/test/run-pass/thinlto
parent6eb9960d3603aadab62b8f0877e87c63f67001d6 (diff)
parent2561dcddf9e61f5c52a65f1a42641e01bfabe3e2 (diff)
downloadrust-6738cd4d473668f7af381826d634e573d15e1f11.tar.gz
rust-6738cd4d473668f7af381826d634e573d15e1f11.zip
Auto merge of #40281 - jimmycuadra:try-from-from-str, r=aturon
Rename TryFrom's associated type and implement str::parse using TryFrom.

Per discussion on the tracking issue, naming `TryFrom`'s associated type `Error` is generally more consistent with similar traits in the Rust ecosystem, and what people seem to assume it should be called. It also helps disambiguate from `Result::Err`, the most common "Err".

See https://github.com/rust-lang/rust/issues/33417#issuecomment-269108968.

`TryFrom<&str>` and `FromStr` are equivalent, so have the latter provide the former to ensure that. Using `TryFrom` in the implementation of `str::parse` means types that implement either trait can use it. When we're ready to stabilize `TryFrom`, we should update `FromStr` to
suggest implementing `TryFrom<&str>` instead for new code.

See https://github.com/rust-lang/rust/issues/33417#issuecomment-277175994
and https://github.com/rust-lang/rust/issues/33417#issuecomment-277253827.

Refs #33417.
Diffstat (limited to 'src/test/run-pass/thinlto')
0 files changed, 0 insertions, 0 deletions