fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1error: the following explicit lifetimes could be elided: 'a, 'b 2 --> $DIR/needless_lifetimes.rs:17:23 3 | 4LL | fn distinct_lifetimes<'a, 'b>(_x: &'a u8, _y: &'b u8, _z: u8) {} 5 | ^^ ^^ ^^ ^^ 6 | 7 = note: `-D clippy::needless-lifetimes` implied by `-D warnings` 8 = help: to override `-D warnings` add `#[allow(clippy::needless_lifetimes)]` 9help: elide the lifetimes 10 | 11LL - fn distinct_lifetimes<'a, 'b>(_x: &'a u8, _y: &'b u8, _z: u8) {} 12LL + fn distinct_lifetimes(_x: &u8, _y: &u8, _z: u8) {} 13 | 14 15error: the following explicit lifetimes could be elided: 'a, 'b 16 --> $DIR/needless_lifetimes.rs:19:24 17 | 18LL | fn distinct_and_static<'a, 'b>(_x: &'a u8, _y: &'b u8, _z: &'static u8) {} 19 | ^^ ^^ ^^ ^^ 20 | 21help: elide the lifetimes 22 | 23LL - fn distinct_and_static<'a, 'b>(_x: &'a u8, _y: &'b u8, _z: &'static u8) {} 24LL + fn distinct_and_static(_x: &u8, _y: &u8, _z: &'static u8) {} 25 | 26 27error: the following explicit lifetimes could be elided: 'a 28 --> $DIR/needless_lifetimes.rs:29:15 29 | 30LL | fn in_and_out<'a>(x: &'a u8, _y: u8) -> &'a u8 { 31 | ^^ ^^ ^^ 32 | 33help: elide the lifetimes 34 | 35LL - fn in_and_out<'a>(x: &'a u8, _y: u8) -> &'a u8 { 36LL + fn in_and_out(x: &u8, _y: u8) -> &u8 { 37 | 38 39error: the following explicit lifetimes could be elided: 'b 40 --> $DIR/needless_lifetimes.rs:41:31 41 | 42LL | fn multiple_in_and_out_2a<'a, 'b>(x: &'a u8, _y: &'b u8) -> &'a u8 { 43 | ^^ ^^ 44 | 45help: elide the lifetimes 46 | 47LL - fn multiple_in_and_out_2a<'a, 'b>(x: &'a u8, _y: &'b u8) -> &'a u8 { 48LL + fn multiple_in_and_out_2a<'a>(x: &'a u8, _y: &u8) -> &'a u8 { 49 | 50 51error: the following explicit lifetimes could be elided: 'a 52 --> $DIR/needless_lifetimes.rs:48:27 53 | 54LL | fn multiple_in_and_out_2b<'a, 'b>(_x: &'a u8, y: &'b u8) -> &'b u8 { 55 | ^^ ^^ 56 | 57help: elide the lifetimes 58 | 59LL - fn multiple_in_and_out_2b<'a, 'b>(_x: &'a u8, y: &'b u8) -> &'b u8 { 60LL + fn multiple_in_and_out_2b<'b>(_x: &u8, y: &'b u8) -> &'b u8 { 61 | 62 63error: the following explicit lifetimes could be elided: 'b 64 --> $DIR/needless_lifetimes.rs:65:26 65 | 66LL | fn deep_reference_1a<'a, 'b>(x: &'a u8, _y: &'b u8) -> Result<&'a u8, ()> { 67 | ^^ ^^ 68 | 69help: elide the lifetimes 70 | 71LL - fn deep_reference_1a<'a, 'b>(x: &'a u8, _y: &'b u8) -> Result<&'a u8, ()> { 72LL + fn deep_reference_1a<'a>(x: &'a u8, _y: &u8) -> Result<&'a u8, ()> { 73 | 74 75error: the following explicit lifetimes could be elided: 'a 76 --> $DIR/needless_lifetimes.rs:72:22 77 | 78LL | fn deep_reference_1b<'a, 'b>(_x: &'a u8, y: &'b u8) -> Result<&'b u8, ()> { 79 | ^^ ^^ 80 | 81help: elide the lifetimes 82 | 83LL - fn deep_reference_1b<'a, 'b>(_x: &'a u8, y: &'b u8) -> Result<&'b u8, ()> { 84LL + fn deep_reference_1b<'b>(_x: &u8, y: &'b u8) -> Result<&'b u8, ()> { 85 | 86 87error: the following explicit lifetimes could be elided: 'a 88 --> $DIR/needless_lifetimes.rs:81:21 89 | 90LL | fn deep_reference_3<'a>(x: &'a u8, _y: u8) -> Result<&'a u8, ()> { 91 | ^^ ^^ ^^ 92 | 93help: elide the lifetimes 94 | 95LL - fn deep_reference_3<'a>(x: &'a u8, _y: u8) -> Result<&'a u8, ()> { 96LL + fn deep_reference_3(x: &u8, _y: u8) -> Result<&u8, ()> { 97 | 98 99error: the following explicit lifetimes could be elided: 'a 100 --> $DIR/needless_lifetimes.rs:86:28 101 | 102LL | fn where_clause_without_lt<'a, T>(x: &'a u8, _y: u8) -> Result<&'a u8, ()> 103 | ^^ ^^ ^^ 104 | 105help: elide the lifetimes 106 | 107LL - fn where_clause_without_lt<'a, T>(x: &'a u8, _y: u8) -> Result<&'a u8, ()> 108LL + fn where_clause_without_lt<T>(x: &u8, _y: u8) -> Result<&u8, ()> 109 | 110 111error: the following explicit lifetimes could be elided: 'a, 'b 112 --> $DIR/needless_lifetimes.rs:98:21 113 | 114LL | fn lifetime_param_2<'a, 'b>(_x: Ref<'a>, _y: &'b u8) {} 115 | ^^ ^^ ^^ ^^ 116 | 117help: elide the lifetimes 118 | 119LL - fn lifetime_param_2<'a, 'b>(_x: Ref<'a>, _y: &'b u8) {} 120LL + fn lifetime_param_2(_x: Ref<'_>, _y: &u8) {} 121 | 122 123error: the following explicit lifetimes could be elided: 'a 124 --> $DIR/needless_lifetimes.rs:122:15 125 | 126LL | fn fn_bound_2<'a, F, I>(_m: Lt<'a, I>, _f: F) -> Lt<'a, I> 127 | ^^ ^^ ^^ 128 | 129help: elide the lifetimes 130 | 131LL - fn fn_bound_2<'a, F, I>(_m: Lt<'a, I>, _f: F) -> Lt<'a, I> 132LL + fn fn_bound_2<F, I>(_m: Lt<'_, I>, _f: F) -> Lt<'_, I> 133 | 134 135error: the following explicit lifetimes could be elided: 's 136 --> $DIR/needless_lifetimes.rs:152:21 137 | 138LL | fn self_and_out<'s>(&'s self) -> &'s u8 { 139 | ^^ ^^ ^^ 140 | 141help: elide the lifetimes 142 | 143LL - fn self_and_out<'s>(&'s self) -> &'s u8 { 144LL + fn self_and_out(&self) -> &u8 { 145 | 146 147error: the following explicit lifetimes could be elided: 't 148 --> $DIR/needless_lifetimes.rs:159:30 149 | 150LL | fn self_and_in_out_1<'s, 't>(&'s self, _x: &'t u8) -> &'s u8 { 151 | ^^ ^^ 152 | 153help: elide the lifetimes 154 | 155LL - fn self_and_in_out_1<'s, 't>(&'s self, _x: &'t u8) -> &'s u8 { 156LL + fn self_and_in_out_1<'s>(&'s self, _x: &u8) -> &'s u8 { 157 | 158 159error: the following explicit lifetimes could be elided: 's 160 --> $DIR/needless_lifetimes.rs:166:26 161 | 162LL | fn self_and_in_out_2<'s, 't>(&'s self, x: &'t u8) -> &'t u8 { 163 | ^^ ^^ 164 | 165help: elide the lifetimes 166 | 167LL - fn self_and_in_out_2<'s, 't>(&'s self, x: &'t u8) -> &'t u8 { 168LL + fn self_and_in_out_2<'t>(&self, x: &'t u8) -> &'t u8 { 169 | 170 171error: the following explicit lifetimes could be elided: 's, 't 172 --> $DIR/needless_lifetimes.rs:170:29 173 | 174LL | fn distinct_self_and_in<'s, 't>(&'s self, _x: &'t u8) {} 175 | ^^ ^^ ^^ ^^ 176 | 177help: elide the lifetimes 178 | 179LL - fn distinct_self_and_in<'s, 't>(&'s self, _x: &'t u8) {} 180LL + fn distinct_self_and_in(&self, _x: &u8) {} 181 | 182 183error: the following explicit lifetimes could be elided: 'a 184 --> $DIR/needless_lifetimes.rs:189:19 185 | 186LL | fn struct_with_lt<'a>(_foo: Foo<'a>) -> &'a str { 187 | ^^ ^^ ^^ 188 | 189help: elide the lifetimes 190 | 191LL - fn struct_with_lt<'a>(_foo: Foo<'a>) -> &'a str { 192LL + fn struct_with_lt(_foo: Foo<'_>) -> &str { 193 | 194 195error: the following explicit lifetimes could be elided: 'b 196 --> $DIR/needless_lifetimes.rs:207:25 197 | 198LL | fn struct_with_lt4a<'a, 'b>(_foo: &'a Foo<'b>) -> &'a str { 199 | ^^ ^^ 200 | 201help: elide the lifetimes 202 | 203LL - fn struct_with_lt4a<'a, 'b>(_foo: &'a Foo<'b>) -> &'a str { 204LL + fn struct_with_lt4a<'a>(_foo: &'a Foo<'_>) -> &'a str { 205 | 206 207error: the following explicit lifetimes could be elided: 'a 208 --> $DIR/needless_lifetimes.rs:215:21 209 | 210LL | fn struct_with_lt4b<'a, 'b>(_foo: &'a Foo<'b>) -> &'b str { 211 | ^^ ^^ 212 | 213help: elide the lifetimes 214 | 215LL - fn struct_with_lt4b<'a, 'b>(_foo: &'a Foo<'b>) -> &'b str { 216LL + fn struct_with_lt4b<'b>(_foo: &Foo<'b>) -> &'b str { 217 | 218 219error: the following explicit lifetimes could be elided: 'a 220 --> $DIR/needless_lifetimes.rs:230:22 221 | 222LL | fn trait_obj_elided2<'a>(_arg: &'a dyn Drop) -> &'a str { 223 | ^^ ^^ ^^ 224 | 225help: elide the lifetimes 226 | 227LL - fn trait_obj_elided2<'a>(_arg: &'a dyn Drop) -> &'a str { 228LL + fn trait_obj_elided2(_arg: &dyn Drop) -> &str { 229 | 230 231error: the following explicit lifetimes could be elided: 'a 232 --> $DIR/needless_lifetimes.rs:236:18 233 | 234LL | fn alias_with_lt<'a>(_foo: FooAlias<'a>) -> &'a str { 235 | ^^ ^^ ^^ 236 | 237help: elide the lifetimes 238 | 239LL - fn alias_with_lt<'a>(_foo: FooAlias<'a>) -> &'a str { 240LL + fn alias_with_lt(_foo: FooAlias<'_>) -> &str { 241 | 242 243error: the following explicit lifetimes could be elided: 'b 244 --> $DIR/needless_lifetimes.rs:254:24 245 | 246LL | fn alias_with_lt4a<'a, 'b>(_foo: &'a FooAlias<'b>) -> &'a str { 247 | ^^ ^^ 248 | 249help: elide the lifetimes 250 | 251LL - fn alias_with_lt4a<'a, 'b>(_foo: &'a FooAlias<'b>) -> &'a str { 252LL + fn alias_with_lt4a<'a>(_foo: &'a FooAlias<'_>) -> &'a str { 253 | 254 255error: the following explicit lifetimes could be elided: 'a 256 --> $DIR/needless_lifetimes.rs:262:20 257 | 258LL | fn alias_with_lt4b<'a, 'b>(_foo: &'a FooAlias<'b>) -> &'b str { 259 | ^^ ^^ 260 | 261help: elide the lifetimes 262 | 263LL - fn alias_with_lt4b<'a, 'b>(_foo: &'a FooAlias<'b>) -> &'b str { 264LL + fn alias_with_lt4b<'b>(_foo: &FooAlias<'b>) -> &'b str { 265 | 266 267error: the following explicit lifetimes could be elided: 'a 268 --> $DIR/needless_lifetimes.rs:266:30 269 | 270LL | fn named_input_elided_output<'a>(_arg: &'a str) -> &str { 271 | ^^ ^^ ^ 272 | 273help: elide the lifetimes 274 | 275LL - fn named_input_elided_output<'a>(_arg: &'a str) -> &str { 276LL + fn named_input_elided_output(_arg: &str) -> &str { 277 | 278 279error: the following explicit lifetimes could be elided: 'a 280 --> $DIR/needless_lifetimes.rs:274:19 281 | 282LL | fn trait_bound_ok<'a, T: WithLifetime<'static>>(_: &'a u8, _: T) { 283 | ^^ ^^ 284 | 285help: elide the lifetimes 286 | 287LL - fn trait_bound_ok<'a, T: WithLifetime<'static>>(_: &'a u8, _: T) { 288LL + fn trait_bound_ok<T: WithLifetime<'static>>(_: &u8, _: T) { 289 | 290 291error: the following explicit lifetimes could be elided: 'a 292 --> $DIR/needless_lifetimes.rs:310:24 293 | 294LL | fn out_return_type_lts<'a>(e: &'a str) -> Cow<'a> { 295 | ^^ ^^ ^^ 296 | 297help: elide the lifetimes 298 | 299LL - fn out_return_type_lts<'a>(e: &'a str) -> Cow<'a> { 300LL + fn out_return_type_lts(e: &str) -> Cow<'_> { 301 | 302 303error: the following explicit lifetimes could be elided: 'a 304 --> $DIR/needless_lifetimes.rs:317:24 305 | 306LL | fn needless_lt<'a>(x: &'a u8) {} 307 | ^^ ^^ 308 | 309help: elide the lifetimes 310 | 311LL - fn needless_lt<'a>(x: &'a u8) {} 312LL + fn needless_lt(x: &u8) {} 313 | 314 315error: the following explicit lifetimes could be elided: 'a 316 --> $DIR/needless_lifetimes.rs:321:24 317 | 318LL | fn needless_lt<'a>(_x: &'a u8) {} 319 | ^^ ^^ 320 | 321help: elide the lifetimes 322 | 323LL - fn needless_lt<'a>(_x: &'a u8) {} 324LL + fn needless_lt(_x: &u8) {} 325 | 326 327error: the following explicit lifetimes could be elided: 'a 328 --> $DIR/needless_lifetimes.rs:334:16 329 | 330LL | fn baz<'a>(&'a self) -> impl Foo + 'a { 331 | ^^ ^^ ^^ 332 | 333help: elide the lifetimes 334 | 335LL - fn baz<'a>(&'a self) -> impl Foo + 'a { 336LL + fn baz(&self) -> impl Foo + '_ { 337 | 338 339error: the following explicit lifetimes could be elided: 'a 340 --> $DIR/needless_lifetimes.rs:366:55 341 | 342LL | fn impl_trait_elidable_nested_anonymous_lifetimes<'a>(i: &'a i32, f: impl Fn(&i32) -> &i32) -> &'a i32 { 343 | ^^ ^^ ^^ 344 | 345help: elide the lifetimes 346 | 347LL - fn impl_trait_elidable_nested_anonymous_lifetimes<'a>(i: &'a i32, f: impl Fn(&i32) -> &i32) -> &'a i32 { 348LL + fn impl_trait_elidable_nested_anonymous_lifetimes(i: &i32, f: impl Fn(&i32) -> &i32) -> &i32 { 349 | 350 351error: the following explicit lifetimes could be elided: 'a 352 --> $DIR/needless_lifetimes.rs:375:26 353 | 354LL | fn generics_elidable<'a, T: Fn(&i32) -> &i32>(i: &'a i32, f: T) -> &'a i32 { 355 | ^^ ^^ ^^ 356 | 357help: elide the lifetimes 358 | 359LL - fn generics_elidable<'a, T: Fn(&i32) -> &i32>(i: &'a i32, f: T) -> &'a i32 { 360LL + fn generics_elidable<T: Fn(&i32) -> &i32>(i: &i32, f: T) -> &i32 { 361 | 362 363error: the following explicit lifetimes could be elided: 'a 364 --> $DIR/needless_lifetimes.rs:387:32 365 | 366LL | fn where_clause_elidadable<'a, T>(i: &'a i32, f: T) -> &'a i32 367 | ^^ ^^ ^^ 368 | 369help: elide the lifetimes 370 | 371LL - fn where_clause_elidadable<'a, T>(i: &'a i32, f: T) -> &'a i32 372LL + fn where_clause_elidadable<T>(i: &i32, f: T) -> &i32 373 | 374 375error: the following explicit lifetimes could be elided: 'a 376 --> $DIR/needless_lifetimes.rs:402:28 377 | 378LL | fn pointer_fn_elidable<'a>(i: &'a i32, f: fn(&i32) -> &i32) -> &'a i32 { 379 | ^^ ^^ ^^ 380 | 381help: elide the lifetimes 382 | 383LL - fn pointer_fn_elidable<'a>(i: &'a i32, f: fn(&i32) -> &i32) -> &'a i32 { 384LL + fn pointer_fn_elidable(i: &i32, f: fn(&i32) -> &i32) -> &i32 { 385 | 386 387error: the following explicit lifetimes could be elided: 'a 388 --> $DIR/needless_lifetimes.rs:415:28 389 | 390LL | fn nested_fn_pointer_3<'a>(_: &'a i32) -> fn(fn(&i32) -> &i32) -> i32 { 391 | ^^ ^^ 392 | 393help: elide the lifetimes 394 | 395LL - fn nested_fn_pointer_3<'a>(_: &'a i32) -> fn(fn(&i32) -> &i32) -> i32 { 396LL + fn nested_fn_pointer_3(_: &i32) -> fn(fn(&i32) -> &i32) -> i32 { 397 | 398 399error: the following explicit lifetimes could be elided: 'a 400 --> $DIR/needless_lifetimes.rs:418:28 401 | 402LL | fn nested_fn_pointer_4<'a>(_: &'a i32) -> impl Fn(fn(&i32)) { 403 | ^^ ^^ 404 | 405help: elide the lifetimes 406 | 407LL - fn nested_fn_pointer_4<'a>(_: &'a i32) -> impl Fn(fn(&i32)) { 408LL + fn nested_fn_pointer_4(_: &i32) -> impl Fn(fn(&i32)) { 409 | 410 411error: the following explicit lifetimes could be elided: 'a 412 --> $DIR/needless_lifetimes.rs:440:21 413 | 414LL | fn implicit<'a>(&'a self) -> &'a () { 415 | ^^ ^^ ^^ 416 | 417help: elide the lifetimes 418 | 419LL - fn implicit<'a>(&'a self) -> &'a () { 420LL + fn implicit(&self) -> &() { 421 | 422 423error: the following explicit lifetimes could be elided: 'a 424 --> $DIR/needless_lifetimes.rs:443:25 425 | 426LL | fn implicit_mut<'a>(&'a mut self) -> &'a () { 427 | ^^ ^^ ^^ 428 | 429help: elide the lifetimes 430 | 431LL - fn implicit_mut<'a>(&'a mut self) -> &'a () { 432LL + fn implicit_mut(&mut self) -> &() { 433 | 434 435error: the following explicit lifetimes could be elided: 'a 436 --> $DIR/needless_lifetimes.rs:454:31 437 | 438LL | fn lifetime_elsewhere<'a>(self: Box<Self>, here: &'a ()) -> &'a () { 439 | ^^ ^^ ^^ 440 | 441help: elide the lifetimes 442 | 443LL - fn lifetime_elsewhere<'a>(self: Box<Self>, here: &'a ()) -> &'a () { 444LL + fn lifetime_elsewhere(self: Box<Self>, here: &()) -> &() { 445 | 446 447error: the following explicit lifetimes could be elided: 'a 448 --> $DIR/needless_lifetimes.rs:460:21 449 | 450LL | fn implicit<'a>(&'a self) -> &'a (); 451 | ^^ ^^ ^^ 452 | 453help: elide the lifetimes 454 | 455LL - fn implicit<'a>(&'a self) -> &'a (); 456LL + fn implicit(&self) -> &(); 457 | 458 459error: the following explicit lifetimes could be elided: 'a 460 --> $DIR/needless_lifetimes.rs:461:30 461 | 462LL | fn implicit_provided<'a>(&'a self) -> &'a () { 463 | ^^ ^^ ^^ 464 | 465help: elide the lifetimes 466 | 467LL - fn implicit_provided<'a>(&'a self) -> &'a () { 468LL + fn implicit_provided(&self) -> &() { 469 | 470 471error: the following explicit lifetimes could be elided: 'a 472 --> $DIR/needless_lifetimes.rs:470:31 473 | 474LL | fn lifetime_elsewhere<'a>(self: Box<Self>, here: &'a ()) -> &'a (); 475 | ^^ ^^ ^^ 476 | 477help: elide the lifetimes 478 | 479LL - fn lifetime_elsewhere<'a>(self: Box<Self>, here: &'a ()) -> &'a (); 480LL + fn lifetime_elsewhere(self: Box<Self>, here: &()) -> &(); 481 | 482 483error: the following explicit lifetimes could be elided: 'a 484 --> $DIR/needless_lifetimes.rs:471:40 485 | 486LL | fn lifetime_elsewhere_provided<'a>(self: Box<Self>, here: &'a ()) -> &'a () { 487 | ^^ ^^ ^^ 488 | 489help: elide the lifetimes 490 | 491LL - fn lifetime_elsewhere_provided<'a>(self: Box<Self>, here: &'a ()) -> &'a () { 492LL + fn lifetime_elsewhere_provided(self: Box<Self>, here: &()) -> &() { 493 | 494 495error: the following explicit lifetimes could be elided: 'a 496 --> $DIR/needless_lifetimes.rs:480:12 497 | 498LL | fn foo<'a>(x: &'a u8, y: &'_ u8) {} 499 | ^^ ^^ 500 | 501help: elide the lifetimes 502 | 503LL - fn foo<'a>(x: &'a u8, y: &'_ u8) {} 504LL + fn foo(x: &u8, y: &'_ u8) {} 505 | 506 507error: the following explicit lifetimes could be elided: 'a 508 --> $DIR/needless_lifetimes.rs:482:12 509 | 510LL | fn bar<'a>(x: &'a u8, y: &'_ u8, z: &'_ u8) {} 511 | ^^ ^^ 512 | 513help: elide the lifetimes 514 | 515LL - fn bar<'a>(x: &'a u8, y: &'_ u8, z: &'_ u8) {} 516LL + fn bar(x: &u8, y: &'_ u8, z: &'_ u8) {} 517 | 518 519error: the following explicit lifetimes could be elided: 'a 520 --> $DIR/needless_lifetimes.rs:489:18 521 | 522LL | fn one_input<'a>(x: &'a u8) -> &'a u8 { 523 | ^^ ^^ ^^ 524 | 525help: elide the lifetimes 526 | 527LL - fn one_input<'a>(x: &'a u8) -> &'a u8 { 528LL + fn one_input(x: &u8) -> &u8 { 529 | 530 531error: the following explicit lifetimes could be elided: 'a 532 --> $DIR/needless_lifetimes.rs:494:42 533 | 534LL | fn multiple_inputs_output_not_elided<'a, 'b>(x: &'a u8, y: &'b u8, z: &'b u8) -> &'b u8 { 535 | ^^ ^^ 536 | 537help: elide the lifetimes 538 | 539LL - fn multiple_inputs_output_not_elided<'a, 'b>(x: &'a u8, y: &'b u8, z: &'b u8) -> &'b u8 { 540LL + fn multiple_inputs_output_not_elided<'b>(x: &u8, y: &'b u8, z: &'b u8) -> &'b u8 { 541 | 542 543error: the following explicit lifetimes could be elided: 'a 544 --> $DIR/needless_lifetimes.rs:510:22 545 | 546LL | fn one_input<'a>(x: &'a u8) -> &'a u8 { 547 | ^^ ^^ ^^ 548 | 549 = note: this error originates in the macro `__inline_mac_mod_in_macro` (in Nightly builds, run with -Z macro-backtrace for more info) 550help: elide the lifetimes 551 | 552LL - fn one_input<'a>(x: &'a u8) -> &'a u8 { 553LL + fn one_input(x: &u8) -> &u8 { 554 | 555 556error: aborting due to 46 previous errors 557