about summary refs log tree commit diff
path: root/src/librustc/metadata/creader.rs
AgeCommit message (Collapse)AuthorLines
2015-02-06Improve error message, when found staticlib instead cratePotpourri-1/+3
2015-02-04remove all kind annotations from closuresJorge Aparicio-1/+1
2015-02-02rollup merge of #21830: japaric/for-cleanupAlex Crichton-3/+3
Conflicts: src/librustc/metadata/filesearch.rs src/librustc_back/target/mod.rs src/libstd/os.rs src/libstd/sys/windows/os.rs src/libsyntax/ext/tt/macro_parser.rs src/libsyntax/print/pprust.rs src/test/compile-fail/issue-2149.rs
2015-02-02`for x in xs.iter()` -> `for x in &xs`Jorge Aparicio-3/+3
2015-01-30rustc: Use --extern to always overrideAlex Crichton-0/+1
Previously if --extern was specified it would not override crates in the standard distribution, leading to issues like #21771. This commit alters the behavior such that if --extern is passed then it will always override any other choice of crates and no previous match will be used (unless it is the same path as --extern). Closes #21771
2015-01-21rustc: fix fallout of merging ast::ViewItem into ast::Item.Eduard Burtescu-31/+25
2015-01-16rustc: Fix a leak in dependency= pathsAlex Crichton-26/+38
With the addition of separate search paths to the compiler, it was intended that applications such as Cargo could require a `--extern` flag per `extern crate` directive in the source. The system can currently be subverted, however, due to the `existing_match()` logic in the crate loader. When loading crates we first attempt to match an `extern crate` directive against all previously loaded crates to avoid reading metadata twice. This "hit the cache if possible" step was erroneously leaking crates across the search path boundaries, however. For example: extern crate b; extern crate a; If `b` depends on `a`, then it will load crate `a` when the `extern crate b` directive is being processed. When the compiler reaches `extern crate a` it will use the previously loaded version no matter what. If the compiler was not invoked with `-L crate=path/to/a`, it will still succeed. This behavior is allowing `extern crate` declarations in Cargo without a corresponding declaration in the manifest of a dependency, which is considered a bug. This commit fixes this problem by keeping track of the origin search path for a crate. Crates loaded from the dependency search path are not candidates for crates which are loaded from the crate search path. As a result of this fix, this is a likely a breaking change for a number of Cargo packages. If the compiler starts informing that a crate can no longer be found, it likely means that the dependency was forgotten in your Cargo.toml. [breaking-change]
2015-01-09Make the metadata loader use the appropriate Target structureJohn Kåre Alsaker-0/+3
Fixes #19907
2015-01-08Add test for -Z extra-pluginsManish Goregaokar-2/+2
2015-01-08libsyntax: add COMMAND_LINE_SP and use it for spans generated from the ↵Manish Goregaokar-2/+2
command line
2015-01-08librustc_driver: Add support for loading plugins via command line (fixes #15446)Manish Goregaokar-1/+1
2015-01-08librustc::plugin : make PluginLoader usable for loading argument-specified ↵Manish Goregaokar-0/+1
plugins
2015-01-08librustc::metadata : Allow passing a string to read_plugin_metadataManish Goregaokar-7/+24
2015-01-07use slicing sugarJorge Aparicio-20/+20
2015-01-06More test fixesAlex Crichton-1/+1
2015-01-07falloutNick Cameron-4/+4
2015-01-07Replace full slice notation with index callsNick Cameron-16/+18
2015-01-06rustc: Turn off multiple versions of crate warningAlex Crichton-25/+0
This warning has been around in the compiler for quite some time now, but the real place for a warning like this, if it should exist, is in Cargo, not in the compiler itself. It's a first-class feature of Cargo that multiple versions of a crate can be compiled into the same executable, and we shouldn't be warning about our first-class features.
2015-01-05Allow selective macro importKeegan McAllister-1/+4
2015-01-05Move #[macro_reexport] to extern crateKeegan McAllister-0/+1
2015-01-05Replace #[phase] with #[plugin] / #[macro_use] / #[no_link]Keegan McAllister-6/+1
2015-01-05creader: Load parts of plugin metadata on demandKeegan McAllister-50/+98
2015-01-05Reformat metadata for exported macrosKeegan McAllister-4/+36
Instead of copy-pasting the whole macro_rules! item from the original .rs file, we serialize a separate name, attributes list, and body, the latter as pretty-printed TTs. The compilation of macro_rules! macros is decoupled somewhat from the expansion of macros in item position. This filters out comments, and facilitates selective imports.
2015-01-05creader: Use a single structKeegan McAllister-53/+41
2015-01-05creader: Convert free functions to Env methodsKeegan McAllister-264/+267
2015-01-04[breaking change] Update entry API as part of RFC 509.Ben Foppa-2/+2
2014-12-31rustc: unbox closures used in let bindingsJorge Aparicio-1/+1
2014-12-23rustc: Add knowledge of separate lookup pathsAlex Crichton-8/+13
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
2014-12-21Fallout of std::str stabilizationAlex Crichton-20/+20
2014-12-21Remove a ton of public reexportsCorey Farwell-1/+1
Remove most of the public reexports mentioned in #19253 These are all leftovers from the enum namespacing transition In particular: * src/libstd/num/strconv.rs * ExponentFormat * SignificantDigits * SignFormat * src/libstd/path/windows.rs * PathPrefix * src/libstd/sys/windows/timer.rs * Req * src/libcollections/str.rs * MaybeOwned * src/libstd/collections/hash/map.rs * Entry * src/libstd/collections/hash/table.rs * BucketState * src/libstd/dynamic_lib.rs * Rtld * src/libstd/io/net/ip.rs * IpAddr * src/libstd/os.rs * MemoryMapKind * MapOption * MapError * src/libstd/sys/common/net.rs * SocketStatus * InAddr * src/libstd/sys/unix/timer.rs * Req [breaking-change]
2014-12-08librustc: Make `Copy` opt-in.Niko Matsakis-2/+4
This change makes the compiler no longer infer whether types (structures and enumerations) implement the `Copy` trait (and thus are implicitly copyable). Rather, you must implement `Copy` yourself via `impl Copy for MyType {}`. A new warning has been added, `missing_copy_implementations`, to warn you if a non-generic public type has been added that could have implemented `Copy` but didn't. For convenience, you may *temporarily* opt out of this behavior by using `#![feature(opt_out_copy)]`. Note though that this feature gate will never be accepted and will be removed by the time that 1.0 is released, so you should transition your code away from using it. This breaks code like: #[deriving(Show)] struct Point2D { x: int, y: int, } fn main() { let mypoint = Point2D { x: 1, y: 1, }; let otherpoint = mypoint; println!("{}{}", mypoint, otherpoint); } Change this code to: #[deriving(Show)] struct Point2D { x: int, y: int, } impl Copy for Point2D {} fn main() { let mypoint = Point2D { x: 1, y: 1, }; let otherpoint = mypoint; println!("{}{}", mypoint, otherpoint); } This is the backwards-incompatible part of #13231. Part of RFC #3. [breaking-change]
2014-12-06librustc: remove unnecessary `as_slice()` callsJorge Aparicio-2/+2
2014-12-03Replace `equiv` method calls with `==` operator sugarJorge Aparicio-9/+9
2014-11-18Move trans, back, driver, and back into a new crate, rustc_trans. Reduces ↵Niko Matsakis-5/+4
memory usage significantly and opens opportunities for more parallel compilation.
2014-11-18rollup merge of #19000: IvanUkhov/doc-link-dylibJakub Bukaj-0/+2
Hello, `dylib` [seems][1] to be no longer an option for the `kind` key of the `link` attribute. UPDATE: It should be the other way around: It [seems][1] `dylib` has been lost as a possible variant of the `kind` key of the `link` attribute. See the comment below. Regards, Ivan [1]: https://github.com/rust-lang/rust/blob/8f8753878644b0bfb38d24781edb9ef2028730f2/src/librustc/metadata/creader.rs#L237
2014-11-17Fallout from deprecationAaron Turon-1/+1
This commit handles the fallout from deprecating `_with` and `_equiv` methods.
2014-11-17Bring back the dylib kind of the link attributeIvan Ukhov-0/+2
2014-11-10Use FnvHashMap instead of HashMap in rustcAriel Ben-Yehuda-2/+2
2014-11-04Implement flexible target specificationCorey Richardson-9/+7
Removes all target-specific knowledge from rustc. Some targets have changed during this, but none of these should be very visible outside of cross-compilation. The changes make our targets more consistent. iX86-unknown-linux-gnu is now only available as i686-unknown-linux-gnu. We used to accept any value of X greater than 1. i686 was released in 1995, and should encompass the bare minimum of what Rust supports on x86 CPUs. The only two windows targets are now i686-pc-windows-gnu and x86_64-pc-windows-gnu. The iOS target has been renamed from arm-apple-ios to arm-apple-darwin. A complete list of the targets we accept now: arm-apple-darwin arm-linux-androideabi arm-unknown-linux-gnueabi arm-unknown-linux-gnueabihf i686-apple-darwin i686-pc-windows-gnu i686-unknown-freebsd i686-unknown-linux-gnu mips-unknown-linux-gnu mipsel-unknown-linux-gnu x86_64-apple-darwin x86_64-unknown-freebsd x86_64-unknown-linux-gnu x86_64-pc-windows-gnu Closes #16093 [breaking-change]
2014-11-03Test fixes and rebase conflictsAlex Crichton-1/+1
2014-11-03rollup merge of #18519 : Gankro/collect-smashAlex Crichton-1/+1
2014-11-03rollup merge of #18470 : alexcrichton/dash-lAlex Crichton-17/+33
2014-11-02refactor libcollections as part of collection reformAlexis Beingessner-1/+1
* Moves multi-collection files into their own directory, and splits them into seperate files * Changes exports so that each collection has its own module * Adds underscores to public modules and filenames to match standard naming conventions (that is, treemap::{TreeMap, TreeSet} => tree_map::TreeMap, tree_set::TreeSet) * Renames PriorityQueue to BinaryHeap * Renames SmallIntMap to VecMap * Miscellanious fallout fixes [breaking-change]
2014-10-31DSTify HashJorge Aparicio-1/+1
- The signature of the `*_equiv` methods of `HashMap` and similar structures have changed, and now require one less level of indirection. Change your code from: ``` hashmap.find_equiv(&"Hello"); hashmap.find_equiv(&&[0u8, 1, 2]); ``` to: ``` hashmap.find_equiv("Hello"); hashmap.find_equiv(&[0u8, 1, 2]); ``` - The generic parameter `T` of the `Hasher::hash<T>` method have become `Sized?`. Downstream code must add `Sized?` to that method in their implementations. For example: ``` impl Hasher<FnvState> for FnvHasher { fn hash<T: Hash<FnvState>>(&self, t: &T) -> u64 { /* .. */ } } ``` must be changed to: ``` impl Hasher<FnvState> for FnvHasher { fn hash<Sized? T: Hash<FnvState>>(&self, t: &T) -> u64 { /* .. */ } // ^^^^^^ } ``` [breaking-change]
2014-10-30rustc: Implement -l and include! tweaksAlex Crichton-17/+33
This is an implementation of the rustc bits of [RFC 403][rfc]. This adds a new flag to the compiler, `-l`, as well as tweaking the `include!` macro (and related source-centric macros). The compiler's new `-l` flag is used to link libraries in from the command line. This flag stacks with `#[link]` directives already found in the program. The purpose of this flag, also stated in the RFC, is to ease linking against native libraries which have wildly different requirements across platforms and even within distributions of one platform. This flag accepts a string of the form `NAME[:KIND]` where `KIND` is optional or one of dylib, static, or framework. This is roughly equivalent to if the equivalent `#[link]` directive were just written in the program. The `include!` macro has been modified to recursively expand macros to allow usage of `concat!` as an argument, for example. The use case spelled out in RFC 403 was for `env!` to be used as well to include compile-time generated files. The macro also received a bit of tweaking to allow it to expand to either an expression or a series of items, depending on what context it's used in. [rfc]: https://github.com/rust-lang/rfcs/pull/403
2014-10-29Rename fail! to panic!Steve Klabnik-1/+1
https://github.com/rust-lang/rfcs/pull/221 The current terminology of "task failure" often causes problems when writing or speaking about code. You often want to talk about the possibility of an operation that returns a Result "failing", but cannot because of the ambiguity with task failure. Instead, you have to speak of "the failing case" or "when the operation does not succeed" or other circumlocutions. Likewise, we use a "Failure" header in rustdoc to describe when operations may fail the task, but it would often be helpful to separate out a section describing the "Err-producing" case. We have been steadily moving away from task failure and toward Result as an error-handling mechanism, so we should optimize our terminology accordingly: Result-producing functions should be easy to describe. To update your code, rename any call to `fail!` to `panic!` instead. Assuming you have not created your own macro named `panic!`, this will work on UNIX based systems: grep -lZR 'fail!' . | xargs -0 -l sed -i -e 's/fail!/panic!/g' You can of course also do this by hand. [breaking-change]
2014-09-24handling fallout from entry apiAlexis Beingessner-1/+5
2014-09-16Fallout from renamingAaron Turon-2/+2
2014-09-14auto merge of #17189 : bkoropoff/rust/extern-existing-crate, r=alexcrichtonbors-2/+2
When checking for an existing crate, compare against the `crate_metadata::name` field, which is the crate name which was requested during resolution, rather than the result of the `crate_metadata::name()` method, which is the crate name within the crate metadata, as these may not match when using the --extern option to `rustc`. This fixes spurious "multiple crate version" warnings under the following scenario: - The crate `foo`, is referenced multiple times - `--extern foo=./path/to/libbar.rlib` is specified to rustc - The internal crate name of `libbar.rlib` is not `foo` The behavior surrounding `Context::should_match_name` and the comments in `loader.rs` both lead me to believe that this scenario is intended to work. Fixes #17186
2014-09-12Track the visited AST's lifetime throughout Visitor.Eduard Burtescu-1/+1