Skip to content

rustc doesn't complain if extern rlib is missing #68417

Closed
@andir

Description

@andir

I just came across a weird case where rustc would not warn that a given extern dependency could not be found. I believe it should just warn the user or throw an error in that case instead of silently ignoring the error. It seems like the dependencies are only checked on a per-use basis whereas I believe being more strict here would probably not harm and help users find issues earlier.

Reproducer

$ echo 'fn main() {}' > foo.rs
$ rustc foo.rs --extern something=asdlflaksdjfljsaljfdlaskjdf

What happened

It did compile my trivial program without any issues.

Expected output

The compiler should have warned or thrown an error about the missing something dependency. Alternatively warned about an unused dependency that was provided.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-frontendArea: Compiler frontend (errors, parsing and HIR)C-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions