]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/manual_unwrap_or.stderr
Auto merge of #8374 - Alexendoo:bless-revisions, r=camsteffen
[rust.git] / tests / ui / manual_unwrap_or.stderr
index 6603ab43437d48412475eabfe5c18a4e42faef06..0e4cb798d455eaeb7e2be23442d57ee1cf10b646 100644 (file)
@@ -41,11 +41,11 @@ LL | |     };
    |
 help: replace with
    |
-LL |     Some(1).unwrap_or({
-LL |         42 + 42
-LL |             + 42 + 42 + 42
-LL |             + 42 + 42 + 42
-LL |     });
+LL ~     Some(1).unwrap_or({
+LL +         42 + 42
+LL +             + 42 + 42 + 42
+LL +             + 42 + 42 + 42
+LL ~     });
    |
 
 error: this pattern reimplements `Option::unwrap_or`
@@ -84,8 +84,17 @@ LL | |         Err(_) => 42,
 LL | |     };
    | |_____^ help: replace with: `(Ok(1) as Result<i32, &str>).unwrap_or(42)`
 
+error: this pattern reimplements `Option::unwrap_or`
+  --> $DIR/manual_unwrap_or.rs:112:5
+   |
+LL | /     match s.method() {
+LL | |         Some(i) => i,
+LL | |         None => 42,
+LL | |     };
+   | |_____^ help: replace with: `s.method().unwrap_or(42)`
+
 error: this pattern reimplements `Result::unwrap_or`
-  --> $DIR/manual_unwrap_or.rs:105:5
+  --> $DIR/manual_unwrap_or.rs:118:5
    |
 LL | /     match Ok::<i32, &str>(1) {
 LL | |         Err(_) => 42,
@@ -94,7 +103,7 @@ LL | |     };
    | |_____^ help: replace with: `Ok::<i32, &str>(1).unwrap_or(42)`
 
 error: this pattern reimplements `Result::unwrap_or`
-  --> $DIR/manual_unwrap_or.rs:111:5
+  --> $DIR/manual_unwrap_or.rs:124:5
    |
 LL | /     match Ok::<i32, &str>(1) {
 LL | |         Ok(i) => i,
@@ -103,7 +112,7 @@ LL | |     };
    | |_____^ help: replace with: `Ok::<i32, &str>(1).unwrap_or(1 + 42)`
 
 error: this pattern reimplements `Result::unwrap_or`
-  --> $DIR/manual_unwrap_or.rs:118:5
+  --> $DIR/manual_unwrap_or.rs:131:5
    |
 LL | /     match Ok::<i32, &str>(1) {
 LL | |         Ok(i) => i,
@@ -116,15 +125,15 @@ LL | |     };
    |
 help: replace with
    |
-LL |     Ok::<i32, &str>(1).unwrap_or({
-LL |         42 + 42
-LL |             + 42 + 42 + 42
-LL |             + 42 + 42 + 42
-LL |     });
+LL ~     Ok::<i32, &str>(1).unwrap_or({
+LL +         42 + 42
+LL +             + 42 + 42 + 42
+LL +             + 42 + 42 + 42
+LL ~     });
    |
 
 error: this pattern reimplements `Result::unwrap_or`
-  --> $DIR/manual_unwrap_or.rs:128:5
+  --> $DIR/manual_unwrap_or.rs:141:5
    |
 LL | /     match Ok::<&str, &str>("Bob") {
 LL | |         Ok(i) => i,
@@ -132,5 +141,15 @@ LL | |         Err(_) => "Alice",
 LL | |     };
    | |_____^ help: replace with: `Ok::<&str, &str>("Bob").unwrap_or("Alice")`
 
-error: aborting due to 12 previous errors
+error: this pattern reimplements `Option::unwrap_or`
+  --> $DIR/manual_unwrap_or.rs:201:17
+   |
+LL |           let _ = match some_macro!() {
+   |  _________________^
+LL | |             Some(val) => val,
+LL | |             None => 0,
+LL | |         };
+   | |_________^ help: replace with: `some_macro!().unwrap_or(0)`
+
+error: aborting due to 14 previous errors