{"action":"opened","issue":{"url":"https://api.github.com/repos/rust-lang/cargo/issues/2642","repository_url":"https://api.github.com/repos/rust-lang/cargo","labels_url":"https://api.github.com/repos/rust-lang/cargo/issues/2642/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/cargo/issues/2642/comments","events_url":"https://api.github.com/repos/rust-lang/cargo/issues/2642/events","html_url":"https://github.com/rust-lang/cargo/issues/2642","id":152964232,"number":2642,"title":"Allow `cargo rustc -- ...` for crates with both libs and binaries without needing to \"filter\"","user":{"login":"azerupi","id":7647338,"avatar_url":"https://avatars.githubusercontent.com/u/7647338?v=3","gravatar_id":"","url":"https://api.github.com/users/azerupi","html_url":"https://github.com/azerupi","followers_url":"https://api.github.com/users/azerupi/followers","following_url":"https://api.github.com/users/azerupi/following{/other_user}","gists_url":"https://api.github.com/users/azerupi/gists{/gist_id}","starred_url":"https://api.github.com/users/azerupi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azerupi/subscriptions","organizations_url":"https://api.github.com/users/azerupi/orgs","repos_url":"https://api.github.com/users/azerupi/repos","events_url":"https://api.github.com/users/azerupi/events{/privacy}","received_events_url":"https://api.github.com/users/azerupi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-05-04T09:04:53Z","updated_at":"2016-05-04T09:04:53Z","closed_at":null,"body":"At the moment you can't run cargo with specific rustc arguments, like `cargo rustc -- -Z no-trans` on a crate that contains both a library and a binary. Cargo responds that you should filter the target by using `--lib` or `--bin`\r\n\r\n```\r\nextra arguments to rustc can only be passed to one target, consider filtering\r\nthe package by passing e.g. --lib or --bin NAME to specify a single target\r\n```\r\n\r\nWhy does this limitation exist? \r\n\r\nWhen creating binary crates I often tend to write the core logic in a library in the same crate. This limitation prevents me from running [`cargo-check`](https://github.com/rsolomo/cargo-check) on my crates using the linter-rust plugin in Atom for example.\r\n\r\nA better way to handle this is would be to have the same behavior as `cargo build`"}}