rustc: Add knowledge of separate lookup paths
This commit adds support for the compiler to distinguish between different forms of lookup paths in the compiler itself. Issue #19767 has some background on this topic, as well as some sample bugs which can occur if these lookup paths are not separated. This commits extends the existing command line flag `-L` with the same trailing syntax as the `-l` flag. Each argument to `-L` can now have a trailing `:all`, `:native`, `:crate`, or `:dependency`. This suffix indicates what form of lookup path the compiler should add the argument to. The `dependency` lookup path is used when looking up crate dependencies, the `crate` lookup path is used when looking for immediate dependencies (`extern crate` statements), and the `native` lookup path is used for probing for native libraries to insert into rlibs. Paths with `all` are used for all of these purposes (the default). The default compiler lookup path (the rustlib libdir) is by default added to all of these paths. Additionally, the `RUST_PATH` lookup path is added to all of these paths. Closes #19767
This commit is contained in:
parent
62fb41c32b
commit
d085d9d315
20 changed files with 251 additions and 60 deletions
|
@ -9,11 +9,11 @@
|
|||
// except according to those terms.
|
||||
|
||||
use std::io;
|
||||
use std::string::String;
|
||||
|
||||
use core;
|
||||
use getopts;
|
||||
use testing;
|
||||
use rustc::session::search_paths::SearchPaths;
|
||||
|
||||
use externalfiles::ExternalHtml;
|
||||
|
||||
|
@ -135,7 +135,7 @@ pub fn render(input: &str, mut output: Path, matches: &getopts::Matches,
|
|||
}
|
||||
|
||||
/// Run any tests/code examples in the markdown file `input`.
|
||||
pub fn test(input: &str, libs: Vec<Path>, externs: core::Externs,
|
||||
pub fn test(input: &str, libs: SearchPaths, externs: core::Externs,
|
||||
mut test_args: Vec<String>) -> int {
|
||||
let input_str = load_or_return!(input, 1, 2);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue