Skip to content

Commit 4ca56d2

Browse files
committed
Auto merge of #95020 - compiler-errors:late-debuginfo, r=jackh726
erase late-bound regions in dyn projection types for debuginfo simply skipping the binder leaves late-bound regions that will cause debug assertions to fail when checking the layout of the projection ty, so let's erase the regions instead. sorry for taking so long to put this up, had trouble getting rustc set up on a new computer. fixes #94998
2 parents 58f1179 + b69b3d0 commit 4ca56d2

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,8 @@ fn push_debuginfo_type_name<'tcx>(
217217
let projection_bounds: SmallVec<[_; 4]> = trait_data
218218
.projection_bounds()
219219
.map(|bound| {
220-
let ExistentialProjection { item_def_id, term, .. } = bound.skip_binder();
220+
let ExistentialProjection { item_def_id, term, .. } =
221+
tcx.erase_late_bound_regions(bound);
221222
// FIXME(associated_const_equality): allow for consts here
222223
(item_def_id, term.ty().unwrap())
223224
})
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// build-pass
2+
// compile-flags: -Cdebuginfo=2 --crate-type=rlib
3+
// Fixes issue #94998
4+
5+
pub trait Trait {}
6+
7+
pub fn run(_: &dyn FnOnce(&()) -> Box<dyn Trait + '_>) {}

0 commit comments

Comments
 (0)