diff --git a/src/cargo/core/source/source_id.rs b/src/cargo/core/source/source_id.rs index 63eb8773e89..47e8ef546f1 100644 --- a/src/cargo/core/source/source_id.rs +++ b/src/cargo/core/source/source_id.rs @@ -23,7 +23,7 @@ lazy_static! { } /// Unique identifier for a source of packages. -#[derive(Clone, Eq, Debug)] +#[derive(Clone, Copy, Eq, Debug)] pub struct SourceId { inner: &'static SourceIdInner, } diff --git a/src/cargo/ops/resolve.rs b/src/cargo/ops/resolve.rs index da01a776318..275fbe752a4 100644 --- a/src/cargo/ops/resolve.rs +++ b/src/cargo/ops/resolve.rs @@ -150,7 +150,7 @@ pub fn resolve_with_previous<'a, 'cfg>( // // TODO: This seems like a hokey reason to single out the registry as being // different - let mut to_avoid_sources = HashSet::new(); + let mut to_avoid_sources: HashSet<&SourceId> = HashSet::new(); if let Some(to_avoid) = to_avoid { to_avoid_sources.extend( to_avoid @@ -161,7 +161,7 @@ pub fn resolve_with_previous<'a, 'cfg>( } let keep = |p: &&'a PackageId| { - !to_avoid_sources.contains(&p.source_id()) && match to_avoid { + !to_avoid_sources.contains(p.source_id()) && match to_avoid { Some(set) => !set.contains(p), None => true, }