rustc_target: Further simplify loading of built-in targets

using the fact that it is infallible.

JSON roundtrip check on every rustc run is also removed, it's already performed by unit tests.
This commit is contained in:
Vadim Petrochenkov 2020-10-05 16:24:04 +03:00
parent 021fcbd90c
commit 1444ad7ba1
2 changed files with 14 additions and 38 deletions

View file

@ -672,7 +672,8 @@ impl RustcDefaultCalls {
for req in &sess.opts.prints {
match *req {
TargetList => {
let mut targets = rustc_target::spec::get_targets().collect::<Vec<String>>();
let mut targets =
rustc_target::spec::TARGETS.iter().copied().collect::<Vec<_>>();
targets.sort();
println!("{}", targets.join("\n"));
}