]> git.lizzy.rs Git - rust.git/blob - tests/ui/array-slice-vec/nested-vec-2.rs
Rollup merge of #106715 - BoxyUwU:new_solver_triagebot, r=lcnr
[rust.git] / tests / ui / array-slice-vec / nested-vec-2.rs
1 // run-pass
2
3 // Test that using the `vec!` macro nested within itself works
4 // when the contents implement Drop
5
6 struct D(u32);
7
8 impl Drop for D {
9     fn drop(&mut self) { println!("Dropping {}", self.0); }
10 }
11
12 fn main() {
13     let nested = vec![vec![D(1u32), D(2u32), D(3u32)]];
14     assert_eq!(nested[0][1].0, 2);
15 }