]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/or_fun_call.stderr
Rollup merge of #102581 - jyn514:src-detection, r=Mark-Simulacrum
[rust.git] / src / tools / clippy / tests / ui / or_fun_call.stderr
1 error: use of `unwrap_or` followed by a function call
2   --> $DIR/or_fun_call.rs:48:22
3    |
4 LL |     with_constructor.unwrap_or(make());
5    |                      ^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(make)`
6    |
7    = note: `-D clippy::or-fun-call` implied by `-D warnings`
8
9 error: use of `unwrap_or` followed by a call to `new`
10   --> $DIR/or_fun_call.rs:51:14
11    |
12 LL |     with_new.unwrap_or(Vec::new());
13    |              ^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_default()`
14
15 error: use of `unwrap_or` followed by a function call
16   --> $DIR/or_fun_call.rs:54:21
17    |
18 LL |     with_const_args.unwrap_or(Vec::with_capacity(12));
19    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| Vec::with_capacity(12))`
20
21 error: use of `unwrap_or` followed by a function call
22   --> $DIR/or_fun_call.rs:57:14
23    |
24 LL |     with_err.unwrap_or(make());
25    |              ^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|_| make())`
26
27 error: use of `unwrap_or` followed by a function call
28   --> $DIR/or_fun_call.rs:60:19
29    |
30 LL |     with_err_args.unwrap_or(Vec::with_capacity(12));
31    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|_| Vec::with_capacity(12))`
32
33 error: use of `unwrap_or` followed by a call to `default`
34   --> $DIR/or_fun_call.rs:63:24
35    |
36 LL |     with_default_trait.unwrap_or(Default::default());
37    |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_default()`
38
39 error: use of `unwrap_or` followed by a call to `default`
40   --> $DIR/or_fun_call.rs:66:23
41    |
42 LL |     with_default_type.unwrap_or(u64::default());
43    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_default()`
44
45 error: use of `unwrap_or` followed by a function call
46   --> $DIR/or_fun_call.rs:69:18
47    |
48 LL |     self_default.unwrap_or(<FakeDefault>::default());
49    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(<FakeDefault>::default)`
50
51 error: use of `unwrap_or` followed by a call to `default`
52   --> $DIR/or_fun_call.rs:72:18
53    |
54 LL |     real_default.unwrap_or(<FakeDefault as Default>::default());
55    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_default()`
56
57 error: use of `unwrap_or` followed by a call to `new`
58   --> $DIR/or_fun_call.rs:75:14
59    |
60 LL |     with_vec.unwrap_or(vec![]);
61    |              ^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_default()`
62
63 error: use of `unwrap_or` followed by a function call
64   --> $DIR/or_fun_call.rs:78:21
65    |
66 LL |     without_default.unwrap_or(Foo::new());
67    |                     ^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(Foo::new)`
68
69 error: use of `or_insert` followed by a call to `new`
70   --> $DIR/or_fun_call.rs:81:19
71    |
72 LL |     map.entry(42).or_insert(String::new());
73    |                   ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `or_default()`
74
75 error: use of `or_insert` followed by a call to `new`
76   --> $DIR/or_fun_call.rs:84:23
77    |
78 LL |     map_vec.entry(42).or_insert(vec![]);
79    |                       ^^^^^^^^^^^^^^^^^ help: try this: `or_default()`
80
81 error: use of `or_insert` followed by a call to `new`
82   --> $DIR/or_fun_call.rs:87:21
83    |
84 LL |     btree.entry(42).or_insert(String::new());
85    |                     ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `or_default()`
86
87 error: use of `or_insert` followed by a call to `new`
88   --> $DIR/or_fun_call.rs:90:25
89    |
90 LL |     btree_vec.entry(42).or_insert(vec![]);
91    |                         ^^^^^^^^^^^^^^^^^ help: try this: `or_default()`
92
93 error: use of `unwrap_or` followed by a call to `new`
94   --> $DIR/or_fun_call.rs:93:21
95    |
96 LL |     let _ = stringy.unwrap_or(String::new());
97    |                     ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_default()`
98
99 error: use of `unwrap_or` followed by a function call
100   --> $DIR/or_fun_call.rs:101:21
101    |
102 LL |     let _ = Some(1).unwrap_or(map[&1]);
103    |                     ^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| map[&1])`
104
105 error: use of `unwrap_or` followed by a function call
106   --> $DIR/or_fun_call.rs:103:21
107    |
108 LL |     let _ = Some(1).unwrap_or(map[&1]);
109    |                     ^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| map[&1])`
110
111 error: use of `or` followed by a function call
112   --> $DIR/or_fun_call.rs:127:35
113    |
114 LL |     let _ = Some("a".to_string()).or(Some("b".to_string()));
115    |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `or_else(|| Some("b".to_string()))`
116
117 error: use of `unwrap_or` followed by a function call
118   --> $DIR/or_fun_call.rs:166:14
119    |
120 LL |         None.unwrap_or(ptr_to_ref(s));
121    |              ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| ptr_to_ref(s))`
122
123 error: use of `unwrap_or` followed by a function call
124   --> $DIR/or_fun_call.rs:172:14
125    |
126 LL |         None.unwrap_or(unsafe { ptr_to_ref(s) });
127    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| unsafe { ptr_to_ref(s) })`
128
129 error: use of `unwrap_or` followed by a function call
130   --> $DIR/or_fun_call.rs:174:14
131    |
132 LL |         None.unwrap_or( unsafe { ptr_to_ref(s) }    );
133    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| unsafe { ptr_to_ref(s) })`
134
135 error: use of `unwrap_or` followed by a call to `new`
136   --> $DIR/or_fun_call.rs:188:14
137    |
138 LL |             .unwrap_or(String::new());
139    |              ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_default()`
140
141 error: use of `unwrap_or` followed by a call to `new`
142   --> $DIR/or_fun_call.rs:201:14
143    |
144 LL |             .unwrap_or(String::new());
145    |              ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_default()`
146
147 error: use of `unwrap_or` followed by a call to `new`
148   --> $DIR/or_fun_call.rs:213:14
149    |
150 LL |             .unwrap_or(String::new());
151    |              ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_default()`
152
153 error: use of `unwrap_or` followed by a call to `new`
154   --> $DIR/or_fun_call.rs:224:10
155    |
156 LL |         .unwrap_or(String::new());
157    |          ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_default()`
158
159 error: aborting due to 26 previous errors
160