]> git.proxmox.com Git - rustc.git/blame - src/tools/clippy/tests/ui/or_fun_call.stderr
Merge tag 'debian/1.52.1+dfsg1-1_exp2' into proxmox/buster
[rustc.git] / src / tools / clippy / tests / ui / or_fun_call.stderr
CommitLineData
f20569fa
XL
1error: use of `unwrap_or` followed by a function call
2 --> $DIR/or_fun_call.rs:33:19
3 |
4LL | with_const_fn.unwrap_or(Duration::from_secs(5));
5 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| Duration::from_secs(5))`
6 |
7 = note: `-D clippy::or-fun-call` implied by `-D warnings`
8
9error: use of `unwrap_or` followed by a function call
10 --> $DIR/or_fun_call.rs:36:22
11 |
12LL | with_constructor.unwrap_or(make());
13 | ^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(make)`
14
15error: use of `unwrap_or` followed by a call to `new`
16 --> $DIR/or_fun_call.rs:39:5
17 |
18LL | with_new.unwrap_or(Vec::new());
19 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_new.unwrap_or_default()`
20
21error: use of `unwrap_or` followed by a function call
22 --> $DIR/or_fun_call.rs:42:21
23 |
24LL | with_const_args.unwrap_or(Vec::with_capacity(12));
25 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| Vec::with_capacity(12))`
26
27error: use of `unwrap_or` followed by a function call
28 --> $DIR/or_fun_call.rs:45:14
29 |
30LL | with_err.unwrap_or(make());
31 | ^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|_| make())`
32
33error: use of `unwrap_or` followed by a function call
34 --> $DIR/or_fun_call.rs:48:19
35 |
36LL | with_err_args.unwrap_or(Vec::with_capacity(12));
37 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|_| Vec::with_capacity(12))`
38
39error: use of `unwrap_or` followed by a call to `default`
40 --> $DIR/or_fun_call.rs:51:5
41 |
42LL | with_default_trait.unwrap_or(Default::default());
43 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_default_trait.unwrap_or_default()`
44
45error: use of `unwrap_or` followed by a call to `default`
46 --> $DIR/or_fun_call.rs:54:5
47 |
48LL | with_default_type.unwrap_or(u64::default());
49 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_default_type.unwrap_or_default()`
50
51error: use of `unwrap_or` followed by a call to `new`
52 --> $DIR/or_fun_call.rs:57:5
53 |
54LL | with_vec.unwrap_or(vec![]);
55 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `with_vec.unwrap_or_default()`
56
57error: use of `unwrap_or` followed by a function call
58 --> $DIR/or_fun_call.rs:60:21
59 |
60LL | without_default.unwrap_or(Foo::new());
61 | ^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(Foo::new)`
62
63error: use of `or_insert` followed by a function call
64 --> $DIR/or_fun_call.rs:63:19
65 |
66LL | map.entry(42).or_insert(String::new());
67 | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `or_insert_with(String::new)`
68
69error: use of `or_insert` followed by a function call
70 --> $DIR/or_fun_call.rs:66:23
71 |
72LL | map_vec.entry(42).or_insert(vec![]);
73 | ^^^^^^^^^^^^^^^^^ help: try this: `or_insert_with(Vec::new)`
74
75error: use of `or_insert` followed by a function call
76 --> $DIR/or_fun_call.rs:69:21
77 |
78LL | btree.entry(42).or_insert(String::new());
79 | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `or_insert_with(String::new)`
80
81error: use of `or_insert` followed by a function call
82 --> $DIR/or_fun_call.rs:72:25
83 |
84LL | btree_vec.entry(42).or_insert(vec![]);
85 | ^^^^^^^^^^^^^^^^^ help: try this: `or_insert_with(Vec::new)`
86
87error: use of `unwrap_or` followed by a function call
88 --> $DIR/or_fun_call.rs:75:21
89 |
90LL | let _ = stringy.unwrap_or("".to_owned());
91 | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| "".to_owned())`
92
93error: use of `unwrap_or` followed by a function call
94 --> $DIR/or_fun_call.rs:83:21
95 |
96LL | let _ = Some(1).unwrap_or(map[&1]);
97 | ^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| map[&1])`
98
99error: use of `unwrap_or` followed by a function call
100 --> $DIR/or_fun_call.rs:85:21
101 |
102LL | let _ = Some(1).unwrap_or(map[&1]);
103 | ^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|| map[&1])`
104
105error: use of `or` followed by a function call
106 --> $DIR/or_fun_call.rs:109:35
107 |
108LL | let _ = Some("a".to_string()).or(Some("b".to_string()));
109 | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `or_else(|| Some("b".to_string()))`
110
111error: use of `or` followed by a function call
112 --> $DIR/or_fun_call.rs:113:10
113 |
114LL | .or(Some(Bar(b, Duration::from_secs(2))));
115 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `or_else(|| Some(Bar(b, Duration::from_secs(2))))`
116
117error: aborting due to 19 previous errors
118