Skip to content

from_str has an impl for uint, not Option<uint> #17366

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

Merged
merged 1 commit into from
Sep 23, 2014
Merged

Conversation

ohazi
Copy link
Contributor

@ohazi ohazi commented Sep 18, 2014

See: http://doc.rust-lang.org/std/from_str/trait.FromStr.html

let input_num = from_str::<Option<uint>>("5");
<anon>:2:21: 2:45 error: failed to find an implementation of trait std::from_str::FromStr for core::option::Option<uint>
<anon>:2     let input_num = from_str::<Option<uint>>("5");
                             ^~~~~~~~~~~~~~~~~~~~~~~~

@ohazi
Copy link
Contributor Author

ohazi commented Sep 18, 2014

@steveklabnik

@steveklabnik
Copy link
Member

Future note: if you include 'Fixes #17486' in your commit message, Github will automatically close the associated issue when this gets merged. Don't worry about it for this one, we'll just close #17486 manually. Thank you for this!

bors added a commit that referenced this pull request Sep 23, 2014
See: http://doc.rust-lang.org/std/from_str/trait.FromStr.html
```
let input_num = from_str::<Option<uint>>("5");
```
```
<anon>:2:21: 2:45 error: failed to find an implementation of trait std::from_str::FromStr for core::option::Option<uint>
<anon>:2     let input_num = from_str::<Option<uint>>("5");
                             ^~~~~~~~~~~~~~~~~~~~~~~~
```
@steveklabnik
Copy link
Member

I just realized that that would have been time travel, this PR is old! Sorry I missed it :/

@@ -2153,14 +2153,10 @@ In this case, we say `x` is a `uint` explicitly, so Rust is able to properly
tell `random()` what to generate. In a similar fashion, both of these work:

```{rust,ignore}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why aren't these lines being tested in the first place?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unsure. I have a blanket to-do to go through the guide and check that each one of them really needs to be ignored, but this one seems like a good candidate to be not ignored.

@bors bors closed this Sep 23, 2014
@bors bors merged commit c942df9 into rust-lang:master Sep 23, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants