rust/tests/ui/regions/regions-free-region-outlives-static-outlives-free-region.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
287 B
Rust
Raw Normal View History

// run-pass
#![allow(dead_code)]
// Test that we recognize that if you have
//
// 'a : 'static
//
// then
//
// 'a : 'b
#![warn(unused_lifetimes)]
fn test<'a,'b>(x: &'a i32) -> &'b i32
2022-03-14 09:56:37 -05:00
where 'a: 'static //~ WARN unnecessary lifetime parameter `'a`
{
x
}
fn main() { }