Skip to content

unstable_features does absolutely nothing #5169

Open
@ickk

Description

@ickk

rustfmt 1.4.37-stable (59eed8a2 2021-11-01)

Given a rustfmt.toml that looks like

unstable_features = <val>
imports_layout = "Vertical" # Some unstable feature

Files are formatted according to the following table

+stable +nightly
unstable_features = true ignores unstable features uses unstable features
unstable_features = false ignores unstable features uses unstable features

So the value of unstable_features does absolutely nothing except cause rustfmt to emit one of the following warnings when using a stable toochain

Warning: can't set `unstable_features = true`, unstable features are only available in nightly channel.
Warning: can't set `unstable_features = false`, unstable features are only available in nightly channel.

which is ridiculous.

Either this key should allow you to enable unstable formatting settings for stable toolchains, or it should allow you to disable unstable formatting settings for nightly toolchains. Preferably both. It currently has no effect at all.

There is a bug here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions