File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -756,15 +756,21 @@ pub(crate) fn warn_host_version_mismatch(
756
756
host_version_meta. short_version_string
757
757
) ;
758
758
if versions. is_lt ( ) || ( versions. is_eq ( ) && dates. is_lt ( ) ) {
759
- msg_info. warn ( format_args ! ( "using older {rustc_warning}.\n > Update with `rustup update --force-non-host {toolchain}`" ) ) ?;
759
+ if cfg ! ( not( test) ) {
760
+ msg_info. warn ( format_args ! ( "using older {rustc_warning}.\n > Update with `rustup update --force-non-host {toolchain}`" ) ) ?;
761
+ }
760
762
return Ok ( VersionMatch :: OlderTarget ) ;
761
763
} else if versions. is_gt ( ) || ( versions. is_eq ( ) && dates. is_gt ( ) ) {
762
- msg_info. warn ( format_args ! (
763
- "using newer {rustc_warning}.\n > Update with `rustup update`"
764
- ) ) ?;
764
+ if cfg ! ( not( test) ) {
765
+ msg_info. warn ( format_args ! (
766
+ "using newer {rustc_warning}.\n > Update with `rustup update`"
767
+ ) ) ?;
768
+ }
765
769
return Ok ( VersionMatch :: NewerTarget ) ;
766
770
} else {
767
- msg_info. warn ( format_args ! ( "using {rustc_warning}." ) ) ?;
771
+ if cfg ! ( not( test) ) {
772
+ msg_info. warn ( format_args ! ( "using {rustc_warning}." ) ) ?;
773
+ }
768
774
return Ok ( VersionMatch :: Different ) ;
769
775
}
770
776
}
You can’t perform that action at this time.
0 commit comments