Skip to content

Commit 35b935a

Browse files
committed
Oh yeah, tidy
1 parent 24ca89b commit 35b935a

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

compiler/rustc_codegen_llvm/src/attributes.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ fn inline_attr<'ll>(cx: &CodegenCx<'ll, '_>, inline: InlineAttr) -> Option<&'ll
5252
return Some(AttributeKind::NoInline.create_attr(cx.llcx));
5353
}
5454
match inline {
55-
InlineAttr::Hint | InlineAttr::Early => Some(AttributeKind::InlineHint.create_attr(cx.llcx)),
55+
InlineAttr::Hint | InlineAttr::Early => {
56+
Some(AttributeKind::InlineHint.create_attr(cx.llcx))
57+
}
5658
InlineAttr::Always | InlineAttr::Force { .. } => {
5759
Some(AttributeKind::AlwaysInline.create_attr(cx.llcx))
5860
}

compiler/rustc_mir_transform/src/cross_crate_inline.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ fn cross_crate_inlinable(tcx: TyCtxt<'_>, def_id: LocalDefId) -> bool {
4646
// #[inline(never)] to force code generation.
4747
match codegen_fn_attrs.inline {
4848
InlineAttr::Never => return false,
49-
InlineAttr::Hint | InlineAttr::Always | InlineAttr::Early | InlineAttr::Force { .. } => return true,
49+
InlineAttr::Hint | InlineAttr::Always | InlineAttr::Early | InlineAttr::Force { .. } => {
50+
return true;
51+
}
5052
InlineAttr::None => {}
5153
}
5254

compiler/rustc_mir_transform/src/inline.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,8 @@ impl<'tcx> Inliner<'tcx> for ForceInliner<'tcx> {
193193

194194
fn should_inline_for_callee(&self, instance_kind: &InstanceKind<'tcx>) -> bool {
195195
if let InstanceKind::Item(def_id) = instance_kind
196-
&& let InlineAttr::Force { .. } | InlineAttr::Early = self.tcx().codegen_fn_attrs(def_id).inline
196+
&& let InlineAttr::Force { .. } | InlineAttr::Early =
197+
self.tcx().codegen_fn_attrs(def_id).inline
197198
{
198199
true
199200
} else {
@@ -272,7 +273,8 @@ impl<'tcx> Inliner<'tcx> for ForceInliner<'tcx> {
272273
callee_span: tcx.def_span(callsite.callee.def_id()),
273274
callee: tcx.def_path_str(callsite.callee.def_id()),
274275
reason,
275-
justification: justification.map(|sym| crate::errors::ForceInlineJustification { sym }),
276+
justification: justification
277+
.map(|sym| crate::errors::ForceInlineJustification { sym }),
276278
});
277279
}
278280
_ => bug!("called on item without required inlining"),

0 commit comments

Comments
 (0)