Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

include! is a smell and should be made obsolete for code-generating cargo packages #21147

Closed
emberian opened this issue Jan 14, 2015 · 2 comments
Labels
A-parser Area: The parsing of Rust source code to an AST C-enhancement Category: An issue proposing an enhancement or a PR with one. T-lang Relevant to the language team, which will review and decide on the PR/issue.

Comments

@emberian
Copy link
Member

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.

@emberian emberian added A-parser Area: The parsing of Rust source code to an AST C-enhancement Category: An issue proposing an enhancement or a PR with one. labels Jan 14, 2015
@huonw huonw added the T-lang Relevant to the language team, which will review and decide on the PR/issue. label Nov 18, 2015
@huonw
Copy link
Member

huonw commented Nov 18, 2015

This is related to/might be fixed by #18849 (in fact, it is the motivating example in that issue). Also, cc rust-lang/rfcs#752.

@alexcrichton, you may have thoughts about this, especially experience with cargo, and what cargo needs.

@steveklabnik
Copy link
Member

Triage: regardless of its smelliness, today it's in stable, so it has to stay.

Given the lack of other discussion, I'm going to close this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-parser Area: The parsing of Rust source code to an AST C-enhancement Category: An issue proposing an enhancement or a PR with one. T-lang Relevant to the language team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants