Skip to content

Commit 698b2f9

Browse files
committed
Auto merge of #147957 - matthiaskrgr:rollup-aqt593u, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - rust-lang/rust#141445 (Add `FromIterator` impls for `ascii::Char`s to `String`s) - rust-lang/rust#142339 (Add NonNull pattern types) - rust-lang/rust#147768 (Code refactoring on hir report_no_match_method_error) - rust-lang/rust#147788 (const Cell methods) - rust-lang/rust#147932 (Create UTF-8 version of `OsStr`/`OsString`) - rust-lang/rust#147933 (os_str: Make platform docs more consistent) - rust-lang/rust#147948 (PassWrapper: Access GlobalValueSummaryInfo::SummaryList via getter for LLVM 22+) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 376a755 + 2616abe commit 698b2f9

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)