]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/entry.stderr
Auto merge of #9684 - kraktus:ref_option_ref, r=xFrednet
[rust.git] / tests / ui / entry.stderr
index 2f075a97010a63d77365ce0ac6f03eeef8e3ab50..2ef9966525cefbfaca089233e71a9c8f3a6a1ca4 100644 (file)
@@ -22,13 +22,14 @@ LL | |     }
    |
 help: try this
    |
-LL |     m.entry(k).or_insert_with(|| {
-LL |         if true {
-LL |             v
-LL |         } else {
-LL |             v2
-LL |         }
- ...
+LL ~     m.entry(k).or_insert_with(|| {
+LL +         if true {
+LL +             v
+LL +         } else {
+LL +             v2
+LL +         }
+LL +     });
+   |
 
 error: usage of `contains_key` followed by `insert` on a `HashMap`
   --> $DIR/entry.rs:38:5
@@ -44,13 +45,14 @@ LL | |     }
    |
 help: try this
    |
-LL |     m.entry(k).or_insert_with(|| {
-LL |         if true {
-LL |             v
-LL |         } else {
-LL |             v2
-LL |         }
- ...
+LL ~     m.entry(k).or_insert_with(|| {
+LL +         if true {
+LL +             v
+LL +         } else {
+LL +             v2
+LL +         }
+LL +     });
+   |
 
 error: usage of `contains_key` followed by `insert` on a `HashMap`
   --> $DIR/entry.rs:47:5
@@ -66,13 +68,15 @@ LL | |     }
    |
 help: try this
    |
-LL |     if let std::collections::hash_map::Entry::Vacant(e) = m.entry(k) {
-LL |         if true {
-LL |             e.insert(v);
-LL |         } else {
-LL |             e.insert(v2);
-LL |             return;
- ...
+LL ~     if let std::collections::hash_map::Entry::Vacant(e) = m.entry(k) {
+LL +         if true {
+LL +             e.insert(v);
+LL +         } else {
+LL +             e.insert(v2);
+LL +             return;
+LL +         }
+LL +     }
+   |
 
 error: usage of `contains_key` followed by `insert` on a `HashMap`
   --> $DIR/entry.rs:57:5
@@ -85,10 +89,10 @@ LL | |     }
    |
 help: try this
    |
-LL |     m.entry(k).or_insert_with(|| {
-LL |         foo();
-LL |         v
-LL |     });
+LL ~     m.entry(k).or_insert_with(|| {
+LL +         foo();
+LL +         v
+LL +     });
    |
 
 error: usage of `contains_key` followed by `insert` on a `HashMap`
@@ -105,13 +109,17 @@ LL | |     }
    |
 help: try this
    |
-LL |     m.entry(k).or_insert_with(|| {
-LL |         match 0 {
-LL |             1 if true => {
-LL |                 v
-LL |             },
-LL |             _ => {
- ...
+LL ~     m.entry(k).or_insert_with(|| {
+LL +         match 0 {
+LL +             1 if true => {
+LL +                 v
+LL +             },
+LL +             _ => {
+LL +                 v2
+LL +             },
+LL +         }
+LL +     });
+   |
 
 error: usage of `contains_key` followed by `insert` on a `HashMap`
   --> $DIR/entry.rs:75:5
@@ -127,13 +135,15 @@ LL | |     }
    |
 help: try this
    |
-LL |     if let std::collections::hash_map::Entry::Vacant(e) = m.entry(k) {
-LL |         match 0 {
-LL |             0 => foo(),
-LL |             _ => {
-LL |                 e.insert(v2);
-LL |             },
- ...
+LL ~     if let std::collections::hash_map::Entry::Vacant(e) = m.entry(k) {
+LL +         match 0 {
+LL +             0 => foo(),
+LL +             _ => {
+LL +                 e.insert(v2);
+LL +             },
+LL +         };
+LL +     }
+   |
 
 error: usage of `contains_key` followed by `insert` on a `HashMap`
   --> $DIR/entry.rs:85:5
@@ -149,13 +159,32 @@ LL | |     }
    |
 help: try this
    |
-LL |     m.entry(k).or_insert_with(|| {
-LL |         foo();
-LL |         match 0 {
-LL |             0 if false => {
-LL |                 v
-LL |             },
- ...
+LL ~     m.entry(k).or_insert_with(|| {
+LL +         foo();
+LL +         match 0 {
+LL +             0 if false => {
+LL +                 v
+LL +             },
+LL +             1 => {
+LL +                 foo();
+LL +                 v
+LL +             },
+LL +             2 | 3 => {
+LL +                 for _ in 0..2 {
+LL +                     foo();
+LL +                 }
+LL +                 if true {
+LL +                     v
+LL +                 } else {
+LL +                     v2
+LL +                 }
+LL +             },
+LL +             _ => {
+LL +                 v2
+LL +             },
+LL +         }
+LL +     });
+   |
 
 error: usage of `contains_key` followed by `insert` on a `HashMap`
   --> $DIR/entry.rs:119:5
@@ -165,21 +194,23 @@ LL | |         m.insert(m!(k), m!(v));
 LL | |     }
    | |_____^ help: try this: `m.entry(m!(k)).or_insert_with(|| m!(v));`
 
-error: usage of `contains_key` followed by `insert` on a `BTreeMap`
-  --> $DIR/entry.rs:153:5
+error: usage of `contains_key` followed by `insert` on a `HashMap`
+  --> $DIR/entry.rs:151:5
    |
 LL | /     if !m.contains_key(&k) {
+LL | |         let x = (String::new(), String::new());
+LL | |         let _ = x.0;
 LL | |         m.insert(k, v);
-LL | |         foo();
 LL | |     }
    | |_____^
    |
 help: try this
    |
-LL |     if let std::collections::btree_map::Entry::Vacant(e) = m.entry(k) {
-LL |         e.insert(v);
-LL |         foo();
-LL |     }
+LL ~     m.entry(k).or_insert_with(|| {
+LL +         let x = (String::new(), String::new());
+LL +         let _ = x.0;
+LL +         v
+LL +     });
    |
 
 error: aborting due to 10 previous errors