{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/37307","repository_url":"https://api.github.com/repos/rust-lang/rust","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/37307/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/37307/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/37307/events","html_url":"https://github.com/rust-lang/rust/issues/37307","id":184237314,"number":37307,"title":"Guessing game example does not give a warning","user":{"login":"vkatsikaros","id":1138992,"avatar_url":"https://avatars.githubusercontent.com/u/1138992?v=3","gravatar_id":"","url":"https://api.github.com/users/vkatsikaros","html_url":"https://github.com/vkatsikaros","followers_url":"https://api.github.com/users/vkatsikaros/followers","following_url":"https://api.github.com/users/vkatsikaros/following{/other_user}","gists_url":"https://api.github.com/users/vkatsikaros/gists{/gist_id}","starred_url":"https://api.github.com/users/vkatsikaros/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vkatsikaros/subscriptions","organizations_url":"https://api.github.com/users/vkatsikaros/orgs","repos_url":"https://api.github.com/users/vkatsikaros/repos","events_url":"https://api.github.com/users/vkatsikaros/events{/privacy}","received_events_url":"https://api.github.com/users/vkatsikaros/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-10-20T13:58:21Z","updated_at":"2016-10-20T14:12:14Z","closed_at":null,"body":"The Rust book on [Guessing Game - Processing a Guess](https://github.com/rust-lang/rust/blame/master/src/doc/book/guessing-game.md#L280) says that after compiling the example we'll get a warning. However, I didn't get one:\r\n\r\n```\r\n~/projects/rust $ cargo new guessing_game_2 --bin\r\n     Created binary (application) `guessing_game_2` project\r\n~/projects/rust $ cd guessing_game_2/\r\n~/projects/rust/guessing_game_2 $ cargo build\r\n   Compiling guessing_game_2 v0.1.0 (file:///home/vag/projects/rust/guessing_game_2)\r\n    Finished debug [unoptimized + debuginfo] target(s) in 0.52 secs\r\n~/projects/rust/guessing_game_2 $ cargo run\r\n    Finished debug [unoptimized + debuginfo] target(s) in 0.0 secs\r\n     Running `target/debug/guessing_game_2`\r\nHello, world!\r\n~/projects/rust/guessing_game_2 $ cat > src/main.rs \r\nuse std::io;\r\n\r\nfn main() {\r\n    println!(\"Guess the number!\");\r\n\r\n    println!(\"Please input your guess.\");\r\n\r\n    let mut guess = String::new();\r\n\r\n    io::stdin().read_line(&mut guess)\r\n        .expect(\"Failed to read line\");\r\n\r\n    println!(\"You guessed: {}\", guess);\r\n}\r\n\r\n~/projects/rust/guessing_game_2 $ cargo build\r\n   Compiling guessing_game_2 v0.1.0 (file:///home/vag/projects/rust/guessing_game_2)\r\n    Finished debug [unoptimized + debuginfo] target(s) in 0.65 secs\r\n```\r\nAccording to the book I expected:\r\n```\r\nsrc/main.rs:10:5: 10:39 warning: unused result which must be used,\r\n#[warn(unused_must_use)] on by default\r\nsrc/main.rs:10     io::stdin().read_line(&mut guess);\r\n```\r\n\r\nI installed rust via https://rustup.rs/ and I got\r\n```\r\n$ rustc --version && cargo --version\r\nrustc 1.12.0 (3191fbae9 2016-09-23)\r\ncargo 0.13.0-nightly (109cb7c 2016-08-19)\r\n```\r\n\r\nI am on \r\n```\r\n$ lsb_release -a\r\nNo LSB modules are available.\r\nDistributor ID:\tUbuntu\r\nDescription:\tUbuntu 14.04.5 LTS\r\nRelease:\t14.04\r\nCodename:\ttrusty\r\n```"},"comment":{"url":"https://api.github.com/repos/rust-lang/rust/issues/comments/255117387","html_url":"https://github.com/rust-lang/rust/issues/37307#issuecomment-255117387","issue_url":"https://api.github.com/repos/rust-lang/rust/issues/37307","id":255117387,"user":{"login":"TimNN","id":1178249,"avatar_url":"https://avatars.githubusercontent.com/u/1178249?v=3","gravatar_id":"","url":"https://api.github.com/users/TimNN","html_url":"https://github.com/TimNN","followers_url":"https://api.github.com/users/TimNN/followers","following_url":"https://api.github.com/users/TimNN/following{/other_user}","gists_url":"https://api.github.com/users/TimNN/gists{/gist_id}","starred_url":"https://api.github.com/users/TimNN/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TimNN/subscriptions","organizations_url":"https://api.github.com/users/TimNN/orgs","repos_url":"https://api.github.com/users/TimNN/repos","events_url":"https://api.github.com/users/TimNN/events{/privacy}","received_events_url":"https://api.github.com/users/TimNN/received_events","type":"User","site_admin":false},"created_at":"2016-10-20T14:12:14Z","updated_at":"2016-10-20T14:12:14Z","body":"The book pretty explicitly states (emphasis mine):\r\n\r\n> **_If_ we leave off calling this method**, our program will compile, but we’ll get a warning:\r\n\r\n"}}
{"actor":{"display_login":"TimNN"}}