Lines Matching defs:stack
463 /// An `Ast`'s `fmt::Display` implementation uses constant stack space and heap
466 /// This type defines its own destructor that uses constant stack space and
542 /// This implementation uses constant stack space and heap space proportional
1357 /// A custom `Drop` impl is used for `Ast` such that it uses constant stack
1380 let mut stack = vec![mem::replace(self, empty_ast())];
1381 while let Some(mut ast) = stack.pop() {
1391 stack.push(mem::replace(&mut x.ast, empty_ast()));
1394 stack.push(mem::replace(&mut x.ast, empty_ast()));
1397 stack.extend(x.asts.drain(..));
1400 stack.extend(x.asts.drain(..));
1408 /// stack space but heap space proportional to the depth of the `ClassSet`.
1441 let mut stack = vec![mem::replace(self, empty_set())];
1442 while let Some(mut set) = stack.pop() {
1452 stack.push(mem::replace(&mut x.kind, empty_set()));
1455 stack.extend(x.items.drain(..).map(ClassSet::Item));
1459 stack.push(mem::replace(&mut op.lhs, empty_set()));
1460 stack.push(mem::replace(&mut op.rhs, empty_set()));
1471 // We use a thread with an explicit stack size to test that our destructor
1472 // for Ast can handle arbitrarily sized expressions in constant stack
1493 // We run our test on a thread with a small stack size so we can