From c2fb99984c2ed4b54f5b8baff26fcc04af71d032 Mon Sep 17 00:00:00 2001 From: Tomasz Miąsko Date: Fri, 20 Nov 2020 00:00:00 +0000 Subject: Never inline naked functions The `#[naked]` attribute disabled prologue / epilogue emission for the function and it is responsibility of a developer to provide them. The compiler is no position to inline such functions correctly. Disable inlining of naked functions at LLVM and MIR level. --- compiler/rustc_attr/src/builtin.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/rustc_attr/src') diff --git a/compiler/rustc_attr/src/builtin.rs b/compiler/rustc_attr/src/builtin.rs index 2fd625c2a6c..364a3a1eeb5 100644 --- a/compiler/rustc_attr/src/builtin.rs +++ b/compiler/rustc_attr/src/builtin.rs @@ -67,7 +67,7 @@ fn handle_errors(sess: &ParseSess, span: Span, error: AttrError) { } } -#[derive(Clone, PartialEq, Encodable, Decodable)] +#[derive(Copy, Clone, PartialEq, Encodable, Decodable)] pub enum InlineAttr { None, Hint, -- cgit 1.4.1-3-g733a5