diff options
| author | Maybe Waffle <waffle.lapkin@gmail.com> | 2023-02-15 11:43:41 +0000 |
|---|---|---|
| committer | Maybe Waffle <waffle.lapkin@gmail.com> | 2023-02-16 15:26:00 +0000 |
| commit | 8751fa1a9abda9fc7ced6b03315efbd82310830d (patch) | |
| tree | f15613d5ca2fa5aadfdde2df1d94907d1798a5bb /compiler/rustc_symbol_mangling/src | |
| parent | af3c8b27266e290cf65704284f6862d0f90ee4fc (diff) | |
| download | rust-8751fa1a9abda9fc7ced6b03315efbd82310830d.tar.gz rust-8751fa1a9abda9fc7ced6b03315efbd82310830d.zip | |
`if $c:expr { Some($r:expr) } else { None }` =>> `$c.then(|| $r)`
Diffstat (limited to 'compiler/rustc_symbol_mangling/src')
| -rw-r--r-- | compiler/rustc_symbol_mangling/src/lib.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/compiler/rustc_symbol_mangling/src/lib.rs b/compiler/rustc_symbol_mangling/src/lib.rs index 547a5907660..d81722e59a6 100644 --- a/compiler/rustc_symbol_mangling/src/lib.rs +++ b/compiler/rustc_symbol_mangling/src/lib.rs @@ -244,8 +244,7 @@ fn compute_symbol_name<'tcx>( // project. let avoid_cross_crate_conflicts = is_generic(substs) || is_globally_shared_function; - let instantiating_crate = - if avoid_cross_crate_conflicts { Some(compute_instantiating_crate()) } else { None }; + let instantiating_crate = avoid_cross_crate_conflicts.then(compute_instantiating_crate); // Pick the crate responsible for the symbol mangling version, which has to: // 1. be stable for each instance, whether it's being defined or imported |
