-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #266 from jeremyandrews/minrust
document and enforce minimum `rustc` requirement of `1.49.0`
- Loading branch information
Showing
4 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
use rustc_version::{version, Version}; | ||
use std::io::{self, Write}; | ||
use std::process::exit; | ||
|
||
fn main() { | ||
// Goose can only be compiled with rustc version 1.49.0 or greater. | ||
if version().expect("failed to determine rustc version") | ||
< Version::parse("1.49.0").expect("failed to parse minimum required version") | ||
{ | ||
writeln!(&mut io::stderr(), "goose dependency `flume` depends on `spinning_top` crate which requires rustc >= 1.49.0.").expect("failed to write to stderr"); | ||
writeln!( | ||
&mut io::stderr(), | ||
"detected rustc version: {}", | ||
version().expect("failed to determine rustc version") | ||
) | ||
.expect("failed to write to stderr"); | ||
writeln!(&mut io::stderr(), "note: see issue #55002 <https://github.com/rust-lang/rust/issues/55002> for more information").expect("failed to write to stderr"); | ||
// Exit to avoid a more confusing error message and simplify debugging if | ||
// trying to build Goose with an unsupported version of rustc. | ||
exit(1); | ||
} | ||
} |