diff options
| author | Tobias Bucher <tobiasbucher5991@gmail.com> | 2024-05-23 08:09:52 +0200 |
|---|---|---|
| committer | Tobias Bucher <tobiasbucher5991@gmail.com> | 2024-05-23 08:09:52 +0200 |
| commit | 3ac1a804d12a9896e1616f4e187c3f2710f42d24 (patch) | |
| tree | 04e8766599f6a488ef0e1c4796f5e817ed61238b /compiler/rustc_codegen_ssa/src | |
| parent | f0038a7c8fd8b5b8a949c92ae6419bcb59a09e72 (diff) | |
| download | rust-3ac1a804d12a9896e1616f4e187c3f2710f42d24.tar.gz rust-3ac1a804d12a9896e1616f4e187c3f2710f42d24.zip | |
Remove unneeded string conversion
Diffstat (limited to 'compiler/rustc_codegen_ssa/src')
| -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 37b8f81ad94..93fb23c4874 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); } } @@ -804,7 +804,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!( @@ -843,7 +843,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) { |
