2018-08-30 12:18:55 +00:00
|
|
|
// run-pass
|
2018-09-25 21:51:35 +00:00
|
|
|
#![allow(unused_assignments)]
|
|
|
|
#![allow(unused_variables)]
|
2015-07-23 22:38:42 +00:00
|
|
|
use std::fmt;
|
2022-07-25 20:36:03 +00:00
|
|
|
struct NoisyDrop<T: fmt::Debug>(#[allow(unused_tuple_struct_fields)] T);
|
2015-07-23 22:38:42 +00:00
|
|
|
impl<T: fmt::Debug> Drop for NoisyDrop<T> {
|
|
|
|
fn drop(&mut self) {}
|
|
|
|
}
|
|
|
|
|
2022-07-25 20:36:03 +00:00
|
|
|
struct Bar<T: fmt::Debug>(#[allow(unused_tuple_struct_fields)] [*const NoisyDrop<T>; 2]);
|
2015-07-23 22:38:42 +00:00
|
|
|
|
|
|
|
fn fine() {
|
|
|
|
let (u,b);
|
|
|
|
u = vec![43];
|
|
|
|
b = Bar([&NoisyDrop(&u), &NoisyDrop(&u)]);
|
|
|
|
}
|
|
|
|
|
2022-07-25 20:36:03 +00:00
|
|
|
#[allow(unused_tuple_struct_fields)]
|
2015-07-23 22:38:42 +00:00
|
|
|
struct Bar2<T: fmt::Debug>(*const NoisyDrop<T>, *const NoisyDrop<T>);
|
|
|
|
|
|
|
|
fn lolwut() {
|
|
|
|
let (u,v);
|
|
|
|
u = vec![43];
|
|
|
|
v = Bar2(&NoisyDrop(&u), &NoisyDrop(&u));
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() { fine(); lolwut() }
|