]> git.lizzy.rs Git - rust.git/blob - tests/ui/mir/issue-73914.rs
Rollup merge of #106670 - albertlarsan68:check-docs-in-pr-ci, r=Mark-Simulacrum
[rust.git] / tests / ui / mir / issue-73914.rs
1 // build-pass
2 // compile-flags:-Copt-level=0
3 // edition:2018
4
5 struct S<T>(std::marker::PhantomData<T>);
6
7 impl<T> std::ops::Deref for S<T> {
8     type Target = T;
9
10     fn deref(&self) -> &Self::Target {
11         todo!()
12     }
13 }
14 impl<T> std::ops::DerefMut for S<T> {
15     fn deref_mut(&mut self) -> &mut Self::Target {
16         todo!()
17     }
18 }
19
20 async fn new() -> S<u64> {
21     todo!()
22 }
23
24 async fn crash() {
25     *new().await = 1 + 1;
26 }
27
28 fn main() {
29     let _ = crash();
30 }