if $c:expr { Some($r:expr) } else { None }
=>> $c.then(|| $r)
This commit is contained in:
parent
af3c8b2726
commit
8751fa1a9a
54 changed files with 159 additions and 281 deletions
|
@ -584,7 +584,7 @@ impl<'tcx> Instance<'tcx> {
|
|||
/// this function returns `None`, then the MIR body does not require substitution during
|
||||
/// codegen.
|
||||
fn substs_for_mir_body(&self) -> Option<SubstsRef<'tcx>> {
|
||||
if self.def.has_polymorphic_mir_body() { Some(self.substs) } else { None }
|
||||
self.def.has_polymorphic_mir_body().then(|| self.substs)
|
||||
}
|
||||
|
||||
pub fn subst_mir<T>(&self, tcx: TyCtxt<'tcx>, v: &T) -> T
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue