Skip to content

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

Closed
@hanna-kruppe

Description

@hanna-kruppe

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-cleanupCategory: PRs that clean code up or issues documenting cleanup.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions