clean tests/ui/functions.rs
Cleaning the empty lines for clarity.
This commit is contained in:
parent
df5d12a3ec
commit
2389f9e94c
@ -9,7 +9,6 @@
|
||||
fn good(_one: u32, _two: u32, _three: &str, _four: bool, _five: f32, _six: f32, _seven: bool) {}
|
||||
|
||||
fn bad(_one: u32, _two: u32, _three: &str, _four: bool, _five: f32, _six: f32, _seven: bool, _eight: ()) {
|
||||
|
||||
}
|
||||
|
||||
// don't lint extern fns
|
||||
@ -19,7 +18,6 @@ pub trait Foo {
|
||||
fn good(_one: u32, _two: u32, _three: &str, _four: bool, _five: f32, _six: f32, _seven: bool);
|
||||
fn bad(_one: u32, _two: u32, _three: &str, _four: bool, _five: f32, _six: f32, _seven: bool, _eight: ());
|
||||
|
||||
|
||||
fn ptr(p: *const u8);
|
||||
}
|
||||
|
||||
@ -28,7 +26,6 @@ pub struct Bar;
|
||||
impl Bar {
|
||||
fn good_method(_one: u32, _two: u32, _three: &str, _four: bool, _five: f32, _six: f32, _seven: bool) {}
|
||||
fn bad_method(_one: u32, _two: u32, _three: &str, _four: bool, _five: f32, _six: f32, _seven: bool, _eight: ()) {}
|
||||
|
||||
}
|
||||
|
||||
// ok, we don’t want to warn implementations
|
||||
@ -38,11 +35,8 @@ impl Foo for Bar {
|
||||
|
||||
fn ptr(p: *const u8) {
|
||||
println!("{}", unsafe { *p });
|
||||
|
||||
println!("{:?}", unsafe { p.as_ref() });
|
||||
|
||||
unsafe { std::ptr::read(p) };
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -54,11 +48,8 @@ fn private(p: *const u8) {
|
||||
|
||||
pub fn public(p: *const u8) {
|
||||
println!("{}", unsafe { *p });
|
||||
|
||||
println!("{:?}", unsafe { p.as_ref() });
|
||||
|
||||
unsafe { std::ptr::read(p) };
|
||||
|
||||
}
|
||||
|
||||
impl Bar {
|
||||
@ -68,11 +59,8 @@ impl Bar {
|
||||
|
||||
pub fn public(self, p: *const u8) {
|
||||
println!("{}", unsafe { *p });
|
||||
|
||||
println!("{:?}", unsafe { p.as_ref() });
|
||||
|
||||
unsafe { std::ptr::read(p) };
|
||||
|
||||
}
|
||||
|
||||
pub fn public_ok(self, p: *const u8) {
|
||||
|
@ -2,8 +2,7 @@ error: this function has too many arguments (8/7)
|
||||
--> $DIR/functions.rs:11:1
|
||||
|
|
||||
11 | / fn bad(_one: u32, _two: u32, _three: &str, _four: bool, _five: f32, _six: f32, _seven: bool, _eight: ()) {
|
||||
12 | |
|
||||
13 | | }
|
||||
12 | | }
|
||||
| |_^
|
||||
|
|
||||
= note: #[deny(too_many_arguments)] implied by #[deny(clippy)]
|
||||
@ -14,25 +13,25 @@ note: lint level defined here
|
||||
| ^^^^^^
|
||||
|
||||
error: this function has too many arguments (8/7)
|
||||
--> $DIR/functions.rs:20:5
|
||||
--> $DIR/functions.rs:19:5
|
||||
|
|
||||
20 | fn bad(_one: u32, _two: u32, _three: &str, _four: bool, _five: f32, _six: f32, _seven: bool, _eight: ());
|
||||
19 | fn bad(_one: u32, _two: u32, _three: &str, _four: bool, _five: f32, _six: f32, _seven: bool, _eight: ());
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: #[deny(too_many_arguments)] implied by #[deny(clippy)]
|
||||
|
||||
error: this function has too many arguments (8/7)
|
||||
--> $DIR/functions.rs:30:5
|
||||
--> $DIR/functions.rs:28:5
|
||||
|
|
||||
30 | fn bad_method(_one: u32, _two: u32, _three: &str, _four: bool, _five: f32, _six: f32, _seven: bool, _eight: ()) {}
|
||||
28 | fn bad_method(_one: u32, _two: u32, _three: &str, _four: bool, _five: f32, _six: f32, _seven: bool, _eight: ()) {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: #[deny(too_many_arguments)] implied by #[deny(clippy)]
|
||||
|
||||
error: this public function dereferences a raw pointer but is not marked `unsafe`
|
||||
--> $DIR/functions.rs:40:34
|
||||
--> $DIR/functions.rs:37:34
|
||||
|
|
||||
40 | println!("{}", unsafe { *p });
|
||||
37 | println!("{}", unsafe { *p });
|
||||
| ^
|
||||
|
|
||||
= note: #[deny(not_unsafe_ptr_arg_deref)] implied by #[deny(clippy)]
|
||||
@ -43,65 +42,65 @@ note: lint level defined here
|
||||
| ^^^^^^
|
||||
|
||||
error: this public function dereferences a raw pointer but is not marked `unsafe`
|
||||
--> $DIR/functions.rs:42:35
|
||||
--> $DIR/functions.rs:38:35
|
||||
|
|
||||
42 | println!("{:?}", unsafe { p.as_ref() });
|
||||
38 | println!("{:?}", unsafe { p.as_ref() });
|
||||
| ^
|
||||
|
|
||||
= note: #[deny(not_unsafe_ptr_arg_deref)] implied by #[deny(clippy)]
|
||||
|
||||
error: this public function dereferences a raw pointer but is not marked `unsafe`
|
||||
--> $DIR/functions.rs:44:33
|
||||
--> $DIR/functions.rs:39:33
|
||||
|
|
||||
44 | unsafe { std::ptr::read(p) };
|
||||
39 | unsafe { std::ptr::read(p) };
|
||||
| ^
|
||||
|
|
||||
= note: #[deny(not_unsafe_ptr_arg_deref)] implied by #[deny(clippy)]
|
||||
|
||||
error: this public function dereferences a raw pointer but is not marked `unsafe`
|
||||
--> $DIR/functions.rs:56:30
|
||||
--> $DIR/functions.rs:50:30
|
||||
|
|
||||
56 | println!("{}", unsafe { *p });
|
||||
50 | println!("{}", unsafe { *p });
|
||||
| ^
|
||||
|
|
||||
= note: #[deny(not_unsafe_ptr_arg_deref)] implied by #[deny(clippy)]
|
||||
|
||||
error: this public function dereferences a raw pointer but is not marked `unsafe`
|
||||
--> $DIR/functions.rs:58:31
|
||||
--> $DIR/functions.rs:51:31
|
||||
|
|
||||
58 | println!("{:?}", unsafe { p.as_ref() });
|
||||
51 | println!("{:?}", unsafe { p.as_ref() });
|
||||
| ^
|
||||
|
|
||||
= note: #[deny(not_unsafe_ptr_arg_deref)] implied by #[deny(clippy)]
|
||||
|
||||
error: this public function dereferences a raw pointer but is not marked `unsafe`
|
||||
--> $DIR/functions.rs:60:29
|
||||
--> $DIR/functions.rs:52:29
|
||||
|
|
||||
60 | unsafe { std::ptr::read(p) };
|
||||
52 | unsafe { std::ptr::read(p) };
|
||||
| ^
|
||||
|
|
||||
= note: #[deny(not_unsafe_ptr_arg_deref)] implied by #[deny(clippy)]
|
||||
|
||||
error: this public function dereferences a raw pointer but is not marked `unsafe`
|
||||
--> $DIR/functions.rs:70:34
|
||||
--> $DIR/functions.rs:61:34
|
||||
|
|
||||
70 | println!("{}", unsafe { *p });
|
||||
61 | println!("{}", unsafe { *p });
|
||||
| ^
|
||||
|
|
||||
= note: #[deny(not_unsafe_ptr_arg_deref)] implied by #[deny(clippy)]
|
||||
|
||||
error: this public function dereferences a raw pointer but is not marked `unsafe`
|
||||
--> $DIR/functions.rs:72:35
|
||||
--> $DIR/functions.rs:62:35
|
||||
|
|
||||
72 | println!("{:?}", unsafe { p.as_ref() });
|
||||
62 | println!("{:?}", unsafe { p.as_ref() });
|
||||
| ^
|
||||
|
|
||||
= note: #[deny(not_unsafe_ptr_arg_deref)] implied by #[deny(clippy)]
|
||||
|
||||
error: this public function dereferences a raw pointer but is not marked `unsafe`
|
||||
--> $DIR/functions.rs:74:33
|
||||
--> $DIR/functions.rs:63:33
|
||||
|
|
||||
74 | unsafe { std::ptr::read(p) };
|
||||
63 | unsafe { std::ptr::read(p) };
|
||||
| ^
|
||||
|
|
||||
= note: #[deny(not_unsafe_ptr_arg_deref)] implied by #[deny(clippy)]
|
||||
|
Loading…
Reference in New Issue
Block a user