Allow inlining #[inline] functions.

This commit is contained in:
Camille GILLOT 2021-12-13 18:03:22 +01:00
parent d1d9092e3c
commit 6bb549f0d1
8 changed files with 36 additions and 47 deletions

View file

@ -332,10 +332,10 @@ impl<'tcx> Inliner<'tcx> {
) -> Result<(), &'static str> {
match callee_attrs.inline {
InlineAttr::Never => return Err("never inline hint"),
InlineAttr::Always => {}
_ => {
InlineAttr::Always | InlineAttr::Hint => {}
InlineAttr::None => {
if self.tcx.sess.mir_opt_level() <= 2 {
return Err("at mir-opt-level=2, only #[inline(always)] is inlined");
return Err("at mir-opt-level=2, only #[inline] is inlined");
}
}
}