{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang/rust-by-example/issues/770","repository_url":"https://api.github.com/repos/rust-lang/rust-by-example","labels_url":"https://api.github.com/repos/rust-lang/rust-by-example/issues/770/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust-by-example/issues/770/comments","events_url":"https://api.github.com/repos/rust-lang/rust-by-example/issues/770/events","html_url":"https://github.com/rust-lang/rust-by-example/issues/770","id":164733016,"number":770,"title":"8.2.2 Fn FnMut FnOnce text needs updating","user":{"login":"alexandermerritt","id":3632069,"avatar_url":"https://avatars.githubusercontent.com/u/3632069?v=3","gravatar_id":"","url":"https://api.github.com/users/alexandermerritt","html_url":"https://github.com/alexandermerritt","followers_url":"https://api.github.com/users/alexandermerritt/followers","following_url":"https://api.github.com/users/alexandermerritt/following{/other_user}","gists_url":"https://api.github.com/users/alexandermerritt/gists{/gist_id}","starred_url":"https://api.github.com/users/alexandermerritt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexandermerritt/subscriptions","organizations_url":"https://api.github.com/users/alexandermerritt/orgs","repos_url":"https://api.github.com/users/alexandermerritt/repos","events_url":"https://api.github.com/users/alexandermerritt/events{/privacy}","received_events_url":"https://api.github.com/users/alexandermerritt/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-07-10T20:34:43Z","updated_at":"2016-07-11T22:36:15Z","closed_at":null,"body":"http://rustbyexample.com/fn/closures/input_parameters.html\r\n\r\n~~Most of that is incorrect and~~ does not demonstrate how FnOnce executes once."},"comment":{"url":"https://api.github.com/repos/rust-lang/rust-by-example/issues/comments/231886488","html_url":"https://github.com/rust-lang/rust-by-example/issues/770#issuecomment-231886488","issue_url":"https://api.github.com/repos/rust-lang/rust-by-example/issues/770","id":231886488,"user":{"login":"talchas","id":3578697,"avatar_url":"https://avatars.githubusercontent.com/u/3578697?v=3","gravatar_id":"","url":"https://api.github.com/users/talchas","html_url":"https://github.com/talchas","followers_url":"https://api.github.com/users/talchas/followers","following_url":"https://api.github.com/users/talchas/following{/other_user}","gists_url":"https://api.github.com/users/talchas/gists{/gist_id}","starred_url":"https://api.github.com/users/talchas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/talchas/subscriptions","organizations_url":"https://api.github.com/users/talchas/orgs","repos_url":"https://api.github.com/users/talchas/repos","events_url":"https://api.github.com/users/talchas/events{/privacy}","received_events_url":"https://api.github.com/users/talchas/received_events","type":"User","site_admin":false},"created_at":"2016-07-11T22:36:15Z","updated_at":"2016-07-11T22:36:15Z","body":"That post explains it well - the closed over variables are captured based on how they are used in the closure, not what trait the closure needs to implement for the surrounding caller (and when the surrounding caller doesn't even exist sufficiently obviously, you don't even get error messages). Now to be fair, I don't believe there are many cases where capture /could/ change based on the Fn* requirement, but https://is.gd/1jBZKQ is one that in theory could have.\r\n\r\nthread::spawn requires FnOnce + 'static, but this does not cause captures to be by value/move whenever possible, you have to explicitly write \"move || ...\". While inference about 'static and about the Fn* impls are different, people get confused initially already."}}
{"actor":{"display_login":"talchas"}}