diff --git a/src/librustc/metadata/creader.rs b/src/librustc/metadata/creader.rs index 7b71120ba64a6ea9807cb4f53dad5b3b7cc07904..16141b171ffa8dddf3b2b0829b8b1ef5bfca832e 100644 --- a/src/librustc/metadata/creader.rs +++ b/src/librustc/metadata/creader.rs @@ -330,6 +330,7 @@ fn existing_match(&self, name: &str, hash: Option<&Svh>, kind: PathKind) if found { ret = Some(cnum); } + return } // Alright, so we've gotten this far which means that `data` has the diff --git a/src/test/run-make/extern-overrides-distribution/Makefile b/src/test/run-make/extern-overrides-distribution/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..110db9f068dae5d04a1faf8500c8ddd30dbd5b97 --- /dev/null +++ b/src/test/run-make/extern-overrides-distribution/Makefile @@ -0,0 +1,5 @@ +-include ../tools.mk + +all: + $(RUSTC) libc.rs + $(RUSTC) main.rs --extern libc=$(TMPDIR)/liblibc.rlib diff --git a/src/test/run-make/extern-overrides-distribution/libc.rs b/src/test/run-make/extern-overrides-distribution/libc.rs new file mode 100644 index 0000000000000000000000000000000000000000..a489d834a9236ea46aaed2290a2a18ad9923d1aa --- /dev/null +++ b/src/test/run-make/extern-overrides-distribution/libc.rs @@ -0,0 +1,13 @@ +// Copyright 2015 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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![crate_type = "lib"] + +pub fn foo() {} diff --git a/src/test/run-make/extern-overrides-distribution/main.rs b/src/test/run-make/extern-overrides-distribution/main.rs new file mode 100644 index 0000000000000000000000000000000000000000..92b353c892ae7fe58f4a8c24e7e401e4a5833192 --- /dev/null +++ b/src/test/run-make/extern-overrides-distribution/main.rs @@ -0,0 +1,16 @@ +// Copyright 2015 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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +extern crate libc; + +fn main() { + libc::foo(); +} +