We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c5295ac commit d69d0d7Copy full SHA for d69d0d7
src/test/ui/traits/trait-with-dst.rs
@@ -0,0 +1,22 @@
1
+// compile-pass
2
+// #55266
3
+
4
+struct VTable<DST: ?Sized> {
5
+ _to_dst_ptr: fn(*mut ()) -> *mut DST,
6
+}
7
8
+trait HasVTableFor<DST: ?Sized + 'static> {
9
+ const VTABLE: &'static VTable<DST>;
10
11
12
+impl<T, DST: ?Sized + 'static> HasVTableFor<DST> for T {
13
+ const VTABLE: &'static VTable<DST> = &VTable {
14
+ _to_dst_ptr: |_: *mut ()| unsafe { std::mem::zeroed() },
15
+ };
16
17
18
+pub fn push<DST: ?Sized + 'static, T>() {
19
+ <T as HasVTableFor<DST>>::VTABLE;
20
21
22
+fn main() {}
0 commit comments