Auto merge of #4739 - flip1995:rustup, r=flip1995

Rustup to rust-lang/rust#65773

changelog: none
This commit is contained in:
bors 2019-10-26 20:30:02 +00:00
commit 66df92aeba
22 changed files with 108 additions and 0 deletions

View File

@ -19,6 +19,7 @@ error: variable appears on both sides of an assignment operation
|
LL | a += 1 + a;
| ^^^^^^^^^^
|
help: Did you mean a = a + 1 or a = a + 1 + a? Consider replacing it with
|
LL | a += 1;
@ -33,6 +34,7 @@ error: variable appears on both sides of an assignment operation
|
LL | a -= a - 1;
| ^^^^^^^^^^
|
help: Did you mean a = a - 1 or a = a - (a - 1)? Consider replacing it with
|
LL | a -= 1;
@ -47,6 +49,7 @@ error: variable appears on both sides of an assignment operation
|
LL | a *= a * 99;
| ^^^^^^^^^^^
|
help: Did you mean a = a * 99 or a = a * a * 99? Consider replacing it with
|
LL | a *= 99;
@ -61,6 +64,7 @@ error: variable appears on both sides of an assignment operation
|
LL | a *= 42 * a;
| ^^^^^^^^^^^
|
help: Did you mean a = a * 42 or a = a * 42 * a? Consider replacing it with
|
LL | a *= 42;
@ -75,6 +79,7 @@ error: variable appears on both sides of an assignment operation
|
LL | a /= a / 2;
| ^^^^^^^^^^
|
help: Did you mean a = a / 2 or a = a / (a / 2)? Consider replacing it with
|
LL | a /= 2;
@ -89,6 +94,7 @@ error: variable appears on both sides of an assignment operation
|
LL | a %= a % 5;
| ^^^^^^^^^^
|
help: Did you mean a = a % 5 or a = a % (a % 5)? Consider replacing it with
|
LL | a %= 5;
@ -103,6 +109,7 @@ error: variable appears on both sides of an assignment operation
|
LL | a &= a & 1;
| ^^^^^^^^^^
|
help: Did you mean a = a & 1 or a = a & a & 1? Consider replacing it with
|
LL | a &= 1;
@ -117,6 +124,7 @@ error: variable appears on both sides of an assignment operation
|
LL | a *= a * a;
| ^^^^^^^^^^
|
help: Did you mean a = a * a or a = a * a * a? Consider replacing it with
|
LL | a *= a;

View File

@ -72,6 +72,7 @@ error: this boolean expression can be simplified
|
LL | let _ = a == b && c == 5 && a == b;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: try
|
LL | let _ = a == b && c == 5;
@ -84,6 +85,7 @@ error: this boolean expression can be simplified
|
LL | let _ = a == b && c == 5 && b == a;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: try
|
LL | let _ = a == b && c == 5;
@ -120,6 +122,7 @@ error: this boolean expression can be simplified
|
LL | let _ = a != b || !(a != b || c == d);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: try
|
LL | let _ = c != d || a != b;

View File

@ -25,6 +25,7 @@ LL | | println!("Hello world!");
LL | | }
LL | | }
| |_____^
|
help: try
|
LL | if (x == "hello" || x == "world") && (y == "world" || y == "hello") {
@ -41,6 +42,7 @@ LL | | println!("Hello world!");
LL | | }
LL | | }
| |_____^
|
help: try
|
LL | if x == "hello" && x == "world" && (y == "world" || y == "hello") {
@ -57,6 +59,7 @@ LL | | println!("Hello world!");
LL | | }
LL | | }
| |_____^
|
help: try
|
LL | if (x == "hello" || x == "world") && y == "world" && y == "hello" {
@ -73,6 +76,7 @@ LL | | println!("Hello world!");
LL | | }
LL | | }
| |_____^
|
help: try
|
LL | if x == "hello" && x == "world" && y == "world" && y == "hello" {
@ -89,6 +93,7 @@ LL | | println!("world!")
LL | | }
LL | | }
| |_____^
|
help: try
|
LL | if 42 == 1337 && 'a' != 'A' {
@ -106,6 +111,7 @@ LL | | println!("world!")
LL | | }
LL | | }
| |_____^
|
help: try
|
LL | } else if y == "world" {
@ -123,6 +129,7 @@ LL | | println!("world!")
LL | | }
LL | | }
| |_____^
|
help: try
|
LL | } else if let Some(42) = Some(42) {
@ -142,6 +149,7 @@ LL | | }
LL | | }
LL | | }
| |_____^
|
help: try
|
LL | } else if y == "world" {
@ -164,6 +172,7 @@ LL | | }
LL | | }
LL | | }
| |_____^
|
help: try
|
LL | } else if let Some(42) = Some(42) {
@ -186,6 +195,7 @@ LL | | }
LL | | }
LL | | }
| |_____^
|
help: try
|
LL | } else if let Some(42) = Some(42) {
@ -208,6 +218,7 @@ LL | | }
LL | | }
LL | | }
| |_____^
|
help: try
|
LL | } else if x == "hello" {
@ -230,6 +241,7 @@ LL | | }
LL | | }
LL | | }
| |_____^
|
help: try
|
LL | } else if let Some(42) = Some(42) {
@ -249,6 +261,7 @@ LL | | println!("Hello world!");
LL | | }
LL | | }
| |_____^
|
help: try
|
LL | if x == "hello" && y == "world" { // Collapsible

View File

@ -15,6 +15,7 @@ error: `dbg!` macro is intended as a debugging tool
|
LL | if dbg!(n <= 1) {
| ^^^^^^^^^^^^
|
help: ensure to avoid having uses of it in version control
|
LL | if n <= 1 {
@ -25,6 +26,7 @@ error: `dbg!` macro is intended as a debugging tool
|
LL | dbg!(1)
| ^^^^^^^
|
help: ensure to avoid having uses of it in version control
|
LL | 1
@ -35,6 +37,7 @@ error: `dbg!` macro is intended as a debugging tool
|
LL | dbg!(n * factorial(n - 1))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: ensure to avoid having uses of it in version control
|
LL | n * factorial(n - 1)
@ -45,6 +48,7 @@ error: `dbg!` macro is intended as a debugging tool
|
LL | dbg!(42);
| ^^^^^^^^
|
help: ensure to avoid having uses of it in version control
|
LL | 42;
@ -55,6 +59,7 @@ error: `dbg!` macro is intended as a debugging tool
|
LL | dbg!(dbg!(dbg!(42)));
| ^^^^^^^^^^^^^^^^^^^^
|
help: ensure to avoid having uses of it in version control
|
LL | dbg!(dbg!(42));
@ -65,6 +70,7 @@ error: `dbg!` macro is intended as a debugging tool
|
LL | foo(3) + dbg!(factorial(4));
| ^^^^^^^^^^^^^^^^^^
|
help: ensure to avoid having uses of it in version control
|
LL | foo(3) + factorial(4);

View File

@ -15,6 +15,7 @@ error: you seem to want to iterate on a map's values
|
LL | for (_, v) in &*m {
| ^^^
|
help: use the corresponding method
|
LL | for v in (*m).values() {
@ -25,6 +26,7 @@ error: you seem to want to iterate on a map's values
|
LL | for (_, v) in &mut m {
| ^^^^^^
|
help: use the corresponding method
|
LL | for v in m.values_mut() {
@ -35,6 +37,7 @@ error: you seem to want to iterate on a map's values
|
LL | for (_, v) in &mut *m {
| ^^^^^^^
|
help: use the corresponding method
|
LL | for v in (*m).values_mut() {
@ -45,6 +48,7 @@ error: you seem to want to iterate on a map's keys
|
LL | for (k, _value) in rm {
| ^^
|
help: use the corresponding method
|
LL | for k in rm.keys() {

View File

@ -15,6 +15,7 @@ error: this range is empty so this for loop will never run
|
LL | for i in 10..=0 {
| ^^^^^^
|
help: consider using the following if you are attempting to iterate over this range in reverse
|
LL | for i in (0..=10).rev() {
@ -25,6 +26,7 @@ error: this range is empty so this for loop will never run
|
LL | for i in MAX_LEN..0 {
| ^^^^^^^^^^
|
help: consider using the following if you are attempting to iterate over this range in reverse
|
LL | for i in (0..MAX_LEN).rev() {
@ -35,6 +37,7 @@ error: this range is empty so this for loop will never run
|
LL | for i in 10..5 + 4 {
| ^^^^^^^^^
|
help: consider using the following if you are attempting to iterate over this range in reverse
|
LL | for i in (5 + 4..10).rev() {
@ -45,6 +48,7 @@ error: this range is empty so this for loop will never run
|
LL | for i in (5 + 2)..(3 - 1) {
| ^^^^^^^^^^^^^^^^
|
help: consider using the following if you are attempting to iterate over this range in reverse
|
LL | for i in ((3 - 1)..(5 + 2)).rev() {

View File

@ -19,6 +19,7 @@ error: impl for `HashMap` should be generalized over different hashers
|
LL | impl<K: Hash + Eq, V> Foo<i8> for (HashMap<K, V>,) {
| ^^^^^^^^^^^^^
|
help: consider adding a type parameter
|
LL | impl<K: Hash + Eq, V, S: ::std::hash::BuildHasher + Default> Foo<i8> for (HashMap<K, V, S>,) {
@ -33,6 +34,7 @@ error: impl for `HashMap` should be generalized over different hashers
|
LL | impl Foo<i16> for HashMap<String, String> {
| ^^^^^^^^^^^^^^^^^^^^^^^
|
help: consider adding a type parameter
|
LL | impl<S: ::std::hash::BuildHasher + Default> Foo<i16> for HashMap<String, String, S> {
@ -47,6 +49,7 @@ error: impl for `HashSet` should be generalized over different hashers
|
LL | impl<T: Hash + Eq> Foo<i8> for HashSet<T> {
| ^^^^^^^^^^
|
help: consider adding a type parameter
|
LL | impl<T: Hash + Eq, S: ::std::hash::BuildHasher + Default> Foo<i8> for HashSet<T, S> {
@ -61,6 +64,7 @@ error: impl for `HashSet` should be generalized over different hashers
|
LL | impl Foo<i16> for HashSet<String> {
| ^^^^^^^^^^^^^^^
|
help: consider adding a type parameter
|
LL | impl<S: ::std::hash::BuildHasher + Default> Foo<i16> for HashSet<String, S> {
@ -75,6 +79,7 @@ error: parameter of type `HashMap` should be generalized over different hashers
|
LL | pub fn foo(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32>) {}
| ^^^^^^^^^^^^^^^^^
|
help: consider adding a type parameter
|
LL | pub fn foo<S: ::std::hash::BuildHasher>(_map: &mut HashMap<i32, i32, S>, _set: &mut HashSet<i32>) {}
@ -85,6 +90,7 @@ error: parameter of type `HashSet` should be generalized over different hashers
|
LL | pub fn foo(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32>) {}
| ^^^^^^^^^^^^
|
help: consider adding a type parameter
|
LL | pub fn foo<S: ::std::hash::BuildHasher>(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32, S>) {}
@ -98,6 +104,7 @@ LL | impl<K: Hash + Eq, V> Foo<u8> for HashMap<K, V> {
...
LL | gen!(impl);
| ----------- in this macro invocation
|
help: consider adding a type parameter
|
LL | impl<K: Hash + Eq, V, S: ::std::hash::BuildHasher + Default> Foo<u8> for HashMap<K, V, S> {
@ -115,6 +122,7 @@ LL | pub fn $name(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32>)
...
LL | gen!(fn bar);
| ------------- in this macro invocation
|
help: consider adding a type parameter
|
LL | pub fn $name<S: ::std::hash::BuildHasher>(_map: &mut HashMap<i32, i32, S>, _set: &mut HashSet<i32>) {}
@ -128,6 +136,7 @@ LL | pub fn $name(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32>)
...
LL | gen!(fn bar);
| ------------- in this macro invocation
|
help: consider adding a type parameter
|
LL | pub fn $name<S: ::std::hash::BuildHasher>(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32, S>) {}

View File

@ -27,6 +27,7 @@ error: large size difference between variants
|
LL | ContainingLargeEnum(LargeEnum),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: consider boxing the large fields to reduce the total size of the enum
|
LL | ContainingLargeEnum(Box<LargeEnum>),
@ -61,6 +62,7 @@ error: large size difference between variants
|
LL | StructLikeLarge2 { x: [i32; 8000] },
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: consider boxing the large fields to reduce the total size of the enum
|
LL | StructLikeLarge2 { x: Box<[i32; 8000]> },

View File

@ -20,6 +20,7 @@ LL | let x = 5;
| ---------- unnecessary let binding
LL | x
| ^
|
help: return the expression directly
|
LL |

View File

@ -23,6 +23,7 @@ LL | | .map(|_| ())
LL | | .next()
LL | | .unwrap();
| |__________________^
|
help: omit the `let` binding
|
LL | v

View File

@ -39,6 +39,7 @@ error: this is a decimal constant
|
LL | let fail8 = 0123;
| ^^^^
|
help: if you mean to use a decimal constant, remove the `0` to avoid confusion
|
LL | let fail8 = 123;

View File

@ -35,6 +35,7 @@ error: it looks like you're manually copying between slices
|
LL | for i in 10..256 {
| ^^^^^^^
|
help: try replacing the loop by
|
LL | for i in dst[10..256].clone_from_slice(&src[(10 - 5)..(256 - 5)])

View File

@ -36,6 +36,7 @@ LL | | println!("Noooo!");
LL | | },
LL | | };
| |_____^
|
help: consider using an if/else expression
|
LL | if !test {
@ -53,6 +54,7 @@ LL | | },
LL | | _ => (),
LL | | };
| |_____^
|
help: consider using an if/else expression
|
LL | if !test {
@ -70,6 +72,7 @@ LL | | },
LL | | _ => (),
LL | | };
| |_____^
|
help: consider using an if/else expression
|
LL | if !(test && test) {
@ -96,6 +99,7 @@ LL | | },
LL | | },
LL | | };
| |_____^
|
help: consider using an if/else expression
|
LL | if test {

View File

@ -23,6 +23,7 @@ LL | | &(v, 1) => println!("{}", v),
LL | | _ => println!("none"),
LL | | }
| |_____^
|
help: instead of prefixing all patterns with `&`, you can dereference the expression
|
LL | match *tup {
@ -37,6 +38,7 @@ LL | | &Some(v) => println!("{:?}", v),
LL | | &None => println!("none"),
LL | | }
| |_____^
|
help: try
|
LL | match w {
@ -51,6 +53,7 @@ LL | / if let &None = a {
LL | | println!("none");
LL | | }
| |_____^
|
help: instead of prefixing all patterns with `&`, you can dereference the expression
|
LL | if let None = *a {
@ -63,6 +66,7 @@ LL | / if let &None = &b {
LL | | println!("none");
LL | | }
| |_____^
|
help: try
|
LL | if let None = b {
@ -76,6 +80,7 @@ LL | | &Foo::A => println!("A"),
LL | | _ => println!("Wild"),
LL | | }
| |_________^
|
help: instead of prefixing all patterns with `&`, you can dereference the expression
|
LL | match *foo_variant!(0) {

View File

@ -59,6 +59,7 @@ error: this argument is passed by value, but not consumed in the function body
|
LL | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
| ^^^^^^
|
help: consider changing the type to
|
LL | fn issue_2114(s: String, t: &str, u: Vec<i32>, v: Vec<i32>) {
@ -79,6 +80,7 @@ error: this argument is passed by value, but not consumed in the function body
|
LL | fn issue_2114(s: String, t: String, u: Vec<i32>, v: Vec<i32>) {
| ^^^^^^^^
|
help: consider changing the type to
|
LL | fn issue_2114(s: String, t: String, u: Vec<i32>, v: &[i32]) {

View File

@ -15,6 +15,7 @@ error: the loop variable `i` is only used to index `ms`.
|
LL | for i in 0..ms.len() {
| ^^^^^^^^^^^
|
help: consider using an iterator
|
LL | for <item> in &mut ms {
@ -25,6 +26,7 @@ error: the loop variable `i` is only used to index `ms`.
|
LL | for i in 0..ms.len() {
| ^^^^^^^^^^^
|
help: consider using an iterator
|
LL | for <item> in &mut ms {
@ -35,6 +37,7 @@ error: the loop variable `i` is only used to index `vec`.
|
LL | for i in x..x + 4 {
| ^^^^^^^^
|
help: consider using an iterator
|
LL | for <item> in vec.iter_mut().skip(x).take(4) {
@ -45,6 +48,7 @@ error: the loop variable `i` is only used to index `vec`.
|
LL | for i in x..=x + 4 {
| ^^^^^^^^^
|
help: consider using an iterator
|
LL | for <item> in vec.iter_mut().skip(x).take(4 + 1) {
@ -55,6 +59,7 @@ error: the loop variable `i` is only used to index `arr`.
|
LL | for i in 0..3 {
| ^^^^
|
help: consider using an iterator
|
LL | for <item> in &arr {
@ -65,6 +70,7 @@ error: the loop variable `i` is only used to index `arr`.
|
LL | for i in 0..2 {
| ^^^^
|
help: consider using an iterator
|
LL | for <item> in arr.iter().take(2) {
@ -75,6 +81,7 @@ error: the loop variable `i` is only used to index `arr`.
|
LL | for i in 1..3 {
| ^^^^
|
help: consider using an iterator
|
LL | for <item> in arr.iter().skip(1) {
@ -85,6 +92,7 @@ error: the loop variable `i` is only used to index `vec`.
|
LL | for i in 0..vec.len() {
| ^^^^^^^^^^^^
|
help: consider using an iterator
|
LL | for <item> in &vec {
@ -95,6 +103,7 @@ error: the loop variable `i` is only used to index `vec`.
|
LL | for i in 0..vec.len() {
| ^^^^^^^^^^^^
|
help: consider using an iterator
|
LL | for <item> in &vec {
@ -105,6 +114,7 @@ error: the loop variable `j` is only used to index `STATIC`.
|
LL | for j in 0..4 {
| ^^^^
|
help: consider using an iterator
|
LL | for <item> in &STATIC {
@ -115,6 +125,7 @@ error: the loop variable `j` is only used to index `CONST`.
|
LL | for j in 0..4 {
| ^^^^
|
help: consider using an iterator
|
LL | for <item> in &CONST {
@ -125,6 +136,7 @@ error: the loop variable `i` is used to index `vec`
|
LL | for i in 0..vec.len() {
| ^^^^^^^^^^^^
|
help: consider using an iterator
|
LL | for (i, <item>) in vec.iter().enumerate() {
@ -135,6 +147,7 @@ error: the loop variable `i` is only used to index `vec2`.
|
LL | for i in 0..vec.len() {
| ^^^^^^^^^^^^
|
help: consider using an iterator
|
LL | for <item> in vec2.iter().take(vec.len()) {
@ -145,6 +158,7 @@ error: the loop variable `i` is only used to index `vec`.
|
LL | for i in 5..vec.len() {
| ^^^^^^^^^^^^
|
help: consider using an iterator
|
LL | for <item> in vec.iter().skip(5) {
@ -155,6 +169,7 @@ error: the loop variable `i` is only used to index `vec`.
|
LL | for i in 0..MAX_LEN {
| ^^^^^^^^^^
|
help: consider using an iterator
|
LL | for <item> in vec.iter().take(MAX_LEN) {
@ -165,6 +180,7 @@ error: the loop variable `i` is only used to index `vec`.
|
LL | for i in 0..=MAX_LEN {
| ^^^^^^^^^^^
|
help: consider using an iterator
|
LL | for <item> in vec.iter().take(MAX_LEN + 1) {
@ -175,6 +191,7 @@ error: the loop variable `i` is only used to index `vec`.
|
LL | for i in 5..10 {
| ^^^^^
|
help: consider using an iterator
|
LL | for <item> in vec.iter().take(10).skip(5) {
@ -185,6 +202,7 @@ error: the loop variable `i` is only used to index `vec`.
|
LL | for i in 5..=10 {
| ^^^^^^
|
help: consider using an iterator
|
LL | for <item> in vec.iter().take(10 + 1).skip(5) {
@ -195,6 +213,7 @@ error: the loop variable `i` is used to index `vec`
|
LL | for i in 5..vec.len() {
| ^^^^^^^^^^^^
|
help: consider using an iterator
|
LL | for (i, <item>) in vec.iter().enumerate().skip(5) {
@ -205,6 +224,7 @@ error: the loop variable `i` is used to index `vec`
|
LL | for i in 5..10 {
| ^^^^^
|
help: consider using an iterator
|
LL | for (i, <item>) in vec.iter().enumerate().take(10).skip(5) {
@ -215,6 +235,7 @@ error: the loop variable `i` is used to index `vec`
|
LL | for i in 0..vec.len() {
| ^^^^^^^^^^^^
|
help: consider using an iterator
|
LL | for (i, <item>) in vec.iter_mut().enumerate() {

View File

@ -19,6 +19,7 @@ LL | / pub fn new() -> Self {
LL | | Bar
LL | | }
| |_____^
|
help: try this
|
LL | #[derive(Default)]
@ -31,6 +32,7 @@ LL | / pub fn new() -> LtKo<'c> {
LL | | unimplemented!()
LL | | }
| |_____^
|
help: try this
|
LL | impl Default for LtKo<'c> {

View File

@ -14,6 +14,7 @@ LL | let _ = opt.map_or(None, |x| {
LL | | Some(x + 1)
LL | | });
| |_________________________^
|
help: try using and_then instead
|
LL | let _ = opt.and_then(|x| {

View File

@ -15,6 +15,7 @@ error: using `print!()` with a format string that ends in a single newline
|
LL | print!("Hello {}/n", "world");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: use `println!` instead
|
LL | println!("Hello {}", "world");
@ -25,6 +26,7 @@ error: using `print!()` with a format string that ends in a single newline
|
LL | print!("Hello {} {}/n", "world", "#2");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: use `println!` instead
|
LL | println!("Hello {} {}", "world", "#2");
@ -35,6 +37,7 @@ error: using `print!()` with a format string that ends in a single newline
|
LL | print!("{}/n", 1265);
| ^^^^^^^^^^^^^^^^^^^^
|
help: use `println!` instead
|
LL | println!("{}", 1265);
@ -45,6 +48,7 @@ error: using `print!()` with a format string that ends in a single newline
|
LL | print!("//n"); // should fail
| ^^^^^^^^^^^^^^
|
help: use `println!` instead
|
LL | println!("/"); // should fail
@ -58,6 +62,7 @@ LL | | "
LL | | "
LL | | );
| |_____^
|
help: use `println!` instead
|
LL | println!(
@ -72,6 +77,7 @@ LL | | r"
LL | | "
LL | | );
| |_____^
|
help: use `println!` instead
|
LL | println!(

View File

@ -23,6 +23,7 @@ error: writing `&Vec<_>` instead of `&[_]` involves one more reference and canno
|
LL | fn cloned(x: &Vec<u8>) -> Vec<u8> {
| ^^^^^^^^
|
help: change this to
|
LL | fn cloned(x: &[u8]) -> Vec<u8> {
@ -41,6 +42,7 @@ error: writing `&String` instead of `&str` involves a new object where a slice w
|
LL | fn str_cloned(x: &String) -> String {
| ^^^^^^^
|
help: change this to
|
LL | fn str_cloned(x: &str) -> String {
@ -63,6 +65,7 @@ error: writing `&String` instead of `&str` involves a new object where a slice w
|
LL | fn false_positive_capacity(x: &Vec<u8>, y: &String) {
| ^^^^^^^
|
help: change this to
|
LL | fn false_positive_capacity(x: &Vec<u8>, y: &str) {

View File

@ -18,6 +18,7 @@ LL | foo({
LL | | 1;
LL | | });
| |_____^
|
help: if you intended to pass a unit value, use a unit literal instead
|
LL | foo(());
@ -28,6 +29,7 @@ error: passing a unit value to a function
|
LL | foo(foo(1));
| ^^^^^^
|
help: if you intended to pass a unit value, use a unit literal instead
|
LL | foo(());
@ -42,6 +44,7 @@ LL | | foo(1);
LL | | foo(2);
LL | | });
| |_____^
|
help: if you intended to pass a unit value, use a unit literal instead
|
LL | foo(());
@ -52,6 +55,7 @@ error: passing a unit value to a function
|
LL | foo3({}, 2, 2);
| ^^
|
help: if you intended to pass a unit value, use a unit literal instead
|
LL | foo3((), 2, 2);
@ -65,6 +69,7 @@ LL | b.bar({
LL | | 1;
LL | | });
| |_____^
|
help: if you intended to pass a unit value, use a unit literal instead
|
LL | b.bar(());

View File

@ -15,6 +15,7 @@ error: using `write!()` with a format string that ends in a single newline
|
LL | write!(&mut v, "Hello {}/n", "world");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: use `writeln!()` instead
|
LL | writeln!(&mut v, "Hello {}", "world");
@ -25,6 +26,7 @@ error: using `write!()` with a format string that ends in a single newline
|
LL | write!(&mut v, "Hello {} {}/n", "world", "#2");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: use `writeln!()` instead
|
LL | writeln!(&mut v, "Hello {} {}", "world", "#2");
@ -35,6 +37,7 @@ error: using `write!()` with a format string that ends in a single newline
|
LL | write!(&mut v, "{}/n", 1265);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: use `writeln!()` instead
|
LL | writeln!(&mut v, "{}", 1265);
@ -45,6 +48,7 @@ error: using `write!()` with a format string that ends in a single newline
|
LL | write!(&mut v, "//n"); // should fail
| ^^^^^^^^^^^^^^^^^^^^^^
|
help: use `writeln!()` instead
|
LL | writeln!(&mut v, "/"); // should fail
@ -59,6 +63,7 @@ LL | | "
LL | | "
LL | | );
| |_____^
|
help: use `writeln!()` instead
|
LL | writeln!(
@ -75,6 +80,7 @@ LL | | r"
LL | | "
LL | | );
| |_____^
|
help: use `writeln!()` instead
|
LL | writeln!(