From 13704dabd2f7befd4b1aeb77836fadbc16433d78 Mon Sep 17 00:00:00 2001 From: Michael Woerister Date: Tue, 19 Oct 2021 11:46:51 +0200 Subject: Erase late-bound regions before computing vtable debuginfo name. --- src/test/codegen/debug-vtable.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/test/codegen/debug-vtable.rs') diff --git a/src/test/codegen/debug-vtable.rs b/src/test/codegen/debug-vtable.rs index 851d68da5ee..5f68da2b6b0 100644 --- a/src/test/codegen/debug-vtable.rs +++ b/src/test/codegen/debug-vtable.rs @@ -18,6 +18,9 @@ // MSVC-LABEL: !DIGlobalVariable(name: "impl$::vtable$" // CHECK: !DISubrange(count: 3 +// NONMSVC-LABEL: !DIGlobalVariable(name: ">)>>::{vtable}" +// MSVC-LABEL: !DIGlobalVariable(name: "impl$,assoc$ > > > > >, {{.*}}, {{.*}}, Some> > > >::vtable$" + #![crate_type = "lib"] pub struct Foo; @@ -45,3 +48,10 @@ pub fn foo(x: &Foo) -> (u32, (u64, i8), &dyn Send) { let z: &dyn SomeTraitWithGenerics = x; (y.method1(), z.method1(), x as &dyn Send) } + +// Constructing the debuginfo name for the FnOnce vtable below initially caused an ICE on MSVC +// because the trait type contains a late bound region that needed to be erased before the type +// layout for the niche enum `Option<&dyn Fn()>` could can be computed. +pub fn bar() -> Box)> { + Box::new(|_x: Option<&dyn Fn()>| {}) +} -- cgit 1.4.1-3-g733a5 From 06221e1b8b7ee5b24d6bfb4ae921126454acb9e7 Mon Sep 17 00:00:00 2001 From: Wesley Wiser Date: Tue, 19 Oct 2021 11:36:21 -0400 Subject: Update src/test/codegen/debug-vtable.rs Co-authored-by: r00ster --- src/test/codegen/debug-vtable.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/test/codegen/debug-vtable.rs') diff --git a/src/test/codegen/debug-vtable.rs b/src/test/codegen/debug-vtable.rs index 5f68da2b6b0..1c8cc61f204 100644 --- a/src/test/codegen/debug-vtable.rs +++ b/src/test/codegen/debug-vtable.rs @@ -51,7 +51,7 @@ pub fn foo(x: &Foo) -> (u32, (u64, i8), &dyn Send) { // Constructing the debuginfo name for the FnOnce vtable below initially caused an ICE on MSVC // because the trait type contains a late bound region that needed to be erased before the type -// layout for the niche enum `Option<&dyn Fn()>` could can be computed. +// layout for the niche enum `Option<&dyn Fn()>` could be computed. pub fn bar() -> Box)> { Box::new(|_x: Option<&dyn Fn()>| {}) } -- cgit 1.4.1-3-g733a5