We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 907d961 commit e0855bcCopy full SHA for e0855bc
src/libarena/lib.rs
@@ -298,6 +298,20 @@ fn test_arena_destructors() {
298
}
299
300
301
+#[test]
302
+fn test_arena_alloc_nested() {
303
+ struct Inner { value: uint }
304
+ struct Outer<'a> { inner: &'a Inner }
305
+
306
+ let arena = Arena::new();
307
308
+ let result = arena.alloc(|| Outer {
309
+ inner: arena.alloc(|| Inner { value: 10 })
310
+ });
311
312
+ assert_eq!(result.inner.value, 10);
313
+}
314
315
#[test]
316
#[should_fail]
317
fn test_arena_destructors_fail() {
0 commit comments