Here's a mutable slice:
```rust
+# fn main() {}
use std::mem;
pub struct IterMut<'a, T: 'a>(&'a mut[T]);
And here's a binary tree:
```rust
+# fn main() {}
use std::collections::VecDeque;
type Link<T> = Option<Box<Node<T>>>;
}
impl<'a, T> DoubleEndedIterator for IterMut<'a, T> {
- fn next(&mut self) -> Option<Self::Item> {
+ fn next_back(&mut self) -> Option<Self::Item> {
loop {
match self.0.back_mut().and_then(|node_it| node_it.next_back()) {
Some(State::Elem(elem)) => return Some(elem),
gets dropped at the same time as another, right? This is why we used the
following desugarring of `let` statements:
-```rust
+```rust,ignore
let x;
let y;
```
-```rust
+```rust,ignore
{
let x;
{
Each creates its own scope, clearly establishing that one drops before the
other. However, what if we do the following?
-```rust
+```rust,ignore
let (x, y) = (vec![], vec![]);
```
ensuring the parent joins the thread before any of the shared data goes out
of scope.
-```rust
+```rust,ignore
pub fn scoped<'a, F>(f: F) -> JoinGuard<'a>
where F: FnOnce() + Send + 'a
```
```rust
# use std::cmp::Ordering;
# struct MyType;
-# pub unsafe trait UnsafeOrd { fn cmp(&self, other: &Self) -> Ordering; }
+# unsafe trait UnsafeOrd { fn cmp(&self, other: &Self) -> Ordering; }
unsafe impl UnsafeOrd for MyType {
fn cmp(&self, other: &Self) -> Ordering {
Ordering::Equal
cap: usize,
len: usize,
}
-
# fn main() {}
```
unsafe { mem::transmute(&self.ptr) }
}
}
+# fn main() {}
```
Unfortunately the mechanism for stating that your value is non-zero is