Skip to content

Commit 04af371

Browse files
committed
Also sort crt-static in --print target-features output
I didn't find `crt-static` at first (for `x86_64-unknown-linux-gnu`), because it was put at the bottom the large and otherwise sorted list. Fully sort the list before we print it. Note that `llvm_target_features` starts out sorted and does not need to be sorted an extra time.
1 parent 7ac6c2f commit 04af371

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

compiler/rustc_codegen_llvm/src/llvm_util.rs

+5
Original file line numberDiff line numberDiff line change
@@ -394,10 +394,15 @@ fn print_target_features(out: &mut dyn PrintBackendInfo, sess: &Session, tm: &ll
394394
(*feature, desc)
395395
})
396396
.collect::<Vec<_>>();
397+
398+
// Since we add this at the end ...
397399
rustc_target_features.extend_from_slice(&[(
398400
"crt-static",
399401
"Enables C Run-time Libraries to be statically linked",
400402
)]);
403+
// ... we need to sort the list again.
404+
rustc_target_features.sort();
405+
401406
llvm_target_features.retain(|(f, _d)| !known_llvm_target_features.contains(f));
402407

403408
let max_feature_len = llvm_target_features

0 commit comments

Comments
 (0)