We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
#[inline(always)]
1 parent 796cafe commit e65665fCopy full SHA for e65665f
compiler/rustc_mir_transform/src/inline.rs
@@ -355,8 +355,16 @@ impl<'tcx> Inliner<'tcx> {
355
callsite: &CallSite<'tcx>,
356
callee_attrs: &CodegenFnAttrs,
357
) -> Result<(), &'static str> {
358
- if let InlineAttr::Never = callee_attrs.inline {
359
- return Err("never inline hint");
+ match callee_attrs.inline {
+ InlineAttr::Never => return Err("never inline hint"),
360
+ InlineAttr::Always => {}
361
+ _ => {
362
+ if self.tcx.sess.mir_opt_level() == 1 {
363
+ return Err("No inline(always) and mir_opt_level() == 1");
364
+ } else {
365
+ // Proceed
366
+ }
367
368
}
369
370
// Only inline local functions if they would be eligible for cross-crate
0 commit comments