diff --git a/src/librustc/metadata/creader.rs b/src/librustc/metadata/creader.rs index 7b71120ba64..16141b171ff 100644 --- a/src/librustc/metadata/creader.rs +++ b/src/librustc/metadata/creader.rs @@ -330,6 +330,7 @@ impl<'a> CrateReader<'a> { 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 00000000000..110db9f068d --- /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 00000000000..a489d834a92 --- /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 00000000000..92b353c892a --- /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(); +} +