{"action":"opened","issue":{"url":"https://api.github.com/repos/rust-lang/rust/issues/21147","labels_url":"https://api.github.com/repos/rust-lang/rust/issues/21147/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang/rust/issues/21147/comments","events_url":"https://api.github.com/repos/rust-lang/rust/issues/21147/events","html_url":"https://github.com/rust-lang/rust/issues/21147","id":54345231,"number":21147,"title":"`include!` is a smell and should be made obsolete for code-generating cargo packages","user":{"login":"cmr","id":704250,"avatar_url":"https://avatars.githubusercontent.com/u/704250?v=3","gravatar_id":"","url":"https://api.github.com/users/cmr","html_url":"https://github.com/cmr","followers_url":"https://api.github.com/users/cmr/followers","following_url":"https://api.github.com/users/cmr/following{/other_user}","gists_url":"https://api.github.com/users/cmr/gists{/gist_id}","starred_url":"https://api.github.com/users/cmr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmr/subscriptions","organizations_url":"https://api.github.com/users/cmr/orgs","repos_url":"https://api.github.com/users/cmr/repos","events_url":"https://api.github.com/users/cmr/events{/privacy}","received_events_url":"https://api.github.com/users/cmr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-01-14T16:47:00Z","updated_at":"2015-01-14T16:47:00Z","closed_at":null,"body":"In particular, we should somehow allow using `OUT_DIR` in the `#[path]` of a `mod foo`, to allow parsing to proceed normally. Since `include!` doesn't do textual inclusion, but rather AST splicing, and is rather blind, it doesn't pass in the correct context to allow things like outer attributes to work in `include!`'d code, even if it's `mod foo { include!(\"foo.rs\"); }`. It's conservatively correct, but conservatively obnoxious."}}