{"action":"opened","issue":{"url":"https://api.github.com/repos/alexcrichton/futures-rs/issues/261","repository_url":"https://api.github.com/repos/alexcrichton/futures-rs","labels_url":"https://api.github.com/repos/alexcrichton/futures-rs/issues/261/labels{/name}","comments_url":"https://api.github.com/repos/alexcrichton/futures-rs/issues/261/comments","events_url":"https://api.github.com/repos/alexcrichton/futures-rs/issues/261/events","html_url":"https://github.com/alexcrichton/futures-rs/issues/261","id":191733114,"number":261,"title":"Ergonomics of channel send","user":{"login":"compressed","id":28634,"avatar_url":"https://avatars.githubusercontent.com/u/28634?v=3","gravatar_id":"","url":"https://api.github.com/users/compressed","html_url":"https://github.com/compressed","followers_url":"https://api.github.com/users/compressed/followers","following_url":"https://api.github.com/users/compressed/following{/other_user}","gists_url":"https://api.github.com/users/compressed/gists{/gist_id}","starred_url":"https://api.github.com/users/compressed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/compressed/subscriptions","organizations_url":"https://api.github.com/users/compressed/orgs","repos_url":"https://api.github.com/users/compressed/repos","events_url":"https://api.github.com/users/compressed/events{/privacy}","received_events_url":"https://api.github.com/users/compressed/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-11-25T16:13:53Z","updated_at":"2016-11-25T16:13:53Z","closed_at":null,"body":"Consider this code:\r\n\r\n```rust\r\nuse futures::*;\r\n\r\nfn main() {\r\n    let (mut tx, rx) = futures::sync::mpsc::unbounded();\r\n    tx.send(1);\r\n}\r\n```\r\nYou might think this is actually sending the message on the channel, but it's not because `Sink` has been imported via the glob import so it's calling `Sink::send` not `UnboundedSender::send` (since `UnboundedSender` impls `Sink`).\r\n\r\nWe'd have to use UFCS instead:\r\n\r\n```\r\nfn main() {\r\n    let (mut tx, rx) = futures::sync::mpsc::unbounded();\r\n    UnboundedSender::send(&mut tx, 1).unwrap();\r\n}\r\n```\r\n\r\nI guess the compiler warnings will lead the user to fix the code, but figured I would at least document it here."}}
{"actor":{"display_login":"compressed"}}