File tree Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -146,6 +146,8 @@ pub trait Source {
146
146
fn describe ( & self ) -> String ;
147
147
148
148
/// Returns whether a source is being replaced by another here.
149
+ ///
150
+ /// Builtin replacement of `crates.io` doesn't count as replacement here.
149
151
fn is_replaced ( & self ) -> bool {
150
152
false
151
153
}
Original file line number Diff line number Diff line change @@ -3833,3 +3833,43 @@ fn builtin_source_replacement() {
3833
3833
)
3834
3834
. run ( ) ;
3835
3835
}
3836
+
3837
+ #[ cargo_test]
3838
+ fn builtin_source_replacement_no_vendor_error ( ) {
3839
+ // errors for builtin source replacement of crates.io
3840
+ // should not mention outdated vendor dependencies
3841
+ let server = RegistryBuilder :: new ( ) . build ( ) ;
3842
+
3843
+ let p = project ( )
3844
+ . file (
3845
+ "Cargo.toml" ,
3846
+ r#"
3847
+ [package]
3848
+ name = "foo"
3849
+ version = "0.0.1"
3850
+ edition = "2021"
3851
+
3852
+ [dependencies]
3853
+ dep = "0.2.0"
3854
+ "# ,
3855
+ )
3856
+ . file ( "src/main.rs" , "fn main() {}" )
3857
+ . build ( ) ;
3858
+
3859
+ let pkg = Package :: new ( "dep" , "0.1.0" ) ;
3860
+ pkg. publish ( ) ;
3861
+
3862
+ p. cargo ( "check -v" )
3863
+ . replace_crates_io ( & server. index_url ( ) )
3864
+ . with_status ( 101 )
3865
+ . with_stderr (
3866
+ "\
3867
+ [UPDATING] [..] index
3868
+ [ERROR] failed to select a version for the requirement `dep = \" ^0.2.0\" `
3869
+ candidate versions found which didn't match: 0.1.0
3870
+ location searched: crates.io index
3871
+ required by package `foo v0.0.1 ([..])`
3872
+ " ,
3873
+ )
3874
+ . run ( ) ;
3875
+ }
You can’t perform that action at this time.
0 commit comments