2023-10-04 16:58:38 -05:00
|
|
|
//@ revisions: current next
|
2024-03-10 20:18:41 -05:00
|
|
|
//@ ignore-compare-mode-next-solver (explicit revisions)
|
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
|
2024-06-21 00:15:36 -05:00
|
|
|
//@ normalize-stderr-test: "DefId\([^\)]+\)" -> "DefId(..)"
|
2023-10-04 18:08:05 -05:00
|
|
|
|
|
|
|
#![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 {
|
2024-03-18 03:33:24 -05:00
|
|
|
//~^ ERROR '{erased}>::{closure#0} closure_kind_ty=i8 closure_sig_as_fn_ptr_ty=extern "rust-call" fn(()) upvar_tys=()}
|
2024-03-12 10:53:35 -05:00
|
|
|
// Can't write whole type because of lack of path sanitization
|
2023-10-04 16:58:38 -05:00
|
|
|
|| ()
|
|
|
|
}
|
|
|
|
|
|
|
|
fn bar() -> impl Fn() + 'static {
|
2024-03-12 10:53:35 -05:00
|
|
|
//~^ ERROR , ['{erased}])
|
|
|
|
// Can't write whole type because of lack of path sanitization
|
2023-10-04 16:58:38 -05:00
|
|
|
foo(&vec![])
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|