File tree 1 file changed +8
-3
lines changed
compiler/rustc_codegen_ssa/src/back
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -2719,10 +2719,15 @@ fn handle_cli_linker_flavors(
2719
2719
// adding an argument to the `cc` invocation to use the `use_ld` given linker.
2720
2720
let use_ld = match & cg. linker_flavor {
2721
2721
Some ( LinkerFlavorCli :: Gcc { use_ld } ) => {
2722
- // Ensure `gcc` is the currently selected flavor. Error out cleanly, as `-Zgcc-ld` does
2723
- // if that happens, but this should be unreachable.
2722
+ // Ensure `gcc` is the currently selected flavor.
2723
+ //
2724
+ // This should be the case as long as this piece of code stays downstream from the CLI
2725
+ // linker-flavor lowering, and the actual `LinkerFlavor` is not changed or overriden by
2726
+ // the time the order-independent options are added to the command args.
2727
+ //
2728
+ // If that changes by mistake (or intentionally) in the future, we panic.
2724
2729
if LinkerFlavor :: Gcc != flavor {
2725
- sess . fatal (
2730
+ bug ! (
2726
2731
"`-Clinker-flavor=gcc:*` flag is used even though the \
2727
2732
linker flavor is not `gcc`",
2728
2733
) ;
You can’t perform that action at this time.
0 commit comments