X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fbootstrap%2Fmetadata.rs;h=e193e70a0c417452b3649571c2cb990be23727db;hb=fb3e724d7602675f147a9b80e70fb6bd6512738c;hp=59dc50be47f0685e6b89fcf7cc70e514f67ac1d1;hpb=313a668234ad7b60fc5df280ba37cf9a39130bd6;p=rust.git diff --git a/src/bootstrap/metadata.rs b/src/bootstrap/metadata.rs index 59dc50be47f..e193e70a0c4 100644 --- a/src/bootstrap/metadata.rs +++ b/src/bootstrap/metadata.rs @@ -49,7 +49,11 @@ pub fn build(build: &mut Build) { .filter(|dep| dep.source.is_none()) .map(|dep| INTERNER.intern_string(dep.name)) .collect(); - build.crates.insert(name, Crate { name, deps, path }); + let krate = Crate { name, deps, path }; + let relative_path = krate.local_path(build); + build.crates.insert(name, krate); + let existing_path = build.crate_paths.insert(relative_path, name); + assert!(existing_path.is_none(), "multiple crates with the same path"); } } }