diff options
| author | bors <bors@rust-lang.org> | 2022-03-17 21:54:25 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-03-17 21:54:25 +0000 |
| commit | 4ca56d2b7bbe275bc6c9f3cd698c6e0719a07182 (patch) | |
| tree | 583f7f2faa43a6fd365149da441def81e4ba7b00 | |
| parent | 58f11791af4f97572e7afd83f11cffe04bbbd12f (diff) | |
| parent | b69b3d041ad7b8679bdc9c32afccfd961a7d28d2 (diff) | |
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
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs | 3 | ||||
| -rw-r--r-- | src/test/ui/debuginfo/late-bound-projection.rs | 7 |
2 files changed, 9 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs b/compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs index 4b1563ca3c9..f39f260225e 100644 --- a/compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs +++ b/compiler/rustc_codegen_ssa/src/debuginfo/type_names.rs @@ -217,7 +217,8 @@ fn push_debuginfo_type_name<'tcx>( let projection_bounds: SmallVec<[_; 4]> = trait_data .projection_bounds() .map(|bound| { - let ExistentialProjection { item_def_id, term, .. } = bound.skip_binder(); + let ExistentialProjection { item_def_id, term, .. } = + tcx.erase_late_bound_regions(bound); // FIXME(associated_const_equality): allow for consts here (item_def_id, term.ty().unwrap()) }) diff --git a/src/test/ui/debuginfo/late-bound-projection.rs b/src/test/ui/debuginfo/late-bound-projection.rs new file mode 100644 index 00000000000..6018078459c --- /dev/null +++ b/src/test/ui/debuginfo/late-bound-projection.rs @@ -0,0 +1,7 @@ +// build-pass +// compile-flags: -Cdebuginfo=2 --crate-type=rlib +// Fixes issue #94998 + +pub trait Trait {} + +pub fn run(_: &dyn FnOnce(&()) -> Box<dyn Trait + '_>) {} |
