summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/expect_fun_call.stderr
blob: aca15935fca06596dca5f84edebe35b693baaa15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
error: use of `expect` followed by a function call
  --> $DIR/expect_fun_call.rs:35:26
   |
LL |     with_none_and_format.expect(&format!("Error {}: fake error", error_code));
   |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| panic!("Error {}: fake error", error_code))`
   |
   = note: `-D clippy::expect-fun-call` implied by `-D warnings`

error: use of `expect` followed by a function call
  --> $DIR/expect_fun_call.rs:38:26
   |
LL |     with_none_and_as_str.expect(format!("Error {}: fake error", error_code).as_str());
   |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| panic!("Error {}: fake error", error_code))`

error: use of `expect` followed by a function call
  --> $DIR/expect_fun_call.rs:41:37
   |
LL |     with_none_and_format_with_macro.expect(format!("Error {}: fake error", one!()).as_str());
   |                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| panic!("Error {}: fake error", one!()))`

error: use of `expect` followed by a function call
  --> $DIR/expect_fun_call.rs:51:25
   |
LL |     with_err_and_format.expect(&format!("Error {}: fake error", error_code));
   |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|_| panic!("Error {}: fake error", error_code))`

error: use of `expect` followed by a function call
  --> $DIR/expect_fun_call.rs:54:25
   |
LL |     with_err_and_as_str.expect(format!("Error {}: fake error", error_code).as_str());
   |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|_| panic!("Error {}: fake error", error_code))`

error: use of `expect` followed by a function call
  --> $DIR/expect_fun_call.rs:66:17
   |
LL |     Some("foo").expect(format!("{} {}", 1, 2).as_ref());
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| panic!("{} {}", 1, 2))`

error: use of `expect` followed by a function call
  --> $DIR/expect_fun_call.rs:87:21
   |
LL |         Some("foo").expect(&get_string());
   |                     ^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| { panic!("{}", get_string()) })`

error: use of `expect` followed by a function call
  --> $DIR/expect_fun_call.rs:88:21
   |
LL |         Some("foo").expect(get_string().as_ref());
   |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| { panic!("{}", get_string()) })`

error: use of `expect` followed by a function call
  --> $DIR/expect_fun_call.rs:89:21
   |
LL |         Some("foo").expect(get_string().as_str());
   |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| { panic!("{}", get_string()) })`

error: use of `expect` followed by a function call
  --> $DIR/expect_fun_call.rs:91:21
   |
LL |         Some("foo").expect(get_static_str());
   |                     ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| { panic!("{}", get_static_str()) })`

error: use of `expect` followed by a function call
  --> $DIR/expect_fun_call.rs:92:21
   |
LL |         Some("foo").expect(get_non_static_str(&0));
   |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| { panic!("{}", get_non_static_str(&0).to_string()) })`

error: use of `expect` followed by a function call
  --> $DIR/expect_fun_call.rs:96:16
   |
LL |     Some(true).expect(&format!("key {}, {}", 1, 2));
   |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| panic!("key {}, {}", 1, 2))`

error: use of `expect` followed by a function call
  --> $DIR/expect_fun_call.rs:102:17
   |
LL |         opt_ref.expect(&format!("{:?}", opt_ref));
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| panic!("{:?}", opt_ref))`

error: aborting due to 13 previous errors