(1) 认识 Rust和 Mac 安装

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

认识

创造出所有权与生命周期等崭新概念;
具有天然的安全性;
遵循零开销抽象(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

运行

  1. 创建名为"main.rs" 的文件如下:<
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值