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.
2 parents 376a755 + 2616abe commit 698b2f9Copy full SHA for 698b2f9
tests/pass/pattern-types.rs
@@ -0,0 +1,18 @@
1
+#![feature(pattern_types, pattern_type_macro, sized_hierarchy)]
2
+#![allow(dead_code)]
3
+
4
+use std::marker::PointeeSized;
5
+use std::mem::transmute;
6
7
+pub struct NonNull<T: PointeeSized> {
8
+ pointer: std::pat::pattern_type!(*const T is !null),
9
+}
10
11
+trait Trait {}
12
+impl Trait for () {}
13
14
+fn main() {
15
+ unsafe {
16
+ let _: NonNull<dyn Trait> = NonNull { pointer: transmute(&mut () as *mut dyn Trait) };
17
+ }
18
0 commit comments