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;
|
2023-12-27 22:11:58 +00:00
|
|
|
struct NoisyDrop<T: fmt::Debug>(#[allow(dead_code)] T);
|
2015-07-23 22:38:42 +00:00
|
|
|
impl<T: fmt::Debug> Drop for NoisyDrop<T> {
|
|
|
|
fn drop(&mut self) {}
|
|
|
|
}
|
|
|
|
|
2023-12-27 22:11:58 +00:00
|
|
|
struct Bar<T: fmt::Debug>(#[allow(dead_code)] [*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)]);
|
|
|
|
}
|
|
|
|
|
2023-12-27 22:11:58 +00:00
|
|
|
#[allow(dead_code)]
|
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() }
|