]> git.lizzy.rs Git - rust.git/blob - src/test/ui/single-use-lifetime/one-use-in-fn-argument-in-band.rs
Special sync of 'e89801553ddbaccdeb2eac4db08900edb51ac7ff'
[rust.git] / src / test / ui / single-use-lifetime / one-use-in-fn-argument-in-band.rs
1 // run-rustfix
2
3 #![feature(in_band_lifetimes)]
4 #![deny(single_use_lifetimes)]
5 #![allow(dead_code)]
6 #![allow(unused_variables)]
7
8 // Test that we DO warn when lifetime name is used only
9 // once in a fn argument, even with in band lifetimes.
10
11 fn a(x: &'a u32, y: &'b u32) {
12     //~^ ERROR `'a` only used once
13     //~| ERROR `'b` only used once
14     //~| HELP elide the single-use lifetime
15     //~| HELP elide the single-use lifetime
16 }
17
18 fn main() { }