]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-27240.rs
Rollup merge of #92942 - Xaeroxe:raw_arg, r=dtolnay
[rust.git] / src / test / ui / issues / issue-27240.rs
1 // run-pass
2 #![allow(unused_assignments)]
3 #![allow(unused_variables)]
4 use std::fmt;
5 struct NoisyDrop<T: fmt::Debug>(T);
6 impl<T: fmt::Debug> Drop for NoisyDrop<T> {
7     fn drop(&mut self) {}
8 }
9
10 struct Bar<T: fmt::Debug>([*const NoisyDrop<T>; 2]);
11
12 fn fine() {
13     let (u,b);
14     u = vec![43];
15     b = Bar([&NoisyDrop(&u), &NoisyDrop(&u)]);
16 }
17
18 struct Bar2<T: fmt::Debug>(*const NoisyDrop<T>, *const NoisyDrop<T>);
19
20 fn lolwut() {
21     let (u,v);
22     u = vec![43];
23     v = Bar2(&NoisyDrop(&u), &NoisyDrop(&u));
24 }
25
26 fn main() { fine(); lolwut() }