diff options
| author | gentlefolk <cemacken@gmail.com> | 2014-02-09 22:29:21 -0500 |
|---|---|---|
| committer | gentlefolk <cemacken@gmail.com> | 2014-02-17 18:34:46 -0500 |
| commit | 37bf97a0f9cc764a19dfcff21d62384b2445dcbc (patch) | |
| tree | dc77facb8ce8bdc1a3b1f07bc3fcc756094a4b7f /src/test/run-make | |
| parent | 57d273f65e7dee2fb9a643a55d9337d2f75ee662 (diff) | |
| download | rust-37bf97a0f9cc764a19dfcff21d62384b2445dcbc.tar.gz rust-37bf97a0f9cc764a19dfcff21d62384b2445dcbc.zip | |
Updated metadata::creader::resolve_crate_deps to use the correct span. Clarified error message when an external crate's dependency is missing. Closes #2404.
Diffstat (limited to 'src/test/run-make')
4 files changed, 45 insertions, 0 deletions
diff --git a/src/test/run-make/missing-crate-dependency/Makefile b/src/test/run-make/missing-crate-dependency/Makefile new file mode 100644 index 00000000000..a470ee0a7c1 --- /dev/null +++ b/src/test/run-make/missing-crate-dependency/Makefile @@ -0,0 +1,9 @@ +-include ../tools.mk + +all: + $(RUSTC) --crate-type=rlib crateA.rs + $(RUSTC) --crate-type=rlib crateB.rs + rm $(TMPDIR)/$(call RLIB_GLOB,crateA) + # Ensure crateC fails to compile since dependency crateA is missing + $(RUSTC) crateC.rs 2>&1 | \ + grep "error: can't find crate for \`crateA\` which \`crateB\` depends on" diff --git a/src/test/run-make/missing-crate-dependency/crateA.rs b/src/test/run-make/missing-crate-dependency/crateA.rs new file mode 100644 index 00000000000..4e111f29e8a --- /dev/null +++ b/src/test/run-make/missing-crate-dependency/crateA.rs @@ -0,0 +1,12 @@ +// 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. + +// Base crate +pub fn func() {} diff --git a/src/test/run-make/missing-crate-dependency/crateB.rs b/src/test/run-make/missing-crate-dependency/crateB.rs new file mode 100644 index 00000000000..bf55017c646 --- /dev/null +++ b/src/test/run-make/missing-crate-dependency/crateB.rs @@ -0,0 +1,11 @@ +// 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 crateA; diff --git a/src/test/run-make/missing-crate-dependency/crateC.rs b/src/test/run-make/missing-crate-dependency/crateC.rs new file mode 100644 index 00000000000..174d9382b76 --- /dev/null +++ b/src/test/run-make/missing-crate-dependency/crateC.rs @@ -0,0 +1,13 @@ +// 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 crateB; + +fn main() {} |
