// check can populate this table further with impls from other
// crates.
let trait_def_ids: Vec<(ast::DefId, Vec<ast::DefId>)> =
- self.tcx.trait_impls.borrow().iter().map(|(&k, v)|
- (k, v.borrow().clone())).collect();
+ self.tcx.trait_impls.borrow().iter().map(|(&k, v)| {
+ let mut impls = v.borrow().clone();
+ if let Some(neg_impls) = self.tcx.trait_negative_impls.borrow().get(&k) {
+ impls.push_all(neg_impls.borrow().as_slice());
+ }
+ (k, impls)
+ }).collect();
for &(trait_def_id, ref impls) in trait_def_ids.iter() {
self.check_for_overlapping_impls_of_trait(trait_def_id, impls);
--- /dev/null
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![feature(optin_builtin_traits)]
+
+struct TestType;
+
+unsafe impl Send for TestType {}
+//~^ ERROR conflicting implementations for trait `core::marker::Send`
+
+impl !Send for TestType {}
+
+fn main() {}