//@ revisions: current next //@ ignore-compare-mode-next-solver (explicit revisions) //@[next] compile-flags: -Znext-solver use std::fmt::Display; trait Static: 'static {} impl Static for &'static T {} fn foo(x: S) -> Box where &'static S: Static, { Box::new(x) } fn main() { let s = foo(&String::from("blah blah blah")); //~^ ERROR temporary value dropped while borrowed println!("{}", s); }