Skip to content

Commit 842da5c

Browse files
committed
structure the message
1 parent 5c2a322 commit 842da5c

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

Diff for: compiler/rustc_session/src/config.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -1423,10 +1423,12 @@ pub fn build_target_config(
14231423
}
14241424
target
14251425
}
1426-
Err(e) => early_dcx.early_fatal(format!(
1427-
"error loading target specification: {e}; \
1428-
run `rustc --print target-list` for a list of built-in targets"
1429-
)),
1426+
Err(e) => {
1427+
let mut err =
1428+
early_dcx.early_struct_fatal(format!("error loading target specification: {e}"));
1429+
err.help("run `rustc --print target-list` for a list of built-in targets");
1430+
err.emit();
1431+
}
14301432
}
14311433
}
14321434

Diff for: tests/ui/errors/wrong-target-spec.stderr

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
error: error loading target specification: could not find specification for target "x86_64_unknown-linux-musl"; run `rustc --print target-list` for a list of built-in targets
1+
error: error loading target specification: could not find specification for target "x86_64_unknown-linux-musl"
2+
|
3+
= help: run `rustc --print target-list` for a list of built-in targets
24

0 commit comments

Comments
 (0)