build: introduce rust-version in Cargo.toml

Starting from Rust 1.56 Cargo supports specifying the minimum supported
rust version (MSRV) via "rust-version". If the compiler version is not
satisfied, Cargo prints an error and exits early.

MSRV is useful information to packagers. Using this field also saves us
from adding another file to the tree.

The version is currently set to 1.54, which is tested to build Cloud
Hypervisor successfully. Although anyone who uses 1.54 will see a
warning because "rust-version" is only introduced in 1.56. The warning
can be safely ignored.

Signed-off-by: Wei Liu <liuwe@microsoft.com>
This commit is contained in:
Wei Liu 2022-02-22 15:55:09 +00:00 committed by Rob Bradford
parent c504f302e9
commit 020b64a9ef

View File

@ -8,6 +8,7 @@ build = "build.rs"
license = "LICENSE-APACHE & LICENSE-BSD-3-Clause"
description = "Open source Virtual Machine Monitor (VMM) that runs on top of KVM"
homepage = "https://github.com/cloud-hypervisor/cloud-hypervisor"
rust-version = "1.54"
[profile.release]
lto = true