Updated metadata::creader::resolve_crate_deps to use the correct span. Clarified error message when an external crate's dependency is missing. Closes #2404.
This commit is contained in:
parent
57d273f65e
commit
37bf97a0f9
6 changed files with 74 additions and 12 deletions
9
src/test/run-make/missing-crate-dependency/Makefile
Normal file
9
src/test/run-make/missing-crate-dependency/Makefile
Normal file
|
|
@ -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"
|
||||
12
src/test/run-make/missing-crate-dependency/crateA.rs
Normal file
12
src/test/run-make/missing-crate-dependency/crateA.rs
Normal file
|
|
@ -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() {}
|
||||
11
src/test/run-make/missing-crate-dependency/crateB.rs
Normal file
11
src/test/run-make/missing-crate-dependency/crateB.rs
Normal file
|
|
@ -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;
|
||||
13
src/test/run-make/missing-crate-dependency/crateC.rs
Normal file
13
src/test/run-make/missing-crate-dependency/crateC.rs
Normal file
|
|
@ -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() {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue