about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/librustc/metadata/creader.rs25
-rw-r--r--src/test/run-make/extern-diff-internal-name/Makefile3
-rw-r--r--src/test/run-make/multiple-versions/Makefile9
-rw-r--r--src/test/run-make/multiple-versions/bar.rs14
-rw-r--r--src/test/run-make/multiple-versions/foo.rs11
5 files changed, 1 insertions, 61 deletions
diff --git a/src/librustc/metadata/creader.rs b/src/librustc/metadata/creader.rs
index 171bfd74a81..b44520e2852 100644
--- a/src/librustc/metadata/creader.rs
+++ b/src/librustc/metadata/creader.rs
@@ -20,16 +20,13 @@ use metadata::cstore::{CStore, CrateSource, MetadataBlob};
 use metadata::decoder;
 use metadata::loader;
 use metadata::loader::CratePaths;
-use util::nodemap::FnvHashMap;
 
 use std::rc::Rc;
-use std::collections::hash_map::Entry::{Occupied, Vacant};
 use syntax::ast;
 use syntax::abi;
 use syntax::attr;
 use syntax::attr::AttrMetaMethods;
 use syntax::codemap::{Span, mk_sp};
-use syntax::diagnostic::SpanHandler;
 use syntax::parse;
 use syntax::parse::token::InternedString;
 use syntax::parse::token;
@@ -67,27 +64,6 @@ fn dump_crates(cstore: &CStore) {
     })
 }
 
-fn warn_if_multiple_versions(diag: &SpanHandler, cstore: &CStore) {
-    let mut map = FnvHashMap::new();
-    cstore.iter_crate_data(|cnum, data| {
-        match map.entry(&data.name()) {
-            Vacant(entry) => { entry.insert(vec![cnum]); },
-            Occupied(mut entry) => { entry.get_mut().push(cnum); },
-        }
-    });
-
-    for (name, dupes) in map.into_iter() {
-        if dupes.len() == 1 { continue }
-        diag.handler().warn(
-            format!("using multiple versions of crate `{}`", name)[]);
-        for dupe in dupes.into_iter() {
-            let data = cstore.get_crate_data(dupe);
-            diag.span_note(data.span, "used here");
-            loader::note_crate_name(diag, data.name()[]);
-        }
-    }
-}
-
 fn should_link(i: &ast::ViewItem) -> bool {
     !attr::contains_name(i.attrs[], "no_link")
 }
@@ -188,7 +164,6 @@ impl<'a> CrateReader<'a> {
         if log_enabled!(log::DEBUG) {
             dump_crates(&self.sess.cstore);
         }
-        warn_if_multiple_versions(self.sess.diagnostic(), &self.sess.cstore);
 
         for &(ref name, kind) in self.sess.opts.libs.iter() {
             register_native_lib(self.sess, None, name.clone(), kind);
diff --git a/src/test/run-make/extern-diff-internal-name/Makefile b/src/test/run-make/extern-diff-internal-name/Makefile
index 3787b879c1f..b84e930757b 100644
--- a/src/test/run-make/extern-diff-internal-name/Makefile
+++ b/src/test/run-make/extern-diff-internal-name/Makefile
@@ -2,5 +2,4 @@
 
 all:
 	$(RUSTC) lib.rs
-	$(RUSTC) test.rs --extern foo=$(TMPDIR)/libbar.rlib 2>&1 | \
-		{ ! grep "using multiple versions of crate"; }
+	$(RUSTC) test.rs --extern foo=$(TMPDIR)/libbar.rlib
diff --git a/src/test/run-make/multiple-versions/Makefile b/src/test/run-make/multiple-versions/Makefile
deleted file mode 100644
index e60c16ae0f6..00000000000
--- a/src/test/run-make/multiple-versions/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
--include ../tools.mk
-
-all:
-	$(RUSTC) foo.rs -C metadata=a -C extra-filename=-1 --crate-type=rlib
-	$(RUSTC) foo.rs -C metadata=b -C extra-filename=-2 --crate-type=rlib
-	$(RUSTC) bar.rs \
-		--extern foo1=$(TMPDIR)/libfoo-1.rlib \
-		--extern foo2=$(TMPDIR)/libfoo-2.rlib \
-		2>&1 | grep "using multiple versions of crate .foo."
diff --git a/src/test/run-make/multiple-versions/bar.rs b/src/test/run-make/multiple-versions/bar.rs
deleted file mode 100644
index 262193a0810..00000000000
--- a/src/test/run-make/multiple-versions/bar.rs
+++ /dev/null
@@ -1,14 +0,0 @@
-// 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.
-
-extern crate foo1;
-extern crate foo2;
-
-fn main() {}
diff --git a/src/test/run-make/multiple-versions/foo.rs b/src/test/run-make/multiple-versions/foo.rs
deleted file mode 100644
index 2661b1f4eb4..00000000000
--- a/src/test/run-make/multiple-versions/foo.rs
+++ /dev/null
@@ -1,11 +0,0 @@
-// 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.
-
-pub fn foo() {}