]> git.lizzy.rs Git - rust.git/blob - tests/ui/expect_fun_call.stderr
Auto merge of #3529 - matthiaskrgr:rustfmt_tests, r=phansch
[rust.git] / tests / ui / expect_fun_call.stderr
1 error: use of `expect` followed by a function call
2   --> $DIR/expect_fun_call.rs:36:26
3    |
4 36 |     with_none_and_format.expect(&format!("Error {}: fake error", error_code));
5    |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| panic!("Error {}: fake error", error_code))`
6    |
7    = note: `-D clippy::expect-fun-call` implied by `-D warnings`
8
9 error: use of `expect` followed by a function call
10   --> $DIR/expect_fun_call.rs:39:26
11    |
12 39 |     with_none_and_as_str.expect(format!("Error {}: fake error", error_code).as_str());
13    |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| panic!("Error {}: fake error", error_code))`
14
15 error: use of `expect` followed by a function call
16   --> $DIR/expect_fun_call.rs:49:25
17    |
18 49 |     with_err_and_format.expect(&format!("Error {}: fake error", error_code));
19    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|_| panic!("Error {}: fake error", error_code))`
20
21 error: use of `expect` followed by a function call
22   --> $DIR/expect_fun_call.rs:52:25
23    |
24 52 |     with_err_and_as_str.expect(format!("Error {}: fake error", error_code).as_str());
25    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|_| panic!("Error {}: fake error", error_code))`
26
27 error: use of `expect` followed by a function call
28   --> $DIR/expect_fun_call.rs:67:17
29    |
30 67 |     Some("foo").expect({ &format!("error") });
31    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| { let msg = { &format!("error") }; panic!(msg) }))`
32
33 error: use of `expect` followed by a function call
34   --> $DIR/expect_fun_call.rs:68:17
35    |
36 68 |     Some("foo").expect(format!("error").as_ref());
37    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| panic!("error"))`
38
39 error: aborting due to 6 previous errors
40