Lines Matching full:rustc
1 //! This tiny crate checks that the running or installed `rustc` meets some
4 //! `RUSTC` environment variable. If it is not set, then `rustc` is used. If
13 //! extern crate version_check as rustc;
15 //! if rustc::is_min_version("1.13.0").unwrap_or(false) {
16 //! println!("cargo:rustc-cfg=question_mark_operator");
26 //! extern crate version_check as rustc;
28 //! match rustc::is_min_date("2018-12-18") {
31 //! None => "Couldn't determine the rustc version."
41 //! extern crate version_check as rustc;
43 //! match rustc::is_feature_flaggable() {
46 //! None => "Couldn't determine the rustc version."
53 //! extern crate version_check as rustc;
55 //! if let Some(true) = rustc::supports_feature("doc_cfg") {
56 //! println!("cargo:rustc-cfg=has_doc_cfg");
63 //! extern crate version_check as rustc;
65 //! match rustc::Channel::read() {
68 //! None => format!("Couldn't determine the rustc version.")
96 /// Parses (version, date) as available from rustc version string.
106 /// Parses (version, date) as available from rustc verbose version output.
112 Some("rustc") => { in version_and_date_from_rustc_verbose_version()
127 /// Returns (version, date) as available from `rustc --version`.
129 let rustc = env::var("RUSTC").unwrap_or_else(|_| "rustc".to_string()); in get_version_and_date() localVariable
130 Command::new(rustc).arg("--verbose").arg("--version").output().ok() in get_version_and_date()
136 /// or running `rustc`.
162 /// Checks that the running or installed `rustc` was released **on or after**
169 /// parsed, returns `None`. Otherwise returns `true` if the installed `rustc`
178 /// Checks that the running or installed `rustc` was released **on or before**
185 /// parsed, returns `None`. Otherwise returns `true` if the installed `rustc`
194 /// Checks that the running or installed `rustc` was released **exactly** on
201 /// returns `None`. Otherwise returns `true` if the installed `rustc` was
210 /// Checks that the running or installed `rustc` is **at least** some minimum
217 /// be parsed, returns `None`. Otherwise returns `true` if the installed `rustc`
226 /// Checks that the running or installed `rustc` is **at most** some maximum
233 /// be parsed, returns `None`. Otherwise returns `true` if the installed `rustc`
242 /// Checks that the running or installed `rustc` is **exactly** some version.
248 /// parsed, returns `None`. Otherwise returns `true` if the installed `rustc` is
257 /// Checks whether the running or installed `rustc` supports feature flags.
261 /// Note that support for specific `rustc` features can be enabled or disabled
273 /// Checks whether the running or installed `rustc` supports `feature`.
283 /// use version_check as rustc;
285 /// if let Some(true) = rustc::supports_feature("doc_cfg") {
286 /// println!("cargo:rustc-cfg=has_doc_cfg");
361 "rustc 1.18.0" => "1.18.0", None, in test_version_parse()
362 "rustc 1.8.0" => "1.8.0", None, in test_version_parse()
363 "rustc 1.20.0-nightly" => "1.20.0-nightly", None, in test_version_parse()
364 "rustc 1.20" => "1.20", None, in test_version_parse()
365 "rustc 1.3" => "1.3", None, in test_version_parse()
366 "rustc 1" => "1", None, in test_version_parse()
367 "rustc 1.5.1-beta" => "1.5.1-beta", None, in test_version_parse()
368 "rustc 1.20.0 (2017-07-09)" => "1.20.0", Some("2017-07-09"), in test_version_parse()
369 "rustc 1.20.0-dev (2017-07-09)" => "1.20.0-dev", Some("2017-07-09"), in test_version_parse()
370 "rustc 1.20.0-nightly (d84693b93 2017-07-09)" => "1.20.0-nightly", Some("2017-07-09"), in test_version_parse()
371 "rustc 1.20.0 (d84693b93 2017-07-09)" => "1.20.0", Some("2017-07-09"), in test_version_parse()
372 "rustc 1.30.0-nightly (3bc2ca7e4 2018-09-20)" => "1.30.0-nightly", Some("2018-09-20"), in test_version_parse()
379 "rustc 1.0.0 (a59de37e9 2015-05-13) (built 2015-05-14)\n\ in test_verbose_version_parse()
380 binary: rustc\n\ in test_verbose_version_parse()
387 "rustc 1.0.0 (a59de37e9 2015-05-13) (built 2015-05-14)\n\ in test_verbose_version_parse()
394 "rustc 1.50.0 (cb75ad5db 2021-02-10)\n\ in test_verbose_version_parse()
395 binary: rustc\n\ in test_verbose_version_parse()
401 "rustc 1.52.0-nightly (234781afe 2021-03-07)\n\ in test_verbose_version_parse()
402 binary: rustc\n\ in test_verbose_version_parse()
409 "rustc 1.41.1\n\ in test_verbose_version_parse()
410 binary: rustc\n\ in test_verbose_version_parse()
417 "rustc 1.49.0\n\ in test_verbose_version_parse()
418 binary: rustc\n\ in test_verbose_version_parse()
424 "rustc 1.50.0 (Fedora 1.50.0-1.fc33)\n\ in test_verbose_version_parse()
425 binary: rustc\n\ in test_verbose_version_parse()
442 .join(format!("rustc-1.{}.0", minor)); in read_static()