Start with the idea
"1.2" means any 1.x at or above 1.2, because Cargo follows SemVer: patch and minor releases must stay compatible. The resolver picks the highest match and records the exact choice in Cargo.lock, and features let one crate ship optional pieces you opt into rather than paying for by default.
A dependency declaration is a compatibility request, not a permanent pin. In Cargo's default caret requirement, version = "1.2" accepts compatible 1.x releases from 1.2 upward but not 2.0. Cargo.lock records the concrete versions selected for a particular resolution, so two developers can rebuild the same application graph. Read both files when investigating why a new release did or did not appear in your build.
Features let a dependency expose optional capabilities.
Keep learning, for free
The rest of this lesson is waiting for you.
Create a free account to read the complete explanation, see the infographic, explore the code, and try the exercises. All 742 lessons and algorithm steps are included.
No payment details. Your account opens the complete Academy.