Repository: rust
Issue: Compiler panics with "features": "16bit-mode" on JSON target file
Labels: I-ICE,T-compiler,C-bug,requires-nightly

<!--
Thank you for finding an Internal Compiler Error! 🧊  If possible, try to provide
a minimal verifiable example. You can read "Rust Bug Minimization Patterns" for
how to create smaller examples.

http://blog.pnkfx.org/blog/2019/11/18/rust-bug-minimization-patterns/

-->

The issue comes from **"features": "16bit-mode"**

### Code

**.cargo/config.toml**
```
[unstable]
build-std = ["core", "compiler_builtins", "alloc"]

[build]
target = "i586-rust_dos.json"
rustflags = ["-C", "link-arg=-Tlink.x"]
```

**i586-rust_dos.json**
```
{
    "arch": "x86",
    "cpu": "pentium",
    "data-layout": "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128",
    "dynamic-linking": false,
    "executables": true,
    "has-rpath": true,
    "is-builtin": false,
    "linker-flavor": "ld.lld",
    "linker": "rust-lld",
    "llvm-target": "i586-unknown-none-code16",
    "max-atomic-width": 64,
    "os": "none",
    "relocation-model": "static",
    "position-independent-executables": false,
    "relro-level": "off",
    "target-c-int-width": "32",
    "target-endian": "little",
    "target-pointer-width": "32",
    "vendor": "unknown",
    "panic-strategy": "abort",
    "disable-redzone": true,
    "features": "16bit-mode"
}
```


### Meta
<!--
If you're using the stable version of the compiler, you should also check if the
bug also exists in the beta or nightly versions.
-->

`rustc --version --verbose`:
```
rustc 1.62.0-nightly (306ba8357 2022-04-05)
binary: rustc
commit-hash: 306ba8357fb36212b7d30efb9eb9e41659ac1445
commit-date: 2022-04-05
host: x86_64-pc-windows-msvc
release: 1.62.0-nightly
LLVM version: 14.0.0
```

### Error output

```
error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `rustc - --crate-name ___ --print=file-names -C link-arg=-Tlink.x --target \\?\C:\Users\Thomas\Documents\programmation\rust\rust_dos\i586-rust_dos.json --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg` (exit code: 101)
  --- stderr
  thread 'rustc' panicked at 'compiler\rustc_codegen_llvm\src\llvm_util.rs:526:9: target feature `16bit-mode` must begin with a `+` or `-`', compiler\rustc_middle\src\util\bug.rs:36:26
  stack backtrace:
  note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

  error: internal compiler error: unexpected panic

  note: the compiler unexpectedly panicked. this is a bug.

  note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

  note: rustc 1.62.0-nightly (306ba8357 2022-04-05) running on x86_64-pc-windows-msvc

  note: compiler flags: -C link-arg=-Tlink.x --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro

  query stack during panic:
  end of query stack
error: `cargo metadata` exited with an error: error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `rustc - --crate-name ___ --print=file-names -C link-arg=-Tlink.x --target \\?\C:\Users\Thomas\Documents\programmation\rust\rust_dos\i586-rust_dos.json --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg` (exit code: 101)
  --- stderr
  thread 'rustc' panicked at 'compiler\rustc_codegen_llvm\src\llvm_util.rs:526:9: target feature `16bit-mode` must begin with a `+` or `-`', compiler\rustc_middle\src\util\bug.rs:36:26
  stack backtrace:
  note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

  error: internal compiler error: unexpected panic

  note: the compiler unexpectedly panicked. this is a bug.

  note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

  note: rustc 1.62.0-nightly (306ba8357 2022-04-05) running on x86_64-pc-windows-msvc

  note: compiler flags: -C link-arg=-Tlink.x --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro

  query stack during panic:
  end of query stack

Process finished with exit code 101

```

<!--
Include a backtrace in the code block by setting `RUST_BACKTRACE=1` in your
environment. E.g. `RUST_BACKTRACE=1 cargo build`.
-->
<details><summary><strong>Backtrace</strong></summary>
<p>

```
<backtrace>
```

</p>
</details>

I'm not able to share the backtrace because **cargo build --release** omits the _RUST_BACKTRACE_ env variable.