Skip to content

name resolution and warnings inconsistent #5564

Closed
@metajack

Description

@metajack

When using use foo::{FooTypeA, FooTypeB}; and use foo; together, the compiler complains that use foo; is an unused import even when a call to something like foo::hello() exists. Removing use foo; gets rid of the warning and the crate compiles. However, the crate will fail to link (for example with --test) unless the use foo; is there.

It seems like the warning is a bug unless the intent is to have use foo::{FooTypeA, FooTypeB}; also bring in foo itself.

Here's a small crate that shows the example. This was originally found in rust-core-foundation.

https://gist.github.com/metajack/5249056

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions