fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #72883 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum49cae55760d

1.44.0
440 B18 linesraw
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
11fn a(x: &u32, y: &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
18fn main() { }