File tree Expand file tree Collapse file tree 2 files changed +2
-8
lines changed Expand file tree Collapse file tree 2 files changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -724,10 +724,9 @@ impl BuildOutput {
724
724
pkg_descr : & str ,
725
725
msrv : & Option < RustVersion > ,
726
726
) -> CargoResult < ( ) > {
727
- let new_syntax_added_in = & RustVersion :: from_str ( "1.77.0" ) ?;
728
-
729
727
if let Some ( msrv) = msrv {
730
- if msrv < new_syntax_added_in {
728
+ let new_syntax_added_in = RustVersion :: from_str ( "1.77.0" ) ?;
729
+ if !new_syntax_added_in. is_compatible_with ( msrv. as_partial ( ) ) {
731
730
bail ! (
732
731
"the `cargo::` syntax for build script output instructions was added in \
733
732
Rust 1.77.0, but the minimum supported Rust version of `{pkg_descr}` is {msrv}.\n \
Original file line number Diff line number Diff line change @@ -5527,14 +5527,9 @@ fn test_new_syntax_with_compatible_partial_msrv() {
5527
5527
. build ( ) ;
5528
5528
5529
5529
p. cargo ( "check" )
5530
- . with_status ( 101 )
5531
5530
. with_stderr_contains (
5532
5531
"\
5533
5532
[COMPILING] foo [..]
5534
- [ERROR] the `cargo::` syntax for build script output instructions was added in Rust 1.77.0, \
5535
- but the minimum supported Rust version of `foo v0.0.0 ([ROOT]/foo)` is 1.77.
5536
- See https://doc.rust-lang.org/cargo/reference/build-scripts.html#outputs-of-the-build-script \
5537
- for more information about build script outputs.
5538
5533
" ,
5539
5534
)
5540
5535
. run ( ) ;
You can’t perform that action at this time.
0 commit comments