认识 Rust 和 Mac 安装
- 认识
-
- 安装
- 运行
- 练习
- 问题
-
- 1. rust-lang.rust has been deprecated. Please uninstall this extension and install rust-lang.rust-analyzer instead. You can find the extension by clicking on one of the buttons.
- 2. Unable to install extension 'rust-lang.rust-analyzer' as it is not compatible with VS Code '1.64.0'.: Error: Unable to install extension 'rust-lang.rust-analyzer' as it is not compatible with VS Code '1.64.0'.
- 3. Cannot update while running on a read-only volume. The application is on a read-only volume. Please move the application and try again. If you're on macOS Sierra or later, you'll need to move the application out of the Downloads directory. This might mean the application was put on quarantine by macOS. See this link for more information.
认识
创造出所有权与生命周期等崭新概念;
具有天然的安全性;
遵循零开销抽象(Zero- Cost Abstraction)规则,并为开发者保留了最大的底层控制能力。
安装
curl https://sh.rustup.rs -sSf | sh
提示无权限
You can uninstall at any time with rustup self uninstall and these changes will be reverted. Current installation options:
default host triple: x86_64-apple-darwin
default toolchain: stable (default)
profile: default
modify PATH variable: yes
1) Proceed with installation (default)
2) Customize installation
3) Cancel installation
>1
error: could not amend shell profile: '/Users/user/.bashrc': could not write rcfile file: '/Users/user/.bashrc': Permission denied (os error 13)
改为如下
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y --no-modify-path
运行
- 创建名为"main.rs" 的文件如下:<

本文介绍了Rust编程语言的基本认识,包括所有权、生命周期和安全性等特点。详细阐述了在Mac上安装Rust的过程,以及遇到的权限问题、如何运行Rust程序。此外,还列举了在VS Code中使用rust-analyzer扩展时遇到的三个问题及解决方案,如插件兼容性、读写权限等。
最低0.47元/天 解锁文章
5万+

被折叠的 条评论
为什么被折叠?



