Skip to content

Commit 2007b5d

Browse files
author
The Miri Cronjob Bot
committed
Merge ref '6244effd0372' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: 6244effd0372d5d88fc859d3bf17ce1efcc2c9ec Filtered ref: 2b788f9 Upstream diff: rust-lang/rust@96fe3c3...6244eff This merge was created using https://github.com/rust-lang/josh-sync.
2 parents c57ca2e + 2b788f9 commit 2007b5d

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/pass/pattern-types.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)