2023-10-04 16:58:38 -05:00
|
|
|
// revisions: current next
|
2023-12-19 11:39:58 -06:00
|
|
|
// compile-flags: -Zverbose-internals
|
2023-12-14 06:11:28 -06:00
|
|
|
//[next] compile-flags: -Znext-solver
|
2023-10-04 18:08:05 -05:00
|
|
|
// normalize-stderr-test "DefId\([^\)]+\)" -> "DefId(..)"
|
|
|
|
|
|
|
|
#![feature(rustc_attrs)]
|
|
|
|
#![rustc_hidden_type_of_opaques]
|
2023-10-04 16:58:38 -05:00
|
|
|
|
|
|
|
// Make sure that the compiler can handle `ReErased` in the hidden type of an opaque.
|
|
|
|
|
|
|
|
fn foo<'a: 'a>(x: &'a Vec<i32>) -> impl Fn() + 'static {
|
2023-10-04 18:08:05 -05:00
|
|
|
//~^ ERROR 0, 'a)>::{closure#0} closure_kind_ty=i8 closure_sig_as_fn_ptr_ty=extern "rust-call" fn(()) upvar_tys=()}
|
|
|
|
// Can't write whole type because of lack of path sanitization
|
2023-10-04 16:58:38 -05:00
|
|
|
|| ()
|
|
|
|
}
|
|
|
|
|
|
|
|
fn bar() -> impl Fn() + 'static {
|
2023-10-04 18:08:05 -05:00
|
|
|
//~^ ERROR , [ReErased])
|
|
|
|
// Can't write whole type because of lack of path sanitization
|
2023-10-04 16:58:38 -05:00
|
|
|
foo(&vec![])
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|