Files
rust/src/test/ui/issues/issue-46983.rs

12 lines
324 B
Rust
Raw Normal View History

2022-05-22 01:02:55 -04:00
// revisions: base nll
// ignore-compare-mode-nll
//[nll] compile-flags: -Z borrowck=mir
2018-01-10 17:12:23 +00:00
fn foo(x: &u32) -> &'static u32 {
&*x
2022-05-22 01:02:55 -04:00
//[base]~^ ERROR `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement [E0759]
//[nll]~^^ ERROR lifetime may not live long enough
2018-01-10 17:12:23 +00:00
}
fn main() {}