Skip to content

Move attributes from crate source into Cargo.toml where appropriate #41701

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

Closed
hanna-kruppe opened this issue May 2, 2017 · 4 comments
Closed
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@hanna-kruppe
Copy link
Contributor

hanna-kruppe commented May 2, 2017

The compiler and std crates in-tree have a few attributes in their source code (lib.rs) that are conventionally set in the Cargo.toml file. I'd say this just wasn't cleaned up when rustbuild became the only build system, and should be cleaned up.

Possibly incomplete list of such attributes:

  • #![crate_name]
  • #![crate_type]

Note that some crates have different crate types in between Cargo.toml than in lib.rs (e.g., compiler crates seem to have only dylib in Cargo.toml, dylib and rlib in the source code). I'm not sure which one takes precedence, but my build directory seems to contain only dylibs and not rlibs for those crates, so I assume the Cargo.toml wins.

cc @alexcrichton -- is the above correct?

@eddyb eddyb added E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. C-cleanup Category: PRs that clean code up or issues documenting cleanup. labels May 2, 2017
@daniellockyer
Copy link
Contributor

If this is correct, I'd like to take this.

@alexcrichton
Copy link
Member

Sounds good to me! I think that because Cargo unconditionally passes --crate-type and --crate-name that all the annotations in the source can just be deleted, they should all already be in as much sync as they need to be.

@divagant-martian
Copy link

isn't this issue closed now?

@Mark-Simulacrum
Copy link
Member

Oh, wait, not the pull request is still open.

tamird added a commit to tamird/rust that referenced this issue Aug 25, 2017
bors added a commit that referenced this issue Aug 25, 2017
*: remove crate_{name,type} attributes

Fixes #41701.

r? @arielb1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

No branches or pull requests

6 participants