Add #[rustc_no_mir_inline]
for standard library UB checks
Co-authored-by: Ben Kimock <kimockb@gmail.com>
This commit is contained in:
parent
933a05bd0b
commit
81d7069e34
9 changed files with 107 additions and 3 deletions
|
@ -421,6 +421,10 @@ impl<'tcx> Inliner<'tcx> {
|
|||
callee_attrs: &CodegenFnAttrs,
|
||||
cross_crate_inlinable: bool,
|
||||
) -> Result<(), &'static str> {
|
||||
if self.tcx.has_attr(callsite.callee.def_id(), sym::rustc_no_mir_inline) {
|
||||
return Err("#[rustc_no_mir_inline]");
|
||||
}
|
||||
|
||||
if let InlineAttr::Never = callee_attrs.inline {
|
||||
return Err("never inline hint");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue