Skip to content

Add a warning when enabling LTO for crates with both cargo-types that support LTO and ones that don't. #4611

@Lymia

Description

@Lymia

As discussed in #2301, cargo silently builds a cdylib without LTO when the same crate also has rlib outputs, as rustc would otherwise error.

The only sign this has happened currently is the output binaries being way larger than expected. A warning would be very helpful for this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-crate-typesArea: crate-type declaration (lib, staticlib, dylib, cdylib, etc.)A-ltoArea: link-time optimizationA-new-lintArea: new lintS-needs-mentorStatus: Issue or feature is accepted, but needs a team member to commit to helping and reviewing.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions