]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/expect_fun_call.stderr
Auto merge of #97944 - nikic:freebsd-update, r=Mark-Simulacrum
[rust.git] / src / tools / clippy / tests / ui / expect_fun_call.stderr
1 error: use of `expect` followed by a function call
2   --> $DIR/expect_fun_call.rs:35:26
3    |
4 LL |     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:38:26
11    |
12 LL |     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:41:37
17    |
18 LL |     with_none_and_format_with_macro.expect(format!("Error {}: fake error", one!()).as_str());
19    |                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| panic!("Error {}: fake error", one!()))`
20
21 error: use of `expect` followed by a function call
22   --> $DIR/expect_fun_call.rs:51:25
23    |
24 LL |     with_err_and_format.expect(&format!("Error {}: fake error", error_code));
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:54:25
29    |
30 LL |     with_err_and_as_str.expect(format!("Error {}: fake error", error_code).as_str());
31    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|_| panic!("Error {}: fake error", error_code))`
32
33 error: use of `expect` followed by a function call
34   --> $DIR/expect_fun_call.rs:66:17
35    |
36 LL |     Some("foo").expect(format!("{} {}", 1, 2).as_ref());
37    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| panic!("{} {}", 1, 2))`
38
39 error: use of `expect` followed by a function call
40   --> $DIR/expect_fun_call.rs:87:21
41    |
42 LL |         Some("foo").expect(&get_string());
43    |                     ^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| { panic!("{}", get_string()) })`
44
45 error: use of `expect` followed by a function call
46   --> $DIR/expect_fun_call.rs:88:21
47    |
48 LL |         Some("foo").expect(get_string().as_ref());
49    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| { panic!("{}", get_string()) })`
50
51 error: use of `expect` followed by a function call
52   --> $DIR/expect_fun_call.rs:89:21
53    |
54 LL |         Some("foo").expect(get_string().as_str());
55    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| { panic!("{}", get_string()) })`
56
57 error: use of `expect` followed by a function call
58   --> $DIR/expect_fun_call.rs:91:21
59    |
60 LL |         Some("foo").expect(get_static_str());
61    |                     ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| { panic!("{}", get_static_str()) })`
62
63 error: use of `expect` followed by a function call
64   --> $DIR/expect_fun_call.rs:92:21
65    |
66 LL |         Some("foo").expect(get_non_static_str(&0));
67    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| { panic!("{}", get_non_static_str(&0).to_string()) })`
68
69 error: use of `expect` followed by a function call
70   --> $DIR/expect_fun_call.rs:96:16
71    |
72 LL |     Some(true).expect(&format!("key {}, {}", 1, 2));
73    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| panic!("key {}, {}", 1, 2))`
74
75 error: use of `expect` followed by a function call
76   --> $DIR/expect_fun_call.rs:102:17
77    |
78 LL |         opt_ref.expect(&format!("{:?}", opt_ref));
79    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| panic!("{:?}", opt_ref))`
80
81 error: aborting due to 13 previous errors
82