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-31 16:48:26 -0400
committerGitHub <noreply@github.com>2017-03-31 16:48:26 -0400
commit6edab01499c2af1b04e5914a64f0e66ae50253c3 (patch)
tree6e1d0900b6179462d02c1a456403481ea1bd851f /src/test/run-pass/thinlto
parentc6e25127050da09cde3d48d0dbda48ddad99c24d (diff)
parentcd2ec7eded8d65b88b4c2fdb26efe1b3c505bd6f (diff)
downloadrust-6edab01499c2af1b04e5914a64f0e66ae50253c3.tar.gz
rust-6edab01499c2af1b04e5914a64f0e66ae50253c3.zip
Rollup merge of #40763 - pirate:patch-2, r=steveklabnik
Add helpful hint in io docs about how ? is not allowed in main()

This is my effort to help alleviate the confusion caused by the error message:
```rust
error[E0277]: the trait bound `(): std::ops::Carrier` is not satisfied
  --> hello_world.rs:72:5
   |
72 |     io::stdin().read_line(&mut d_input)?;
   |     ------------------------------------
   |     |
   |     the trait `std::ops::Carrier` is not implemented for `()`
   |     in this macro invocation
   |
   = note: required by `std::ops::Carrier::from_error`

error: aborting due to previous error
```
This has been discussed at length in https://github.com/rust-lang/rust/issues/35946, but I figured it would be helpful to mention in the docs.
Reading user input is one of the first things beginners will look up in the docs, so my thinking was they'd see this warning here and not have to deal with the [tricky error message](https://blog.rust-lang.org/2017/03/02/lang-ergonomics.html).

If you think this isn't the right place to put this in the docs, that's understandable, I'm open to suggestions for putting it elsewhere or removing it entirely.
Diffstat (limited to 'src/test/run-pass/thinlto')
0 files changed, 0 insertions, 0 deletions