mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-02 18:27:37 +00:00
17 lines
328 B
Rust
17 lines
328 B
Rust
#![feature(explicit_tail_calls)]
|
|
#![expect(incomplete_features)]
|
|
|
|
fn link(x: &str) -> &'static str {
|
|
become passthrough(x);
|
|
//~^ ERROR lifetime may not live long enough
|
|
}
|
|
|
|
fn passthrough<T>(t: T) -> T { t }
|
|
|
|
fn main() {
|
|
let x = String::from("hello, world");
|
|
let s = link(&x);
|
|
drop(x);
|
|
println!("{s}");
|
|
}
|