1 /* This file incorporates work covered by the following copyright and
3 * Copyright 2013 The Rust Project Developers. See the COPYRIGHT
4 * file at the top-level directory of this distribution and at
5 * http://rust-lang.org/COPYRIGHT.
7 * Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
8 * http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
9 * <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
10 * option. This file may not be copied, modified, or distributed
11 * except according to those terms.
13 #![warn(missing_inline_in_public_items)]
15 // When denying at the crate level, be sure to not get random warnings from the
16 // injected intrinsics by the compiler.
17 #![allow(dead_code, non_snake_case)]
19 type Typedef = String;
20 pub type PubTypedef = String;
23 pub struct PubFoo { } // ok
25 pub enum PubFooE {} // ok
28 pub mod pub_module {} // ok
31 pub fn pub_foo() {} // missing #[inline]
32 #[inline] pub fn pub_foo_inline() {} // ok
33 #[inline(always)] pub fn pub_foo_inline_always() {} // ok
35 #[allow(missing_inline_in_public_items)]
36 pub fn pub_foo_no_inline() {}
46 fn PubBar_b() {} // missing #[inline]
47 #[inline] fn PubBar_c() {} // ok
50 // none of these need inline because Foo is not exported
52 fn PubBar_a() {} // ok
53 fn PubBar_b() {} // ok
54 fn PubBar_c() {} // ok
57 // all of these need inline because PubFoo is exported
58 impl PubBar for PubFoo {
59 fn PubBar_a() {} // missing #[inline]
60 fn PubBar_b() {} // missing #[inline]
61 fn PubBar_c() {} // missing #[inline]
64 // do not need inline because Foo is not exported
69 // need inline because PubFoo is exported
71 pub fn PubFooImpl() {} // missing #[inline]