Auto merge of #21978 - Potpourri:error-extern-crate-staticlib, r=alexcrichton
Add special error for this case and help message `please recompile this crate using --crate-type lib`, also list found candidates. See issue #14416 r? @alexcrichton
This commit is contained in:
commit
e62fec36b9
5 changed files with 61 additions and 5 deletions
|
|
@ -0,0 +1,5 @@
|
|||
-include ../tools.mk
|
||||
|
||||
all:
|
||||
$(RUSTC) foo.rs --crate-type staticlib
|
||||
$(RUSTC) bar.rs 2>&1 | grep "error: found staticlib"
|
||||
15
src/test/run-make/error-found-staticlib-instead-crate/bar.rs
Normal file
15
src/test/run-make/error-found-staticlib-instead-crate/bar.rs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
// 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 <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 foo;
|
||||
|
||||
fn main() {
|
||||
foo::foo();
|
||||
}
|
||||
11
src/test/run-make/error-found-staticlib-instead-crate/foo.rs
Normal file
11
src/test/run-make/error-found-staticlib-instead-crate/foo.rs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
// 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 <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() {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue