You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Move attributes from crate source into Cargo.toml where appropriate #41701
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.
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.
Activity
daniellockyer commentedon May 2, 2017
If this is correct, I'd like to take this.
alexcrichton commentedon May 2, 2017
Sounds good to me! I think that because Cargo unconditionally passes
--crate-typeand--crate-namethat 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 commentedon May 8, 2017
isn't this issue closed now?
Mark-Simulacrum commentedon May 8, 2017
Oh, wait, not the pull request is still open.
Auto merge of #43994 - tamird:remove-attributes, r=alexcrichton