diff options
Diffstat (limited to 'tests/ui/traits/vtable/issue-91807.rs')
-rw-r--r-- | tests/ui/traits/vtable/issue-91807.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/ui/traits/vtable/issue-91807.rs b/tests/ui/traits/vtable/issue-91807.rs new file mode 100644 index 000000000..f435ff09d --- /dev/null +++ b/tests/ui/traits/vtable/issue-91807.rs @@ -0,0 +1,17 @@ +// check-pass +// incremental + +struct Struct<T>(T); + +impl<T> std::ops::Deref for Struct<T> { + type Target = dyn Fn(T); + fn deref(&self) -> &Self::Target { + unimplemented!() + } +} + +fn main() { + let f = Struct(Default::default()); + f(0); + f(0); +} |