diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-05-23 14:09:26 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-23 14:09:26 +0200 |
| commit | cf92f4c52f6160b90bf119b59d89c20dd107378c (patch) | |
| tree | 52b83635b29ced282013c7e8aa1088e57dab397e /compiler | |
| parent | eb1b9b0048799863e950f8621eb50faae994475c (diff) | |
| parent | 3ac1a804d12a9896e1616f4e187c3f2710f42d24 (diff) | |
| download | rust-cf92f4c52f6160b90bf119b59d89c20dd107378c.tar.gz rust-cf92f4c52f6160b90bf119b59d89c20dd107378c.zip | |
Rollup merge of #125438 - tbu-:pr_rm_to_string_lossy, r=jieyouxu
Remove unneeded string conversion
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/back/link.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs index c973bda1ef1..17e54ec402e 100644 --- a/compiler/rustc_codegen_ssa/src/back/link.rs +++ b/compiler/rustc_codegen_ssa/src/back/link.rs @@ -786,12 +786,12 @@ fn link_natively( if matches!(flavor, LinkerFlavor::Gnu(Cc::Yes, _)) && unknown_arg_regex.is_match(&out) && out.contains("-no-pie") - && cmd.get_args().iter().any(|e| e.to_string_lossy() == "-no-pie") + && cmd.get_args().iter().any(|e| e == "-no-pie") { info!("linker output: {:?}", out); warn!("Linker does not support -no-pie command line option. Retrying without."); for arg in cmd.take_args() { - if arg.to_string_lossy() != "-no-pie" { + if arg != "-no-pie" { cmd.arg(arg); } } @@ -825,7 +825,7 @@ fn link_natively( if matches!(flavor, LinkerFlavor::Gnu(Cc::Yes, _)) && unknown_arg_regex.is_match(&out) && (out.contains("-static-pie") || out.contains("--no-dynamic-linker")) - && cmd.get_args().iter().any(|e| e.to_string_lossy() == "-static-pie") + && cmd.get_args().iter().any(|e| e == "-static-pie") { info!("linker output: {:?}", out); warn!( @@ -864,7 +864,7 @@ fn link_natively( assert!(pre_objects_static.is_empty() || !pre_objects_static_pie.is_empty()); assert!(post_objects_static.is_empty() || !post_objects_static_pie.is_empty()); for arg in cmd.take_args() { - if arg.to_string_lossy() == "-static-pie" { + if arg == "-static-pie" { // Replace the output kind. cmd.arg("-static"); } else if pre_objects_static_pie.contains(&arg) { |
