> For the complete documentation index, see [llms.txt](https://chapin666.gitbook.io/too-many-list-zh/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://chapin666.gitbook.io/too-many-list-zh/yi-ge-bu-an-quan-de-dui-lie.md).

# 一个不安全的队列

引用计数内部可变性的东西有点失控了。一般来说， Rust 不会真的指望你去做那种事吧？好吧，是也不是。Rc 和 Refcell 可以很好地处理简单的情况，但它们可能会变得笨拙。尤其是如果你想避免这件事的发生。一定有更好的办法！

在本章中，我们将返回到单链接表，并实现一个单链接队列，以便深入了解原始指针和不安全的 Rust。

让我们添加一个名为 fifth.rs 的新文件:

```rust
// in lib.rs

pub mod first;
pub mod second;
pub mod third;
pub mod fourth;
pub mod fifth;
```

我们的代码将主要来自second.rs，因为队列在链接列表世界中主要是对堆栈的增强。 尽管如此，我们还是要从头开始，因为我们要解决一些基本问题，而布局又不能解决。
