Lines Matching defs:version
2 //! version requirements. The version is queried by calling the Rust compiler
3 //! with `--version`. The path to the compiler is determined first via the
10 //! be at least version `1.13.0`:
21 //! is _at most_ or _exactly_ a certain version.
31 //! None => "Couldn't determine the rustc version."
46 //! None => "Couldn't determine the rustc version."
68 //! None => format!("Couldn't determine the rustc version.")
72 //! To interact with the version, release date, and release channel as structs,
79 //! and don't care about panicking if the version cannot be obtained, or if you
85 mod version;
92 #[doc(inline)] pub use version::*;
96 /// Parses (version, date) as available from rustc version string.
100 let version = components.nth(1);
103 (version.map(|s| s.to_string()), date.map(|s| s.to_string()))
106 /// Parses (version, date) as available from rustc verbose version output.
108 let (mut version, mut date) = (None, None);
114 version = version.or(v);
117 Some("release:") => version = split(line),
124 (version, date)
127 /// Returns (version, date) as available from `rustc --version`.
130 Command::new(rustc).arg("--verbose").arg("--version").output().ok()
145 Some((Some(version), Some(date))) => (version, date),
151 Some(version) => match Channel::parse(&version_str) {
153 Some(date) => Some((version, channel, date)),
211 /// version.
213 /// The format of `min_version` is a semantic version: `1.3.0`, `1.15.0-beta`,
216 /// If the version cannot be retrieved or parsed, or if `min_version` could not
227 /// version.
229 /// The format of `max_version` is a semantic version: `1.3.0`, `1.15.0-beta`,
232 /// If the version cannot be retrieved or parsed, or if `max_version` could not
242 /// Checks that the running or installed `rustc` is **exactly** some version.
244 /// The format of `version` is a semantic version: `1.3.0`, `1.15.0-beta`,
247 /// If the version cannot be retrieved or parsed, or if `version` could not be
249 /// exactly `version` and `false` otherwise.
250 pub fn is_exact_version(version: &str) -> Option<bool> {
251 match (Version::read(), Version::parse(version)) {
252 (Some(rustc_ver), Some(version)) => Some(rustc_ver == version),
267 /// If the version could not be determined, returns `None`. Otherwise returns
268 /// `true` if the running version supports feature flags and `false` otherwise.
277 /// `CARGO_ENCODED_RUSTFLAGS`. If the version could not be determined, returns
332 panic!("{:?} didn't parse for version testing.", $s);
407 LLVM version: 12.0.0" => "1.52.0-nightly", Some("2021-03-07"),
415 LLVM version: 7.0" => "1.41.1", None,
477 let (version, date) = (&format!("1.{}.0", v), Some(DATES[v]));
478 check_terse_parse!(read_static(false, "stable", v) => version, date,);
479 check_verbose_parse!(read_static(true, "stable", v) => version, date,);
485 let (version, channel) = (::Version::read(), ::Channel::read());
486 assert!(version.is_some());