Xeb 1.43, hom ntawv me me uas tsuas yog siv cov kev hloov tshiab thiab kho tshiab

Pab neeg Rust tshaj tawm muaj cov ntawm cov tshiab version ntawm koj cov lus programming Xeb 1.43. Tus tshiab version no tsis coj tus yam ntxwv tshiab tseem ceeb thiab yog suav tias yog hom ntawv meCov. Txawm hais tias nws sawv tawm hais tias muaj tshiab API ruaj khov, compiler kev txhim kho kev ua tau zoo thiab me me macro ua haujlwm.

Rau cov neeg uas tsis paub txog Kev Rust yuav tsum paub tias qhov no yog hom lus sau ua kom pom tseeb txog kev nyab xeeb ua haujlwm nrog kev nco, muab cov kev tswj xyuas tsis siv neeg thiab muab txhais tau tias kom ua tiav cov haujlwm siab concurrency, tsis tas siv cov ntawv sau khib nyiab thiab runtime.

Tsis siv neeg lub cim xeeb tswj hauv Xeb txwv tsis pub cov khoom tsim tawm los ntawm cov taw tes thiab tiv thaiv cov teeb meem uas tshwm sim los ntawm kev ua haujlwm qis nrog kev ncoxws li nkag mus rau hauv qhov chaw cim xeeb tom qab tso tawm ntawm nws, hais txog tus tsis pom qhov taw qhia, tawm ntawm cov kev txwv tsis pub, thiab lwm yam

Txhawm rau faib cov tsev qiv ntawv, kom muaj kev sib dhos thiab tswj hwm cov phiaj xwm kev cuam tshuam, Cargo pob tus thawj tswj hwm yog tsim kho, uas tso cai rau koj tau txais cov tsev qiv ntawv koj xav tau rau qhov kev zov me nyuam nrog nias ib zaug. Lub crates.io lub chaw tso khoom yog kev txhawb nqa rau hauv kev qiv qiv.

Dab tsi tshiab hauv xeb 1.43?

Ntawm Rust 1.43's cov yam ntxwv tshiab, qhov tseem ceeb tshaj plaws tseem ceeb los ntawm pab pawg tom qab cov lus programming yog kev ruaj khov ntawm rau qib API tshiab, nrog rau kev txhim kho ntxiv rau Clippy kev ua haujlwm. 

Ntawm qhov kev hloov pauv uas sawv tawm ntawm qhov tshiab no yog nyob rau hauv macros raws li tam sim no tau siv qhov tawg tsam los hloov lawv rau kev ua kom zoo hauv kev coj ua, kev nqis tes ua (impl) lossis cov khoom sab nraud.

Tsis tas li ntawd, nyob rau hauv xeb 1.43 hom inference ncig primitives tau zoo dua, binary cov ntaub ntawv thiab cov haujlwm. Hauv cov ntawv tshiab no, muaj kev thauj khoom ib puag ncig tshiab rau kev ntsuas.

Txhawm rau pab txhawb cov kev sib koom ua ke, Cargo yuav txhais cov hloov pauv ib puag ncig tshiabCov. Piv txwv li, thaum peb tab tom ua haujlwm ntawm qhov project kab hais kom ua, tsuas yog hu ua "cli", yog tias peb sau kev xeem ua ke, peb xav thov ua tus thawj coj no thiab pom tias nws ua li cas, thaum khiav kev ntsuam xyuas thiab ntsuas.

Tam sim no nws yog qhov tsim nyog los siv rau kev sib txuam nrog nyob rau hauv floats thiab lej ncaj qha, tsis txhob coj mus ntxiv cov module. Hauv lwm lo lus, tam sim no koj tuaj yeem sau ntawv u32 :: MAX thiab f32 :: NAN tsis siv "Siv std :: u32 lossis" siv std :: f32 "

Ntxiv thiab, muaj qhov hloov tshiab uas rov xa cov khoom qubCov. Qhov no tuaj yeem pab tau thaum koj tab tom sau ntawv loj heev thiab koj xav kom paub tseeb tias cov hom tsis tau muab zais.

Ntawm lwm qhov kev hloov pauv uas tau nthuav tawm:

  • Ib puag ncig hloov pauv tshiab CARGO_BIN_EXE_ {lub npe} tau ntxiv rau Cargo, teeb tsa thaum lub sijhawm tsim tsa ntawm cov kev sib koom ua ke kev ntsuam xyuas thiab uas tso cai txiav txim tag nrho txoj hauv kev mus rau cov ntaub ntawv ua tiav tau hais tseg rau hauv "[[bin]]" ntawm pob.
  • "Yog hais tias" kev hais tawm tso cai rau siv cov cwj pwm xws li "# [cfg ()]".
  • Qhov chaw tshiab ntawm qib API tau pauv mus rau qeb uas ruaj khov

Xeb installation ntawm Linux

Si koj xav tau los nruab hom lus programming no rau hauv koj lub system, Peb tuaj yeem ua nws los ntawm rub tawm lub installer uas yuav pab peb kom tau txais Rust ntawm peb lub system

Cia li qhib lub davhlau ya nyob twg thiab khiav ntawm nws:

curl https://sh.rustup.rs -sSf | sh

Thaum khiav ntawm cov lus txib no lub installer yuav rub tawm thiab nws yuav khiav yuav luag tam sim ntawd, koj yuav tsum nias 1 mus txuas ntxiv nrog kev teeb tsa nrog tus nqi qub thiab nws yuav rub tag nrho cov pob khoom tsim nyog.

Yog tias koj xav tau kev cai teeb tsa koj yuav tsum ntaus 2 thiab koj yuav txhais koj qhov chaw nyob ib puag ncig ntawm lwm yam.

Qhov kawg ntawm kev teeb tsa Rust hauv peb qhov system, Cov qhia Cargo bin yuav muab ntxiv rau hauv txoj kev hauv qab no ( ~ / .cargo / rau hauv) qhov twg tag nrho cov cuab yeej raug ntsia) hauv koj PATH ib puag ncig sib txawv, hauv ~ / .tus ntxheb.

Ua li no peb yuav tsum npaj mus ua lub PlhaubPeb ua qhov no los ntawm kev hloov daim ntawv ~ /. Txheej txheem los siv cov PATH uas raug hloov kho los ua haujlwm nrog Rust ib puag ncig, khiav cov lus txib no hauv lub davhlau ya nyob twg:

source ~/.profile
source ~/.cargo/env

Tam sim no xwb peb yuav tsum ua kom dhau los ua pov thawj tias Rust raug ntsia kom raug rau hauv peb txoj kab ke, peb ua qhov no los ntawm ntaus cov lus hais hauv qab no ntawm lub davhlau ya nyob twg

rustc --version

Thiab nrog nws peb yuav tsum tau txais qhov Rust version ntawm lub vijtsam uas peb tau nruab rau hauv peb qhov system.

Thiab tus ntawd yog nws, peb tuaj yeem pib siv hom lus no thiab tuaj yeem nruab rau cov ntawv thov uas siv nws ntawm peb txoj kab ke.


Cov ntsiab lus ntawm tsab xov xwm ua raws li peb cov ntsiab cai ntawm kev tswj hwm kev ncaj nceesCov. Tshaj tawm ib qho yuam kev nyem no.

Yog thawj tus tuaj tawm tswv yim

Tso koj saib

Koj email chaw nyob yuav tsis tsum luam tawm.

*

*

  1. Lub luag haujlwm rau cov ntaub ntawv: Miguel Ángel Gatón
  2. Lub hom phiaj ntawm cov ntaub ntawv: Tswj SPAM, kev tswj xyuas tawm tswv yim.
  3. Sau raws cai: Koj kev tso cai
  4. Kev sib txuas lus ntawm cov ntaub ntawv: Cov ntaub ntawv yuav tsis raug xa mus rau lwm tus neeg thib peb tsuas yog los ntawm kev txiav txim siab raug cai.
  5. Cov ntaub ntawv khaws cia: Cov Ntaub Ntawv khaws tseg los ntawm Occentus Networks (EU)
  6. Txoj Cai: Txhua lub sijhawm koj tuaj yeem txwv, rov qab thiab tshem tawm koj cov ntaub ntawv.

bool (muaj tseeb)