about summary refs log tree commit diff
path: root/src/test/run-pass/thinlto
diff options
context:
space:
mode:
authorCorey Farwell <coreyf@rwell.org>2017-03-19 20:51:06 -0400
committerGitHub <noreply@github.com>2017-03-19 20:51:06 -0400
commit573e906594fdf7824f49789f24fdadb4496d7368 (patch)
tree96298d7b9940982be8fc532c72b0b2c7dcd5e173 /src/test/run-pass/thinlto
parente5221f93977922090b0370aff1efdbf5c2d12f6d (diff)
parent2561dcddf9e61f5c52a65f1a42641e01bfabe3e2 (diff)
downloadrust-573e906594fdf7824f49789f24fdadb4496d7368.tar.gz
rust-573e906594fdf7824f49789f24fdadb4496d7368.zip
Rollup 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