diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2025-02-12 10:46:40 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-12 10:46:40 +0100 |
| commit | 30bd1b53b3d5354fffc25d50fa2ab131f4875c4e (patch) | |
| tree | 4dd2da6a1d640466cd6cb9101bd56b1da7b0deed /compiler/rustc_mir_transform/src | |
| parent | 9fa2557d8eb8a78c5399f66bd4827468661fc235 (diff) | |
| parent | 32fd1a7b7205d1f8ccf168c22dada83ea38e3adb (diff) | |
| download | rust-30bd1b53b3d5354fffc25d50fa2ab131f4875c4e.tar.gz rust-30bd1b53b3d5354fffc25d50fa2ab131f4875c4e.zip | |
Rollup merge of #136900 - workingjubilee:format-externabi-directly, r=oli-obk
compiler: replace `ExternAbi::name` calls with formatters Most of these just format the ABI string, so... just format ExternAbi? This makes it more consistent and less jank when we can do it.
Diffstat (limited to 'compiler/rustc_mir_transform/src')
| -rw-r--r-- | compiler/rustc_mir_transform/src/function_item_references.rs | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/compiler/rustc_mir_transform/src/function_item_references.rs b/compiler/rustc_mir_transform/src/function_item_references.rs index 7e88925b2e1..73e47bb79f0 100644 --- a/compiler/rustc_mir_transform/src/function_item_references.rs +++ b/compiler/rustc_mir_transform/src/function_item_references.rs @@ -161,12 +161,7 @@ impl<'tcx> FunctionItemRefChecker<'_, 'tcx> { let unsafety = fn_sig.safety().prefix_str(); let abi = match fn_sig.abi() { ExternAbi::Rust => String::from(""), - other_abi => { - let mut s = String::from("extern \""); - s.push_str(other_abi.name()); - s.push_str("\" "); - s - } + other_abi => format!("extern {other_abi} "), }; let ident = self.tcx.item_ident(fn_id); let ty_params = fn_args.types().map(|ty| format!("{ty}")); |
