summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/or_fun_call.stderr
blob: 4c5938ab88b90926c25c189063ad1b4ab1e268f5 (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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
error: use of `unwrap_or` followed by a function call
  --> $DIR/or_fun_call.rs:49:22
   |
LL |     with_constructor.unwrap_or(make());
   |                      ^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(make)`
   |
   = note: `-D clippy::or-fun-call` implied by `-D warnings`

error: use of `unwrap_or` followed by a call to `new`
  --> $DIR/or_fun_call.rs:52:14
   |
LL |     with_new.unwrap_or(Vec::new());
   |              ^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_default()`

error: use of `unwrap_or` followed by a function call
  --> $DIR/or_fun_call.rs:55:21
   |
LL |     with_const_args.unwrap_or(Vec::with_capacity(12));
   |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| Vec::with_capacity(12))`

error: use of `unwrap_or` followed by a function call
  --> $DIR/or_fun_call.rs:58:14
   |
LL |     with_err.unwrap_or(make());
   |              ^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|_| make())`

error: use of `unwrap_or` followed by a function call
  --> $DIR/or_fun_call.rs:61:19
   |
LL |     with_err_args.unwrap_or(Vec::with_capacity(12));
   |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|_| Vec::with_capacity(12))`

error: use of `unwrap_or` followed by a call to `default`
  --> $DIR/or_fun_call.rs:64:24
   |
LL |     with_default_trait.unwrap_or(Default::default());
   |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_default()`

error: use of `unwrap_or` followed by a call to `default`
  --> $DIR/or_fun_call.rs:67:23
   |
LL |     with_default_type.unwrap_or(u64::default());
   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_default()`

error: use of `unwrap_or` followed by a function call
  --> $DIR/or_fun_call.rs:70:18
   |
LL |     self_default.unwrap_or(<FakeDefault>::default());
   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(<FakeDefault>::default)`

error: use of `unwrap_or` followed by a call to `default`
  --> $DIR/or_fun_call.rs:73:18
   |
LL |     real_default.unwrap_or(<FakeDefault as Default>::default());
   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_default()`

error: use of `unwrap_or` followed by a call to `new`
  --> $DIR/or_fun_call.rs:76:14
   |
LL |     with_vec.unwrap_or(vec![]);
   |              ^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_default()`

error: use of `unwrap_or` followed by a function call
  --> $DIR/or_fun_call.rs:79:21
   |
LL |     without_default.unwrap_or(Foo::new());
   |                     ^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(Foo::new)`

error: use of `unwrap_or` followed by a function call
  --> $DIR/or_fun_call.rs:94:21
   |
LL |     let _ = stringy.unwrap_or("".to_owned());
   |                     ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| "".to_owned())`

error: use of `unwrap_or` followed by a function call
  --> $DIR/or_fun_call.rs:102:21
   |
LL |     let _ = Some(1).unwrap_or(map[&1]);
   |                     ^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| map[&1])`

error: use of `unwrap_or` followed by a function call
  --> $DIR/or_fun_call.rs:104:21
   |
LL |     let _ = Some(1).unwrap_or(map[&1]);
   |                     ^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| map[&1])`

error: use of `or` followed by a function call
  --> $DIR/or_fun_call.rs:128:35
   |
LL |     let _ = Some("a".to_string()).or(Some("b".to_string()));
   |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `or_else(|| Some("b".to_string()))`

error: use of `unwrap_or` followed by a function call
  --> $DIR/or_fun_call.rs:167:14
   |
LL |         None.unwrap_or(ptr_to_ref(s));
   |              ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| ptr_to_ref(s))`

error: use of `unwrap_or` followed by a function call
  --> $DIR/or_fun_call.rs:173:14
   |
LL |         None.unwrap_or(unsafe { ptr_to_ref(s) });
   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| unsafe { ptr_to_ref(s) })`

error: use of `unwrap_or` followed by a function call
  --> $DIR/or_fun_call.rs:175:14
   |
LL |         None.unwrap_or( unsafe { ptr_to_ref(s) }    );
   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| unsafe { ptr_to_ref(s) })`

error: use of `unwrap_or` followed by a call to `new`
  --> $DIR/or_fun_call.rs:189:14
   |
LL |             .unwrap_or(String::new());
   |              ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_default()`

error: use of `unwrap_or` followed by a call to `new`
  --> $DIR/or_fun_call.rs:202:14
   |
LL |             .unwrap_or(String::new());
   |              ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_default()`

error: use of `unwrap_or` followed by a call to `new`
  --> $DIR/or_fun_call.rs:214:14
   |
LL |             .unwrap_or(String::new());
   |              ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_default()`

error: use of `unwrap_or` followed by a call to `new`
  --> $DIR/or_fun_call.rs:225:10
   |
LL |         .unwrap_or(String::new());
   |          ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_default()`

error: aborting due to 22 previous errors