You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

8 lines
762 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# 所有权和借用
Rust之所以能成为万众瞩目的语言就是因为其内存安全性。在以往内存安全几乎都是通过GC的方式实现但是GC会引来性能、内存占用以及Stop the world等问题在高性能场景和系统编程上是不可接受的因此Rust采用了与(错)众(误)不(之)同(源)的方式:**所有权系统**。
理解所有权和借用对于Rust学习是至关重要的因此我们把本章提到了非常靠前的位置So骚年们准备好迎接狂风暴雨了嘛
从现在开始,鉴于大家已经掌握了非常基本的语法,有些时候,在示例代码中,将省略`fn main() {}`的模版代码,只要将相应的示例放在`fn main() {}`中,即可运行。