Data update
This commit is contained in:
parent
ed705008a8
commit
0df55f9f24
2196 changed files with 32999 additions and 3075 deletions
2
Task/Introspection/Rust/introspection-1.rust
Normal file
2
Task/Introspection/Rust/introspection-1.rust
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
[dependencies]
|
||||
rustc_version = "0.4"
|
||||
30
Task/Introspection/Rust/introspection-2.rust
Normal file
30
Task/Introspection/Rust/introspection-2.rust
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
use rustc_version::{version_meta, Channel, version, Version};
|
||||
|
||||
fn main() {
|
||||
// We can check the Rust channel currently being used: stable, nightly, etc.
|
||||
match version_meta().unwrap().channel {
|
||||
Channel::Stable => {
|
||||
println!("Rust Stable");
|
||||
}
|
||||
Channel::Beta => {
|
||||
println!("Rust Beta");
|
||||
}
|
||||
Channel::Nightly => {
|
||||
println!("Rust Nightly");
|
||||
}
|
||||
Channel::Dev => {
|
||||
println!("Rust Dev");
|
||||
}
|
||||
}
|
||||
|
||||
// We can print the Rust compiler version
|
||||
println!("{}",version().unwrap());
|
||||
|
||||
// We can check for a minimum Rust compiler version
|
||||
if version().unwrap() >= Version::parse("1.50.0").unwrap() {
|
||||
println!("Rust compiler version is ok.");
|
||||
} else {
|
||||
eprintln!("Rust compiler version is too old. Please update to a more recent version.");
|
||||
std::process::exit(1);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue