diff options
| author | bors <bors@rust-lang.org> | 2024-07-11 17:10:09 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-07-11 17:10:09 +0000 |
| commit | a3d6efc9bcdc379e766735cc53e065d85a1755e9 (patch) | |
| tree | 24923a8226aad3064a6c5739540c2d404d64f76e /compiler/rustc_codegen_llvm/src/lib.rs | |
| parent | 45609a995e766d614da694d353f7aee03820b0f9 (diff) | |
| parent | 62bbce2ad2b20d5cf1282da407d01de5c54161f1 (diff) | |
| download | rust-a3d6efc9bcdc379e766735cc53e065d85a1755e9.tar.gz rust-a3d6efc9bcdc379e766735cc53e065d85a1755e9.zip | |
Auto merge of #17581 - lnicola:sync-from-rust, r=lnicola
minor: Sync from rust
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/lib.rs')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/lib.rs | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/compiler/rustc_codegen_llvm/src/lib.rs b/compiler/rustc_codegen_llvm/src/lib.rs index 4b7a2643007..ed0989a0ba4 100644 --- a/compiler/rustc_codegen_llvm/src/lib.rs +++ b/compiler/rustc_codegen_llvm/src/lib.rs @@ -274,10 +274,11 @@ impl CodegenBackend for LlvmCodegenBackend { |tcx, ()| llvm_util::global_llvm_features(tcx.sess, true) } - fn print(&self, req: &PrintRequest, out: &mut dyn PrintBackendInfo, sess: &Session) { + fn print(&self, req: &PrintRequest, out: &mut String, sess: &Session) { + use std::fmt::Write; match req.kind { PrintKind::RelocationModels => { - writeln!(out, "Available relocation models:"); + writeln!(out, "Available relocation models:").unwrap(); for name in &[ "static", "pic", @@ -288,25 +289,25 @@ impl CodegenBackend for LlvmCodegenBackend { "ropi-rwpi", "default", ] { - writeln!(out, " {name}"); + writeln!(out, " {name}").unwrap(); } - writeln!(out); + writeln!(out).unwrap(); } PrintKind::CodeModels => { - writeln!(out, "Available code models:"); + writeln!(out, "Available code models:").unwrap(); for name in &["tiny", "small", "kernel", "medium", "large"] { - writeln!(out, " {name}"); + writeln!(out, " {name}").unwrap(); } - writeln!(out); + writeln!(out).unwrap(); } PrintKind::TlsModels => { - writeln!(out, "Available TLS models:"); + writeln!(out, "Available TLS models:").unwrap(); for name in &["global-dynamic", "local-dynamic", "initial-exec", "local-exec", "emulated"] { - writeln!(out, " {name}"); + writeln!(out, " {name}").unwrap(); } - writeln!(out); + writeln!(out).unwrap(); } PrintKind::StackProtectorStrategies => { writeln!( @@ -332,7 +333,8 @@ impl CodegenBackend for LlvmCodegenBackend { none Do not generate stack canaries. "# - ); + ) + .unwrap(); } _other => llvm_util::print(req, out, sess), } |
