rust/tests/ui/issues/issue-27240.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

28 lines
651 B
Rust
Raw Normal View History

// run-pass
#![allow(unused_assignments)]
#![allow(unused_variables)]
use std::fmt;
2022-07-25 20:36:03 +00:00
struct NoisyDrop<T: fmt::Debug>(#[allow(unused_tuple_struct_fields)] T);
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]);
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)]
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() }