]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/missing_inline.rs
Addition `manual_map` test for `unsafe` blocks
[rust.git] / tests / ui / missing_inline.rs
index 5dc473ef09dac1348873f0d5cc81caae22d61366..b73b24b8e0a3b9b50fc6eaaf7b3e68d95168d324 100644 (file)
@@ -1,17 +1,5 @@
-/* This file incorporates work covered by the following copyright and
- * permission notice:
- *   Copyright 2013 The Rust Project Developers. See the COPYRIGHT
- *   file at the top-level directory of this distribution and at
- *   http://rust-lang.org/COPYRIGHT.
- *
- *   Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
- *   http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
- *   <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
- *   option. This file may not be copied, modified, or distributed
- *   except according to those terms.
- */
-#![warn(missing_inline_in_public_items)]
-
+#![warn(clippy::missing_inline_in_public_items)]
+#![crate_type = "dylib"]
 // When denying at the crate level, be sure to not get random warnings from the
 // injected intrinsics by the compiler.
 #![allow(dead_code, non_snake_case)]
@@ -20,7 +8,7 @@
 pub type PubTypedef = String;
 
 struct Foo {} // ok
-pub struct PubFoo { } // ok
+pub struct PubFoo {} // ok
 enum FooE {} // ok
 pub enum PubFooE {} // ok
 
@@ -29,12 +17,13 @@ pub mod pub_module {} // ok
 
 fn foo() {}
 pub fn pub_foo() {} // missing #[inline]
-#[inline] pub fn pub_foo_inline() {} // ok
-#[inline(always)] pub fn pub_foo_inline_always() {} // ok
+#[inline]
+pub fn pub_foo_inline() {} // ok
+#[inline(always)]
+pub fn pub_foo_inline_always() {} // ok
 
-#[allow(missing_inline_in_public_items)]
+#[allow(clippy::missing_inline_in_public_items)]
 pub fn pub_foo_no_inline() {}
-fn main() {}
 
 trait Bar {
     fn Bar_a(); // ok
@@ -44,7 +33,8 @@ fn Bar_b() {} // ok
 pub trait PubBar {
     fn PubBar_a(); // ok
     fn PubBar_b() {} // missing #[inline]
-    #[inline] fn PubBar_c() {} // ok
+    #[inline]
+    fn PubBar_c() {} // ok
 }
 
 // none of these need inline because Foo is not exported
@@ -70,3 +60,7 @@ fn FooImpl() {} // ok
 impl PubFoo {
     pub fn PubFooImpl() {} // missing #[inline]
 }
+
+// do not lint this since users cannot control the external code
+#[derive(Debug)]
+pub struct S {}