mirror of
https://github.com/allankoechke/rust.git
synced 2026-12-05 09:23:31 +00:00
Rollup merge of #159614 - amirHdev:fix-unsafe-binder-debuginfo, r=JohnTitor
debuginfo generation for unsafe binders debug-info generation removed an unsafe binder which allowed bound regions to escape into layout and trait queries while constructing the inner debug info type instantiate those bound regions with erased regions before constructing the inner debug info node Fix rust-lang/rust#159576
This commit is contained in:
@@ -1635,7 +1635,7 @@ fn build_unsafe_binder_type_di_node<'ll, 'tcx>(
|
||||
binder_type
|
||||
)
|
||||
};
|
||||
let inner_type = inner.skip_binder();
|
||||
let inner_type = cx.tcx.instantiate_bound_regions_with_erased((*inner).into());
|
||||
let inner_type_di_node = type_di_node(cx, inner_type);
|
||||
|
||||
let type_name = compute_debuginfo_type_name(cx.tcx, binder_type, true);
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
//@ check-pass
|
||||
//@ compile-flags: --crate-type=lib -Cdebuginfo=2
|
||||
|
||||
#![feature(unsafe_binders)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
pub fn woof() -> unsafe<'a, 'b> &'b Box<dyn Fn(Box<dyn Fn() -> &'a isize>)> {
|
||||
todo!()
|
||||
}
|
||||
Reference in New Issue
Block a user