Skip to content

target json file contains unused fields unaffected by -Dwarnings #91262

Open
@ojeda

Description

@ojeda

I tried this:

# t.json is a target spec file with an unknown field
$ cat t.json | grep foo
  "foo": "bar",
$ rustc -Dwarnings --target=t.json < /dev/null

I expected to see this happen: the warning: target json file contains unused fields: foo diagnostic to be an error.

Instead, this happened: the warning is still a warning, even with -Dwarnings.

If this is intended (i.e. if -Dwarnings is only intended for code-related diagnostics), then this issue would be a feature request: a way to control whether non-code warnings are (or not) errors for CI purposes.

Meta

Happens in both stable (1.56.1) and the latest nightly:

rustc 1.58.0-nightly (dd549dcab 2021-11-25)
binary: rustc
commit-hash: dd549dcab404ec4c7d07b5a83aca5bdd7171138f
commit-date: 2021-11-25
host: x86_64-unknown-linux-gnu
release: 1.58.0-nightly
LLVM version: 13.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.needs-fcpThis change is insta-stable, so needs a completed FCP to proceed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions