File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -159,11 +159,11 @@ impl EncodableResolve {
159
159
let mut checksums = HashMap :: new ( ) ;
160
160
161
161
let mut version = match self . version {
162
- Some ( 4 ) => {
162
+ Some ( 4 ) if ws . config ( ) . nightly_features_allowed => {
163
163
if unstable_lockfile_version_allowed {
164
164
ResolveVersion :: V4
165
165
} else {
166
- anyhow:: bail!( "lock file version 4 requires `-Znext-lockfile-bump`" , )
166
+ anyhow:: bail!( "lock file version 4 requires `-Znext-lockfile-bump`" ) ;
167
167
}
168
168
}
169
169
Some ( 3 ) => ResolveVersion :: V3 ,
Original file line number Diff line number Diff line change @@ -912,6 +912,21 @@ fn v4_is_unstable() {
912
912
"\
913
913
error: failed to parse lock file at: [CWD]/Cargo.lock
914
914
915
+ Caused by:
916
+ lock file version `4` was found, but this version of Cargo does not \
917
+ understand this lock file, perhaps Cargo needs to be updated?
918
+ " ,
919
+ )
920
+ . run ( ) ;
921
+
922
+ // On nightly, let the user know about the `-Z` flag.
923
+ p. cargo ( "fetch" )
924
+ . masquerade_as_nightly_cargo ( & [ "-Znext-lockfile-bump" ] )
925
+ . with_status ( 101 )
926
+ . with_stderr (
927
+ "\
928
+ error: failed to parse lock file at: [CWD]/Cargo.lock
929
+
915
930
Caused by:
916
931
lock file version 4 requires `-Znext-lockfile-bump`
917
932
" ,
You can’t perform that action at this time.
0 commit comments