about summary refs log tree commit diff
path: root/src/librustc/metadata
AgeCommit message (Collapse)AuthorLines
2014-11-17auto merge of #19027 : nick29581/rust/coercions-4, r=alexcrichtonbors-1/+1
The forwards compatible parts of #18645, rebased. Converts implicit coercions from `[T, ..n]` to `&[T]` into explicit references.
2014-11-17Fix fallout from coercion removalNick Cameron-1/+1
2014-11-17auto merge of #18914 : Gankro/rust/cloned, r=aturonbors-2/+2
Part of #18424. r? @aturon [breaking-change]
2014-11-16fallout from deprecating find_copy and get_copyAlexis Beingessner-2/+2
2014-11-16Try to remove ty_nil, some kind of error in exhaustiveness checkingNiko Matsakis-2/+0
2014-11-16Look for standard crates in LIBDIR provided by --libdir option,Jauhien Piatlicki-5/+10
not in hardcoded libdir path. If there was no LIBDIR provided during configuration fallback to hardcoded paths. Thanks to Jan Niklas Hasse for solution and to Alex Crichton for improvements. Closes #11671
2014-11-15auto merge of #18922 : japaric/rust/for, r=jakub-bors-6/+6
r? @alexcrichton
2014-11-14auto merge of #18840 : huonw/rust/tweaks, r=alexcrichtonbors-7/+5
Fix some old papercuts with diagnostics, e.g. tweaking spans, rewording messages. See individual commits.
2014-11-13fix "warning: deprecated syntax, use `for` keyword now"Jorge Aparicio-6/+6
2014-11-13Tweak and add test for detecting libraries with mismatching target triples.Huon Wilson-7/+5
Closes #10814.
2014-11-12time: Deprecate the library in the distributionAlex Crichton-7/+9
This commit deprecates the entire libtime library in favor of the externally-provided libtime in the rust-lang organization. Users of the `libtime` crate as-is today should add this to their Cargo manifests: [dependencies.time] git = "https://github.com/rust-lang/time" To implement this transition, a new function `Duration::span` was added to the `std::time::Duration` time. This function takes a closure and then returns the duration of time it took that closure to execute. This interface will likely improve with `FnOnce` unboxed closures as moving in and out will be a little easier. Due to the deprecation of the in-tree crate, this is a: [breaking-change] cc #18855, some of the conversions in the `src/test/bench` area may have been a little nicer with that implemented
2014-11-11auto merge of #18821 : arielb1/rust/fnv-hash-map, r=eddybbors-17/+14
This should improve performance
2014-11-11auto merge of #18797 : vadimcn/rust/prefer-bundled2, r=alexcrichtonbors-6/+2
Based on Windows bundle feedback we got to date, - We *do* want to prefer the bundled linker: The external one might be for the wrong architecture (e.g. 32 bit vs 64 bit). On the other hand, binutils don't add many new features these days, so using an older bundled linker is not likely to be a problem. - We *do* want to prefer bundled libraries: The external ones might not have the symbols we expect (e.g. what's needed for DWARF exceptions vs SjLj). Since `-L rustlib/<triple>/lib` appears first on the linker command line, it's a good place to keep our platform libs that we want to be found first. Closes #18325, closes #17726.
2014-11-10Use FnvHashMap instead of HashMap in rustcAriel Ben-Yehuda-17/+14
2014-11-08Move gcc back to rustlib\<triple>\binVadim Chugunov-6/+2
2014-11-07Make TyTrait embed a `TraitRef`, so that when we extend TraitRef, it ↵Niko Matsakis-10/+6
naturally carries over to object types. I wanted to embed an `Rc<TraitRef>`, but I was foiled by the current static rules, which prohibit non-Sync values from being stored in static locations. This means that the constants for `ty_int` and so forth cannot be initialized.
2014-11-06Fallout from collection conventionsAlexis Beingessner-15/+15
2014-11-05auto merge of #18546 : bkoropoff/rust/unboxed-closures-cross-crate, r=nick29581bors-1/+4
This fixes some metadata/AST encoding problems that lead to ICEs. The way this is currently handled will need revisiting if abstract return types are added, as unboxed closure types from extern crates could show up without being inlined into the local crate. Closes #16790 (I think this was fixed earlier by accident and just needed a test case) Closes #18378 Closes #18543 r? @pcwalton
2014-11-04Implement flexible target specificationCorey Richardson-83/+36
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-03rollup merge of #18536 : bjz/strconvAlex Crichton-5/+6
2014-11-03rollup merge of #18318 : arielb1/transmute-cleanupAlex Crichton-47/+22
2014-11-03Clean-up transmutes in librustcAriel Ben-Yehuda-47/+22
None of them would break by implementation-defined struct layout, but one would break with strict lifetime aliasing, and the rest are just ugly code.
2014-11-03Test fixes and rebase conflictsAlex Crichton-1/+1
2014-11-03rollup merge of #18519 : Gankro/collect-smashAlex Crichton-4/+4
2014-11-03rollup merge of #18470 : alexcrichton/dash-lAlex Crichton-18/+34
2014-11-04Separate string->integer implementation in strconvBrendan Zabarauskas-5/+6
2014-11-02refactor libcollections as part of collection reformAlexis Beingessner-4/+4
* 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-11-02Treat cross-crate unboxed closure def IDs consistentlyBrian Koropoff-1/+4
Always translate the ID into the local crate ID space since presently the only way to encounter an unboxed closure type from another crate is to inline once of its functions. This may need to change if abstract return types are added. Closes #18543
2014-10-31First stage of enum namespacing changesSteven Fackler-0/+25
2014-11-01Rebasing and review changesNick Cameron-5/+5
2014-11-01Cross crait inherant implsNick Cameron-12/+12
2014-11-01Remove FnStyle from DefFn and DefStaticMethodNick Cameron-60/+21
2014-11-01Resolve methods called as functions and...Nick Cameron-20/+33
...defined in another crate. Fixes #18061
2014-10-31DSTify HashJorge Aparicio-5/+5
- 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-18/+34
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-30rollup merge of #18445 : alexcrichton/index-mutAlex Crichton-1/+1
Conflicts: src/libcollections/vec.rs
2014-10-30rollup merge of #18398 : aturon/lint-conventions-2Alex Crichton-4/+4
Conflicts: src/libcollections/slice.rs src/libcore/failure.rs src/libsyntax/parse/token.rs src/test/debuginfo/basic-types-mut-globals.rs src/test/debuginfo/simple-struct.rs src/test/debuginfo/trait-pointers.rs
2014-10-30collections: Enable IndexMut for some collectionsAlex Crichton-1/+1
This commit enables implementations of IndexMut for a number of collections, including Vec, RingBuf, SmallIntMap, TrieMap, TreeMap, and HashMap. At the same time this deprecates the `get_mut` methods on vectors in favor of using the indexing notation. cc #18424
2014-10-29Rename fail! to panic!Steve Klabnik-30/+30
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-10-28Remove ty_bot from the type systemJakub Bukaj-5/+16
We now instead use a fresh variable for expressions that diverge.
2014-10-28Update code with new lint namesAaron Turon-4/+4
2014-10-27Fix monomorphization of unboxed closuresBrian Koropoff-4/+9
This adds a `Substs` field to `ty_unboxed_closure` and plumbs basic handling of it throughout the compiler. trans now correctly monomorphizes captured free variables and llvm function defs. This fixes uses of unboxed closures which reference a free type or region parameter from their environment in either their signature or free variables. Closes #16791
2014-10-24Overhaul typechecking of patternsJakub Bukaj-3/+8
Instead of checking patterns in a top-down fashion with a known expected type on entry, this changes makes typeck establish appropriate constraints between a pattern and the expression it destructures, and lets inference compute the final types or produce good error messages if it's impossible.
2014-10-22Part of #6993. Moved a bunch of uses of Ident to NameJonathan S-40/+43
2014-10-19Remove a large amount of deprecated functionalityAlex Crichton-21/+22
Spring cleaning is here! In the Fall! This commit removes quite a large amount of deprecated functionality from the standard libraries. I tried to ensure that only old deprecated functionality was removed. This is removing lots and lots of deprecated features, so this is a breaking change. Please consult the deprecation messages of the deleted code to see how to migrate code forward if it still needs migration. [breaking-change]
2014-10-16Fix soundness bug in treatment of closure upvars by regionckBrian Koropoff-0/+4
- Unify the representations of `cat_upvar` and `cat_copied_upvar` - In `link_reborrowed_region`, account for the ability of upvars to change their mutability due to later processing. A map of recursive region links we may want to establish in the future is maintained, with the links being established when the kind of the borrow is adjusted. - When categorizing upvars, add an explicit deref that represents the closure environment pointer for closures that do not take the environment by value. The region for the implicit pointer is an anonymous free region type introduced for this purpose. This creates the necessary constraint to prevent unsound reborrows from the environment. - Add a note to categorizations to make it easier to tell when extra dereferences have been inserted by an upvar without having to perform deep pattern matching. - Adjust borrowck to deal with the changes. Where `cat_upvar` and `cat_copied_upvar` were previously treated differently, they are now both treated roughly like local variables within the closure body, as the explicit derefs now ensure proper behavior. However, error diagnostics had to be changed to explicitly look through the extra dereferences to avoid producing confusing messages about references not present in the source code. Closes issue #17403. Remaining work: - The error diagnostics that result from failed region inference are pretty inscrutible and should be improved. Code like the following is now rejected: let mut x = 0u; let f = || &mut x; let y = f(); let z = f(); // multiple mutable references to the same location This also breaks code that uses a similar construction even if it does not go on to violate aliasability semantics. Such code will need to be reworked in some way, such as by using a capture-by-value closure type. [breaking-change]
2014-10-16librustc: Remove all uses of {:?}.Luqman Aden-11/+12
2014-10-15Allow self as an arg in extension methodsNick Cameron-14/+8
2014-10-13Don't ICE on bad extern pathsSteven Fackler-31/+40
Closes #17990
2014-10-09rustc: Convert statics to constantsAlex Crichton-114/+114