Skip to content

libc and test features are special-cased for feature validity checks #53260

Open
@varkor

Description

@varkor

When implementing #52644, where we emit errors when using unknown features, I had to special case two features: libc and test, because they weren't being picked up (and there were time constraints).

The special-casing is here:

// `stdbuild` has special handling for `libc`, so we need to
// recognise the feature when building std.
// Likewise, libtest is handled specially, so `test` isn't
// available as we'd like it to be.
// FIXME: only remove `libc` when `stdbuild` is active.
// FIXME: remove special casing for `test`.
remaining_lib_features.remove(&Symbol::intern("libc"));
remaining_lib_features.remove(&Symbol::intern("test"));

Ideally these should both not be special-cased. The relevant code for feature collection is in src/librustc/middle/lib_features.rs, so that's a good place to start looking.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-cleanupCategory: PRs that clean code up or issues documenting cleanup.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions