We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e65665f commit cd69787Copy full SHA for cd69787
compiler/rustc_mir_transform/src/inline.rs
@@ -357,7 +357,13 @@ impl<'tcx> Inliner<'tcx> {
357
) -> Result<(), &'static str> {
358
match callee_attrs.inline {
359
InlineAttr::Never => return Err("never inline hint"),
360
- InlineAttr::Always => {}
+ InlineAttr::Always => {
361
+ if self.tcx.sess.mir_opt_level() == 1 && callsite.callee.def_id().is_local() {
362
+ return Err("local function and mir_opt_level() == 1");
363
+ } else {
364
+ // Proceed
365
+ }
366
367
_ => {
368
if self.tcx.sess.mir_opt_level() == 1 {
369
return Err("No inline(always) and mir_opt_level() == 1");
0 commit comments