首页 后端开发 C++ 【Rust自学】安装Rust

【Rust自学】安装Rust

Apr 04, 2025 am 06:45 AM
linux windows 操作系统 win11 macos cos yy

1.1.1.从官方网站安装 rust

进入rust官网,右上角可以设置语言。

image description

点击“开始”,您将看到以下界面:

image description

根据您的操作系统选择合适的版本:32位系统选择32位,64位系统选择64位。现在大多数计算机都是 64 位的。如果您不确定,只要您的计算机不是很旧,下载 64 位版本就应该可以正常工作。

要下载适用于 macoslinuxwindows linux 子系统 的 rust,请在终端中执行以下命令:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

打开下载的安装程序,您将看到以下界面:

image description

共有三个选项:

  • 选项 1(默认): 标准安装
  • 选项2:自定义安装,允许您自定义安装路径、组件、工具链版本等
  • 选项 3: 取消安装

对于大多数用户来说,选项 1 就足够了(输入 1 并按 enter,或者直接按 enter)。

如果您看到以下屏幕,则 rust 已成功安装:

image description

安装程序将提示您重新启动 shell。按 enter 键退出程序。至此,rust安装完成。

1.1.2. rust 的命令行操作

rust 命令可以在 windows 的终端中执行(win11 默认包含,如果没有,请在 microsoft store 中搜索 windows terminal 进行下载)。

  • 更新 rust: rustup 更新 rust 是一种快速发展的语言,因此建议定期执行此操作以获取最新版本。
  • 卸载 rust: rustup 自行卸载
  • 验证安装: rustc --version 或 rustc -v

结果格式:rustc x.y.z (xxxxxxxxx yyyy-mm-dd):

  • x.y.z:版本号
  • xxxxxxxxx:当前版本的哈希值
  • yyyy-mm-dd:当前版本的提交日期

image description

打开本地 rust 文档手册: rustup doc

开发工具

  • 安装 vs code 的 rust 插件
  • vim
  • 螺旋
  • rustrover

以上是【Rust自学】安装Rust的详细内容。更多信息请关注PHP中文网其他相关文章!

本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

热AI工具

Undress AI Tool

Undress AI Tool

免费脱衣服图片

Undresser.AI Undress

Undresser.AI Undress

人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover

AI Clothes Remover

用于从照片中去除衣服的在线人工智能工具。

Clothoff.io

Clothoff.io

AI脱衣机

Video Face Swap

Video Face Swap

使用我们完全免费的人工智能换脸工具轻松在任何视频中换脸!

热工具

记事本++7.3.1

记事本++7.3.1

好用且免费的代码编辑器

SublimeText3汉化版

SublimeText3汉化版

中文版,非常好用

禅工作室 13.0.1

禅工作室 13.0.1

功能强大的PHP集成开发环境

Dreamweaver CS6

Dreamweaver CS6

视觉化网页开发工具

SublimeText3 Mac版

SublimeText3 Mac版

神级代码编辑软件(SublimeText3)

热门话题

PHP教程
1596
276
如何对更新Windows的问题进行故障排除:Microsoft指南 如何对更新Windows的问题进行故障排除:Microsoft指南 Aug 22, 2025 am 11:54 AM

runthewIndowsUpDateTrubloubLeShootErtoAtoromationalfixCommonissuesBynAvigatingToSettings> System>故障排除>其他trubloubShooterSandRunningThewIndowSupDateTool.2.ensureatLeast20GBoffReast20GboffReeastOntySysonthesystemDriveanDrivEandMeetUpdateRepDateTaTateTaTatatAtatAtatatAtatatAtaTateUsementsBydususiondusydiskcl

如何清理Linux系统 如何清理Linux系统 Aug 22, 2025 am 07:42 AM

Removeunusedpackagesanddependencieswithsudoaptautoremove,cleanpackagecacheusingsudoaptcleanorautoclean,andremoveoldkernelsviasudoaptautoremove--purge.2.Clearsystemlogswithsudojournalctl--vacuum-time=7d,deletearchivedlogsin/var/log,andempty/tmpand/var

固定:Windows正在获得'试图写入只读内存”错误 固定:Windows正在获得'试图写入只读内存”错误 Aug 22, 2025 am 11:48 AM

更新或回滚设备驱动程序,特别是显卡、芯片组和SSD驱动;2.运行Windows内存诊断工具检测并更换故障RAM;3.使用sfc/scannow和DISM命令修复系统文件;4.在BIOS中恢复默认设置以取消超频;5.在安全模式下卸载最近安装的软件或系统更新;6.运行chkdsk检查磁盘错误;7.谨慎更新BIOS/UEFI固件;8.作为最后手段,备份数据后执行干净的Windows安装。该错误通常由软件或驱动问题引起,多数情况下可通过逐步排查解决,无需更换硬件,最终可通过系统重装彻底修复。

如何更改Win11中的系统语言 如何更改Win11中的系统语言 Aug 22, 2025 am 10:36 AM

TochangeThesystemLanguageInwindows1111,useettings,controlPanel,orpowershell.installthedesiredlanguagepack,setItAsDefault,andrestartyourcomputertoptoptopplychanges。

如何在Win11中重置网络设置 如何在Win11中重置网络设置 Aug 22, 2025 pm 12:54 PM

Ifyou'hehavingConnectivityIssOusOnWindows1111,TryResettingNetworkSettings:1.sesettings> Isesettings> NetworkReset.2.runnetworkResetCommandSincommandPrompt(admin).3.ReinstallthenetworkAdaptorworkAdapterViceMemanAger.RestArtArtArtArtyRyouRdyOuRDeviceViceAfeAfteAfteAftereafTereAftEasteastept。

修复:Windows中的'无法连接到此网络” Wi-Fi错误 修复:Windows中的'无法连接到此网络” Wi-Fi错误 Aug 22, 2025 am 05:53 AM

Ifyoucan'tconnecttoWi-FionWindows,trythesesteps:1.Restartthenetworkadapter.2.Runthenetworktroubleshooter.3.Forgetandrejointhenetwork.4.UpdateorreinstalltheWi-Fidriver.5.ManuallyconfigureIPandDNSsettings.6.Resetnetworksettingstodefault.

窗口安装后如何修复黑屏? 窗口安装后如何修复黑屏? Aug 22, 2025 pm 05:45 PM

Checkmonitorpower,cableconnections,andtryintegratedgraphicsordifferenthardwaretoruleoutphysicalissues.2.Forcerestart2–3timestotriggerAutomaticRepair,thenenableLow-ResolutionVideoModeviaStartupSettings.3.BootintoSafeMode,updateorreinstalldisplaydriver

现代Linux系统系统D的深度指南 现代Linux系统系统D的深度指南 Aug 23, 2025 pm 12:02 PM

Systemdisthefirstprocess(PID1)inmodernLinuxsystems,replacingolderinitsystemslikeSysVinitandUpstart,responsibleforbooting,managingservices,devices,logs,andusersessionsthroughasuiteofintegratedtools.2.Itusesunitfiles(.service,.timer,.socket,etc.)todefi

See all articles