summaryrefslogtreecommitdiffstats
path: root/src/test/ui/drop-bounds/drop-bounds-impl-drop.rs
blob: 063efc7b31abde057f5fcac4778e846d26fe14be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// run-pass
#![deny(drop_bounds)]
// As a special exemption, `impl Drop` in the return position raises no error.
// This allows a convenient way to return an unnamed drop guard.
fn voldemort_type() -> impl Drop {
  struct Voldemort;
  impl Drop for Voldemort {
    fn drop(&mut self) {}
  }
  Voldemort
}
fn main() {
  let _ = voldemort_type();
}