]> git.lizzy.rs Git - rust.git/blob - src/test/ui/drop-bounds/drop-bounds-impl-drop.rs
Rollup merge of #97317 - GuillaumeGomez:gui-settings-text-click, r=jsha
[rust.git] / src / test / ui / drop-bounds / drop-bounds-impl-drop.rs
1 // run-pass
2 #![deny(drop_bounds)]
3 // As a special exemption, `impl Drop` in the return position raises no error.
4 // This allows a convenient way to return an unnamed drop guard.
5 fn voldemort_type() -> impl Drop {
6   struct Voldemort;
7   impl Drop for Voldemort {
8     fn drop(&mut self) {}
9   }
10   Voldemort
11 }
12 fn main() {
13   let _ = voldemort_type();
14 }