rust/tests/ui/traits/new-solver/borrowck-error.rs

12 lines
206 B
Rust

// compile-flags: -Ztrait-solver=next
use std::collections::HashMap;
fn foo() -> &'static HashMap<i32, i32>
{
&HashMap::new()
//~^ ERROR cannot return reference to temporary value
}
fn main() {}