mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-10 23:24:24 +00:00
Update stderr files
This commit is contained in:
parent
bf46f78ca7
commit
86331a46e4
10 changed files with 56 additions and 54 deletions
|
@ -1,5 +1,5 @@
|
|||
error: docs for function returning `Result` missing `# Errors` section
|
||||
--> $DIR/doc_errors.rs:7:1
|
||||
--> $DIR/doc_errors.rs:8:1
|
||||
|
|
||||
LL | / pub fn pub_fn_missing_errors_header() -> Result<(), ()> {
|
||||
LL | | unimplemented!();
|
||||
|
@ -9,7 +9,7 @@ LL | | }
|
|||
= note: `-D clippy::missing-errors-doc` implied by `-D warnings`
|
||||
|
||||
error: docs for function returning `Result` missing `# Errors` section
|
||||
--> $DIR/doc_errors.rs:11:1
|
||||
--> $DIR/doc_errors.rs:12:1
|
||||
|
|
||||
LL | / pub async fn async_pub_fn_missing_errors_header() -> Result<(), ()> {
|
||||
LL | | unimplemented!();
|
||||
|
@ -17,7 +17,7 @@ LL | | }
|
|||
| |_^
|
||||
|
||||
error: docs for function returning `Result` missing `# Errors` section
|
||||
--> $DIR/doc_errors.rs:16:1
|
||||
--> $DIR/doc_errors.rs:17:1
|
||||
|
|
||||
LL | / pub fn pub_fn_returning_io_result() -> io::Result<()> {
|
||||
LL | | unimplemented!();
|
||||
|
@ -25,7 +25,7 @@ LL | | }
|
|||
| |_^
|
||||
|
||||
error: docs for function returning `Result` missing `# Errors` section
|
||||
--> $DIR/doc_errors.rs:21:1
|
||||
--> $DIR/doc_errors.rs:22:1
|
||||
|
|
||||
LL | / pub async fn async_pub_fn_returning_io_result() -> io::Result<()> {
|
||||
LL | | unimplemented!();
|
||||
|
@ -33,7 +33,7 @@ LL | | }
|
|||
| |_^
|
||||
|
||||
error: docs for function returning `Result` missing `# Errors` section
|
||||
--> $DIR/doc_errors.rs:51:5
|
||||
--> $DIR/doc_errors.rs:52:5
|
||||
|
|
||||
LL | / pub fn pub_method_missing_errors_header() -> Result<(), ()> {
|
||||
LL | | unimplemented!();
|
||||
|
@ -41,7 +41,7 @@ LL | | }
|
|||
| |_____^
|
||||
|
||||
error: docs for function returning `Result` missing `# Errors` section
|
||||
--> $DIR/doc_errors.rs:56:5
|
||||
--> $DIR/doc_errors.rs:57:5
|
||||
|
|
||||
LL | / pub async fn async_pub_method_missing_errors_header() -> Result<(), ()> {
|
||||
LL | | unimplemented!();
|
||||
|
@ -49,7 +49,7 @@ LL | | }
|
|||
| |_____^
|
||||
|
||||
error: docs for function returning `Result` missing `# Errors` section
|
||||
--> $DIR/doc_errors.rs:85:5
|
||||
--> $DIR/doc_errors.rs:86:5
|
||||
|
|
||||
LL | fn trait_method_missing_errors_header() -> Result<(), ()>;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
|
@ -1,108 +1,108 @@
|
|||
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing.
|
||||
--> $DIR/drop_ref.rs:10:5
|
||||
--> $DIR/drop_ref.rs:11:5
|
||||
|
|
||||
LL | drop(&SomeStruct);
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D clippy::drop-ref` implied by `-D warnings`
|
||||
note: argument has type `&SomeStruct`
|
||||
--> $DIR/drop_ref.rs:10:10
|
||||
--> $DIR/drop_ref.rs:11:10
|
||||
|
|
||||
LL | drop(&SomeStruct);
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing.
|
||||
--> $DIR/drop_ref.rs:13:5
|
||||
--> $DIR/drop_ref.rs:14:5
|
||||
|
|
||||
LL | drop(&owned1);
|
||||
| ^^^^^^^^^^^^^
|
||||
|
|
||||
note: argument has type `&SomeStruct`
|
||||
--> $DIR/drop_ref.rs:13:10
|
||||
--> $DIR/drop_ref.rs:14:10
|
||||
|
|
||||
LL | drop(&owned1);
|
||||
| ^^^^^^^
|
||||
|
||||
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing.
|
||||
--> $DIR/drop_ref.rs:14:5
|
||||
--> $DIR/drop_ref.rs:15:5
|
||||
|
|
||||
LL | drop(&&owned1);
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
|
||||
note: argument has type `&&SomeStruct`
|
||||
--> $DIR/drop_ref.rs:14:10
|
||||
--> $DIR/drop_ref.rs:15:10
|
||||
|
|
||||
LL | drop(&&owned1);
|
||||
| ^^^^^^^^
|
||||
|
||||
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing.
|
||||
--> $DIR/drop_ref.rs:15:5
|
||||
--> $DIR/drop_ref.rs:16:5
|
||||
|
|
||||
LL | drop(&mut owned1);
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
note: argument has type `&mut SomeStruct`
|
||||
--> $DIR/drop_ref.rs:15:10
|
||||
--> $DIR/drop_ref.rs:16:10
|
||||
|
|
||||
LL | drop(&mut owned1);
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing.
|
||||
--> $DIR/drop_ref.rs:19:5
|
||||
--> $DIR/drop_ref.rs:20:5
|
||||
|
|
||||
LL | drop(reference1);
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
|
|
||||
note: argument has type `&SomeStruct`
|
||||
--> $DIR/drop_ref.rs:19:10
|
||||
--> $DIR/drop_ref.rs:20:10
|
||||
|
|
||||
LL | drop(reference1);
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing.
|
||||
--> $DIR/drop_ref.rs:22:5
|
||||
--> $DIR/drop_ref.rs:23:5
|
||||
|
|
||||
LL | drop(reference2);
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
|
|
||||
note: argument has type `&mut SomeStruct`
|
||||
--> $DIR/drop_ref.rs:22:10
|
||||
--> $DIR/drop_ref.rs:23:10
|
||||
|
|
||||
LL | drop(reference2);
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing.
|
||||
--> $DIR/drop_ref.rs:25:5
|
||||
--> $DIR/drop_ref.rs:26:5
|
||||
|
|
||||
LL | drop(reference3);
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
|
|
||||
note: argument has type `&SomeStruct`
|
||||
--> $DIR/drop_ref.rs:25:10
|
||||
--> $DIR/drop_ref.rs:26:10
|
||||
|
|
||||
LL | drop(reference3);
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing.
|
||||
--> $DIR/drop_ref.rs:30:5
|
||||
--> $DIR/drop_ref.rs:31:5
|
||||
|
|
||||
LL | drop(&val);
|
||||
| ^^^^^^^^^^
|
||||
|
|
||||
note: argument has type `&T`
|
||||
--> $DIR/drop_ref.rs:30:10
|
||||
--> $DIR/drop_ref.rs:31:10
|
||||
|
|
||||
LL | drop(&val);
|
||||
| ^^^^
|
||||
|
||||
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing.
|
||||
--> $DIR/drop_ref.rs:38:5
|
||||
--> $DIR/drop_ref.rs:39:5
|
||||
|
|
||||
LL | std::mem::drop(&SomeStruct);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
note: argument has type `&SomeStruct`
|
||||
--> $DIR/drop_ref.rs:38:20
|
||||
--> $DIR/drop_ref.rs:39:20
|
||||
|
|
||||
LL | std::mem::drop(&SomeStruct);
|
||||
| ^^^^^^^^^^^
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// run-rustfix
|
||||
#![allow(dead_code)]
|
||||
#![allow(unused_variables)]
|
||||
#![allow(unused_variables, clippy::unnecessary_wrap)]
|
||||
|
||||
fn option_unwrap_or() {
|
||||
// int case
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// run-rustfix
|
||||
#![allow(dead_code)]
|
||||
#![allow(unused_variables)]
|
||||
#![allow(unused_variables, clippy::unnecessary_wrap)]
|
||||
|
||||
fn option_unwrap_or() {
|
||||
// int case
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#![warn(clippy::map_err_ignore)]
|
||||
#![allow(clippy::unnecessary_wrap)]
|
||||
use std::convert::TryFrom;
|
||||
use std::error::Error;
|
||||
use std::fmt;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error: `map_err(|_|...` ignores the original error
|
||||
--> $DIR/map_err.rs:22:32
|
||||
--> $DIR/map_err.rs:23:32
|
||||
|
|
||||
LL | println!("{:?}", x.map_err(|_| Errors::Ignored));
|
||||
| ^^^
|
||||
|
|
|
@ -61,19 +61,19 @@ LL | without_default.unwrap_or(Foo::new());
|
|||
| ^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(Foo::new)`
|
||||
|
||||
error: use of `or_insert` followed by a function call
|
||||
--> $DIR/or_fun_call.rs:62:19
|
||||
--> $DIR/or_fun_call.rs:63:19
|
||||
|
|
||||
LL | map.entry(42).or_insert(String::new());
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `or_insert_with(String::new)`
|
||||
|
||||
error: use of `or_insert` followed by a function call
|
||||
--> $DIR/or_fun_call.rs:65:21
|
||||
--> $DIR/or_fun_call.rs:66:21
|
||||
|
|
||||
LL | btree.entry(42).or_insert(String::new());
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `or_insert_with(String::new)`
|
||||
|
||||
error: use of `unwrap_or` followed by a function call
|
||||
--> $DIR/or_fun_call.rs:68:21
|
||||
--> $DIR/or_fun_call.rs:69:21
|
||||
|
|
||||
LL | let _ = stringy.unwrap_or("".to_owned());
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| "".to_owned())`
|
||||
|
|
|
@ -19,19 +19,19 @@ LL | if let Err(_) = Err::<i32, i32>(42) {}
|
|||
| -------^^^^^^---------------------- help: try this: `if Err::<i32, i32>(42).is_err()`
|
||||
|
||||
error: redundant pattern matching, consider using `is_ok()`
|
||||
--> $DIR/redundant_pattern_matching.rs:21:15
|
||||
--> $DIR/redundant_pattern_matching.rs:22:15
|
||||
|
|
||||
LL | while let Ok(_) = Ok::<i32, i32>(10) {}
|
||||
| ----------^^^^^--------------------- help: try this: `while Ok::<i32, i32>(10).is_ok()`
|
||||
|
||||
error: redundant pattern matching, consider using `is_err()`
|
||||
--> $DIR/redundant_pattern_matching.rs:23:15
|
||||
--> $DIR/redundant_pattern_matching.rs:24:15
|
||||
|
|
||||
LL | while let Err(_) = Ok::<i32, i32>(10) {}
|
||||
| ----------^^^^^^--------------------- help: try this: `while Ok::<i32, i32>(10).is_err()`
|
||||
|
||||
error: redundant pattern matching, consider using `is_ok()`
|
||||
--> $DIR/redundant_pattern_matching.rs:33:5
|
||||
--> $DIR/redundant_pattern_matching.rs:34:5
|
||||
|
|
||||
LL | / match Ok::<i32, i32>(42) {
|
||||
LL | | Ok(_) => true,
|
||||
|
@ -40,7 +40,7 @@ LL | | };
|
|||
| |_____^ help: try this: `Ok::<i32, i32>(42).is_ok()`
|
||||
|
||||
error: redundant pattern matching, consider using `is_err()`
|
||||
--> $DIR/redundant_pattern_matching.rs:38:5
|
||||
--> $DIR/redundant_pattern_matching.rs:39:5
|
||||
|
|
||||
LL | / match Ok::<i32, i32>(42) {
|
||||
LL | | Ok(_) => false,
|
||||
|
@ -49,7 +49,7 @@ LL | | };
|
|||
| |_____^ help: try this: `Ok::<i32, i32>(42).is_err()`
|
||||
|
||||
error: redundant pattern matching, consider using `is_err()`
|
||||
--> $DIR/redundant_pattern_matching.rs:43:5
|
||||
--> $DIR/redundant_pattern_matching.rs:44:5
|
||||
|
|
||||
LL | / match Err::<i32, i32>(42) {
|
||||
LL | | Ok(_) => false,
|
||||
|
@ -58,7 +58,7 @@ LL | | };
|
|||
| |_____^ help: try this: `Err::<i32, i32>(42).is_err()`
|
||||
|
||||
error: redundant pattern matching, consider using `is_ok()`
|
||||
--> $DIR/redundant_pattern_matching.rs:48:5
|
||||
--> $DIR/redundant_pattern_matching.rs:49:5
|
||||
|
|
||||
LL | / match Err::<i32, i32>(42) {
|
||||
LL | | Ok(_) => true,
|
||||
|
@ -67,73 +67,73 @@ LL | | };
|
|||
| |_____^ help: try this: `Err::<i32, i32>(42).is_ok()`
|
||||
|
||||
error: redundant pattern matching, consider using `is_ok()`
|
||||
--> $DIR/redundant_pattern_matching.rs:53:20
|
||||
--> $DIR/redundant_pattern_matching.rs:54:20
|
||||
|
|
||||
LL | let _ = if let Ok(_) = Ok::<usize, ()>(4) { true } else { false };
|
||||
| -------^^^^^--------------------- help: try this: `if Ok::<usize, ()>(4).is_ok()`
|
||||
|
||||
error: redundant pattern matching, consider using `is_ok()`
|
||||
--> $DIR/redundant_pattern_matching.rs:59:20
|
||||
--> $DIR/redundant_pattern_matching.rs:60:20
|
||||
|
|
||||
LL | let _ = if let Ok(_) = gen_res() {
|
||||
| -------^^^^^------------ help: try this: `if gen_res().is_ok()`
|
||||
|
||||
error: redundant pattern matching, consider using `is_err()`
|
||||
--> $DIR/redundant_pattern_matching.rs:61:19
|
||||
--> $DIR/redundant_pattern_matching.rs:62:19
|
||||
|
|
||||
LL | } else if let Err(_) = gen_res() {
|
||||
| -------^^^^^^------------ help: try this: `if gen_res().is_err()`
|
||||
|
||||
error: redundant pattern matching, consider using `is_some()`
|
||||
--> $DIR/redundant_pattern_matching.rs:84:19
|
||||
--> $DIR/redundant_pattern_matching.rs:85:19
|
||||
|
|
||||
LL | while let Some(_) = r#try!(result_opt()) {}
|
||||
| ----------^^^^^^^----------------------- help: try this: `while r#try!(result_opt()).is_some()`
|
||||
|
||||
error: redundant pattern matching, consider using `is_some()`
|
||||
--> $DIR/redundant_pattern_matching.rs:85:16
|
||||
--> $DIR/redundant_pattern_matching.rs:86:16
|
||||
|
|
||||
LL | if let Some(_) = r#try!(result_opt()) {}
|
||||
| -------^^^^^^^----------------------- help: try this: `if r#try!(result_opt()).is_some()`
|
||||
|
||||
error: redundant pattern matching, consider using `is_some()`
|
||||
--> $DIR/redundant_pattern_matching.rs:91:12
|
||||
--> $DIR/redundant_pattern_matching.rs:92:12
|
||||
|
|
||||
LL | if let Some(_) = m!() {}
|
||||
| -------^^^^^^^------- help: try this: `if m!().is_some()`
|
||||
|
||||
error: redundant pattern matching, consider using `is_some()`
|
||||
--> $DIR/redundant_pattern_matching.rs:92:15
|
||||
--> $DIR/redundant_pattern_matching.rs:93:15
|
||||
|
|
||||
LL | while let Some(_) = m!() {}
|
||||
| ----------^^^^^^^------- help: try this: `while m!().is_some()`
|
||||
|
||||
error: redundant pattern matching, consider using `is_ok()`
|
||||
--> $DIR/redundant_pattern_matching.rs:110:12
|
||||
--> $DIR/redundant_pattern_matching.rs:111:12
|
||||
|
|
||||
LL | if let Ok(_) = Ok::<i32, i32>(42) {}
|
||||
| -------^^^^^--------------------- help: try this: `if Ok::<i32, i32>(42).is_ok()`
|
||||
|
||||
error: redundant pattern matching, consider using `is_err()`
|
||||
--> $DIR/redundant_pattern_matching.rs:112:12
|
||||
--> $DIR/redundant_pattern_matching.rs:113:12
|
||||
|
|
||||
LL | if let Err(_) = Err::<i32, i32>(42) {}
|
||||
| -------^^^^^^---------------------- help: try this: `if Err::<i32, i32>(42).is_err()`
|
||||
|
||||
error: redundant pattern matching, consider using `is_ok()`
|
||||
--> $DIR/redundant_pattern_matching.rs:114:15
|
||||
--> $DIR/redundant_pattern_matching.rs:115:15
|
||||
|
|
||||
LL | while let Ok(_) = Ok::<i32, i32>(10) {}
|
||||
| ----------^^^^^--------------------- help: try this: `while Ok::<i32, i32>(10).is_ok()`
|
||||
|
||||
error: redundant pattern matching, consider using `is_err()`
|
||||
--> $DIR/redundant_pattern_matching.rs:116:15
|
||||
--> $DIR/redundant_pattern_matching.rs:117:15
|
||||
|
|
||||
LL | while let Err(_) = Ok::<i32, i32>(10) {}
|
||||
| ----------^^^^^^--------------------- help: try this: `while Ok::<i32, i32>(10).is_err()`
|
||||
|
||||
error: redundant pattern matching, consider using `is_ok()`
|
||||
--> $DIR/redundant_pattern_matching.rs:118:5
|
||||
--> $DIR/redundant_pattern_matching.rs:119:5
|
||||
|
|
||||
LL | / match Ok::<i32, i32>(42) {
|
||||
LL | | Ok(_) => true,
|
||||
|
@ -142,7 +142,7 @@ LL | | };
|
|||
| |_____^ help: try this: `Ok::<i32, i32>(42).is_ok()`
|
||||
|
||||
error: redundant pattern matching, consider using `is_err()`
|
||||
--> $DIR/redundant_pattern_matching.rs:123:5
|
||||
--> $DIR/redundant_pattern_matching.rs:124:5
|
||||
|
|
||||
LL | / match Err::<i32, i32>(42) {
|
||||
LL | | Ok(_) => false,
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#![allow(clippy::unnecessary_wrap)]
|
||||
#[warn(clippy::result_unit_err)]
|
||||
#[allow(unused)]
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error: this returns a `Result<_, ()>
|
||||
--> $DIR/result_unit_error.rs:4:1
|
||||
--> $DIR/result_unit_error.rs:5:1
|
||||
|
|
||||
LL | pub fn returns_unit_error() -> Result<u32, ()> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
@ -8,7 +8,7 @@ LL | pub fn returns_unit_error() -> Result<u32, ()> {
|
|||
= help: use a custom Error type instead
|
||||
|
||||
error: this returns a `Result<_, ()>
|
||||
--> $DIR/result_unit_error.rs:13:5
|
||||
--> $DIR/result_unit_error.rs:14:5
|
||||
|
|
||||
LL | fn get_that_error(&self) -> Result<bool, ()>;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
@ -16,7 +16,7 @@ LL | fn get_that_error(&self) -> Result<bool, ()>;
|
|||
= help: use a custom Error type instead
|
||||
|
||||
error: this returns a `Result<_, ()>
|
||||
--> $DIR/result_unit_error.rs:15:5
|
||||
--> $DIR/result_unit_error.rs:16:5
|
||||
|
|
||||
LL | fn get_this_one_too(&self) -> Result<bool, ()> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
@ -24,7 +24,7 @@ LL | fn get_this_one_too(&self) -> Result<bool, ()> {
|
|||
= help: use a custom Error type instead
|
||||
|
||||
error: this returns a `Result<_, ()>
|
||||
--> $DIR/result_unit_error.rs:33:5
|
||||
--> $DIR/result_unit_error.rs:34:5
|
||||
|
|
||||
LL | pub fn unit_error(&self) -> Result<usize, ()> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
Loading…
Reference in a new issue