about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/elidable_lifetime_names.stderr
blob: a60dfc697564ee57a2b1e4001af7c158ab64427f (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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
error: the following explicit lifetimes could be elided: 'a, 'b
  --> tests/ui/elidable_lifetime_names.rs:9:21
   |
LL | fn lifetime_param_2<'a, 'b>(_x: Ref<'a>, _y: &'b u8) {}
   |                     ^^  ^^          ^^        ^^
   |
   = note: `-D clippy::elidable-lifetime-names` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::elidable_lifetime_names)]`
help: elide the lifetimes
   |
LL - fn lifetime_param_2<'a, 'b>(_x: Ref<'a>, _y: &'b u8) {}
LL + fn lifetime_param_2(_x: Ref<'_>, _y: &u8) {}
   |

error: the following explicit lifetimes could be elided: 'a
  --> tests/ui/elidable_lifetime_names.rs:34:15
   |
LL | fn fn_bound_2<'a, F, I>(_m: Lt<'a, I>, _f: F) -> Lt<'a, I>
   |               ^^               ^^                   ^^
   |
help: elide the lifetimes
   |
LL - fn fn_bound_2<'a, F, I>(_m: Lt<'a, I>, _f: F) -> Lt<'a, I>
LL + fn fn_bound_2<F, I>(_m: Lt<'_, I>, _f: F) -> Lt<'_, I>
   |

error: the following explicit lifetimes could be elided: 'a
  --> tests/ui/elidable_lifetime_names.rs:44:19
   |
LL | fn struct_with_lt<'a>(_foo: Foo<'a>) -> &'a str {
   |                   ^^            ^^       ^^
   |
help: elide the lifetimes
   |
LL - fn struct_with_lt<'a>(_foo: Foo<'a>) -> &'a str {
LL + fn struct_with_lt(_foo: Foo<'_>) -> &str {
   |

error: the following explicit lifetimes could be elided: 'b
  --> tests/ui/elidable_lifetime_names.rs:59:25
   |
LL | fn struct_with_lt4a<'a, 'b>(_foo: &'a Foo<'b>) -> &'a str {
   |                         ^^                ^^
   |
help: elide the lifetimes
   |
LL - fn struct_with_lt4a<'a, 'b>(_foo: &'a Foo<'b>) -> &'a str {
LL + fn struct_with_lt4a<'a>(_foo: &'a Foo<'_>) -> &'a str {
   |

error: the following explicit lifetimes could be elided: 'a
  --> tests/ui/elidable_lifetime_names.rs:66:18
   |
LL | fn alias_with_lt<'a>(_foo: FooAlias<'a>) -> &'a str {
   |                  ^^                 ^^       ^^
   |
help: elide the lifetimes
   |
LL - fn alias_with_lt<'a>(_foo: FooAlias<'a>) -> &'a str {
LL + fn alias_with_lt(_foo: FooAlias<'_>) -> &str {
   |

error: the following explicit lifetimes could be elided: 'b
  --> tests/ui/elidable_lifetime_names.rs:81:24
   |
LL | fn alias_with_lt4a<'a, 'b>(_foo: &'a FooAlias<'b>) -> &'a str {
   |                        ^^                     ^^
   |
help: elide the lifetimes
   |
LL - fn alias_with_lt4a<'a, 'b>(_foo: &'a FooAlias<'b>) -> &'a str {
LL + fn alias_with_lt4a<'a>(_foo: &'a FooAlias<'_>) -> &'a str {
   |

error: the following explicit lifetimes could be elided: 'a
  --> tests/ui/elidable_lifetime_names.rs:91:24
   |
LL | fn out_return_type_lts<'a>(e: &'a str) -> Cow<'a> {
   |                        ^^      ^^             ^^
   |
help: elide the lifetimes
   |
LL - fn out_return_type_lts<'a>(e: &'a str) -> Cow<'a> {
LL + fn out_return_type_lts(e: &str) -> Cow<'_> {
   |

error: the following explicit lifetimes could be elided: 'a
  --> tests/ui/elidable_lifetime_names.rs:103:10
   |
LL |     impl<'a> Foo for Baz<'a> {}
   |          ^^              ^^
   |
help: elide the lifetimes
   |
LL -     impl<'a> Foo for Baz<'a> {}
LL +     impl Foo for Baz<'_> {}
   |

error: the following explicit lifetimes could be elided: 'a
  --> tests/ui/elidable_lifetime_names.rs:106:16
   |
LL |         fn baz<'a>(&'a self) -> impl Foo + 'a {
   |                ^^   ^^                     ^^
   |
help: elide the lifetimes
   |
LL -         fn baz<'a>(&'a self) -> impl Foo + 'a {
LL +         fn baz(&self) -> impl Foo + '_ {
   |

error: the following explicit lifetimes could be elided: 'py
  --> tests/ui/elidable_lifetime_names.rs:139:14
   |
LL |     impl<'t, 'py> ContentString<'t> {
   |              ^^^
LL |         // `'py` can be elided because of `&self`
LL |         fn map_content2(&self, f: impl FnOnce(&'t str) -> &'t str) -> Content<'t, 'py> {
   |                                                                                   ^^^
   |
help: elide the lifetimes
   |
LL ~     impl<'t> ContentString<'t> {
LL |         // `'py` can be elided because of `&self`
LL ~         fn map_content2(&self, f: impl FnOnce(&'t str) -> &'t str) -> Content<'t, '_> {
   |

error: the following explicit lifetimes could be elided: 'py
  --> tests/ui/elidable_lifetime_names.rs:150:14
   |
LL |     impl<'t, 'py> ContentString<'t> {
   |              ^^^
LL |         // `'py` can be elided because of `&'_ self`
LL |         fn map_content3(&'_ self, f: impl FnOnce(&'t str) -> &'t str) -> Content<'t, 'py> {
   |                                                                                      ^^^
   |
help: elide the lifetimes
   |
LL ~     impl<'t> ContentString<'t> {
LL |         // `'py` can be elided because of `&'_ self`
LL ~         fn map_content3(&'_ self, f: impl FnOnce(&'t str) -> &'t str) -> Content<'t, '_> {
   |

error: the following explicit lifetimes could be elided: 'py
  --> tests/ui/elidable_lifetime_names.rs:171:14
   |
LL |     impl<'t, 'py> ContentString<'t> {
   |              ^^^
...
LL |         ) -> Content<'t, 'py> {
   |                          ^^^
   |
help: elide the lifetimes
   |
LL ~     impl<'t> ContentString<'t> {
LL |         // `'py` can be elided because of `&Self`
...
LL |             o: &'t str,
LL ~         ) -> Content<'t, '_> {
   |

error: aborting due to 12 previous errors