about summary refs log tree commit diff
path: root/src/librustc/driver
AgeCommit message (Collapse)AuthorLines
2014-11-18Move trans, back, driver, and back into a new crate, rustc_trans. Reduces ↵Niko Matsakis-3150/+0
memory usage significantly and opens opportunities for more parallel compilation.
2014-11-17Switch to purely namespaced enumsSteven Fackler-0/+12
This breaks code that referred to variant names in the same namespace as their enum. Reexport the variants in the old location or alter code to refer to the new locations: ``` pub enum Foo { A, B } fn main() { let a = A; } ``` => ``` pub use self::Foo::{A, B}; pub enum Foo { A, B } fn main() { let a = A; } ``` or ``` pub enum Foo { A, B } fn main() { let a = Foo::A; } ``` [breaking-change]
2014-11-17Fix fallout from coercion removalNick Cameron-6/+6
2014-11-16rollup merge of #18979: inrustwetrust/codegen-options-parsingJakub Bukaj-16/+31
2014-11-16Move FromStr to core::strBrendan Zabarauskas-3/+2
2014-11-15Slightly improved rustc error messages for invalid -C argumentsinrustwetrust-16/+31
2014-11-12Register new snapshotsAlex Crichton-28/+0
2014-11-11auto merge of #18797 : vadimcn/rust/prefer-bundled2, r=alexcrichtonbors-2/+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-08Prefer bundled linker.Vadim Chugunov-2/+2
2014-11-07rustc: Process #[cfg]/#[cfg_attr] on cratesAlex Crichton-5/+5
This commit implements processing these two attributes at the crate level as well as at the item level. When #[cfg] is applied at the crate level, then the entire crate will be omitted if the cfg doesn't match. The #[cfg_attr] attribute is processed as usual in that the attribute is included or not depending on whether the cfg matches. This was spurred on by motivations of #18585 where #[cfg_attr] annotations will be applied at the crate-level. cc #18585
2014-11-06Fallout from collection conventionsAlexis Beingessner-1/+1
2014-11-05Fix fallout of DSTifying PartialEq, PartialOrd, Eq, OrdJorge Aparicio-0/+28
2014-11-04Implement flexible target specificationCorey Richardson-111/+58
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 #18519 : Gankro/collect-smashAlex Crichton-1/+1
2014-11-03rollup merge of #18470 : alexcrichton/dash-lAlex Crichton-1/+26
2014-11-03auto merge of #18463 : japaric/rust/bytes2, r=alexcrichtonbors-1/+1
- The `BytesContainer::container_into_owned_bytes` method has been removed - Methods that used to take `BytesContainer` implementors by value, now take them by reference. In particular, this breaks some uses of Path: ``` rust Path::new("foo") // Still works path.join(another_path) -> path.join(&another_path) ``` [breaking-change] --- Re: `container_into_owned_bytes`, I've removed it because - Nothing in the whole repository uses it - Takes `self` by value, which is incompatible with unsized types (`str`) The alternative to removing this method is to split `BytesContainer` into `BytesContainer for Sized?` and `SizedBytesContainer: BytesContainer + Sized`, where the second trait only contains the `container_into_owned_bytes` method. I tried this alternative [in another branch](https://github.com/japaric/rust/commits/bytes) and it works, but it seemed better not to create a new trait for an unused method. Re: Breakage of `Path` methods We could use the idea that @alexcrichton proposed in #18457 (add blanket `impl BytesContainer for &T where T: BytesContainer` + keep taking `T: BytesContainer` by value in `Path` methods) to avoid breaking any code. r? @aturon cc #16918
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-11-02Add type annotation to deal with falloutAaron Turon-1/+1
2014-11-01Remove unnecessary allocationsJorge Aparicio-1/+1
2014-10-30rustc: Implement -l and include! tweaksAlex Crichton-1/+26
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 #18398 : aturon/lint-conventions-2Alex Crichton-2/+2
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-30Fix a minor issue with how lint groups are printed by rustcP1start-1/+2
2014-10-29Rename fail! to panic!Steve Klabnik-10/+10
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-28Revert "enable parallel codegen by default"Daniel Micay-14/+1
This reverts commit c245c5bbad10923b47c9f66d5f0da2913ef11a38. Parallel code generation generates invalid code for librand, which is caught by recent versions of binutils.
2014-10-28Update code with new lint namesAaron Turon-2/+2
2014-10-21enable parallel codegen by defaultStuart Pernsteiner-1/+14
Enable parallel codegen (2 units) by default when --opt-level is 0 or 1. This gives a minor speedup on large crates (~10%), with only a tiny slowdown (~2%) for small ones (which usually build in under a second regardless). The current default (no parallelization) is used when the user requests optimization (--opt-level 2 or 3), and when the user has enabled LTO (which is incompatible with parallel codegen). This commit also changes the rust build system to use parallel codegen when appropriate. This means codegen-units=4 for stage0 always, and also for stage1 and stage2 when configured with --disable-optimize. (Other settings use codegen-units=1 for stage1 and stage2, to get maximum performance for release binaries.) The build system also sets codegen-units=1 for compiletest tests (compiletest does its own parallelization) and uses the same setting as stage2 for crate tests.
2014-10-19Remove a large amount of deprecated functionalityAlex Crichton-23/+16
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-17auto merge of #16855 : P1start/rust/help-messages, r=brsonbors-0/+6
This adds ‘help’ diagnostic messages to rustc. This is used for anything that provides help to the user, particularly the `--explain` messages that were previously integrated into the relevant error message. They look like this: ``` match.rs:10:13: 10:14 error: unreachable pattern [E0001] match.rs:10 1 => {}, ^ match.rs:3:1: 3:38 note: in expansion of foo! match.rs:7:5: 20:2 note: expansion site match.rs:10:13: 10:14 help: pass `--explain E0001` to see a detailed explanation ``` (`help` is coloured cyan.) Adding these errors on a separate line stops the lines from being too long, as discussed in #16619.
2014-10-16librustc: Remove all uses of {:?}.Luqman Aden-2/+1
2014-10-14rustc: Rename lints per RFC 344Aaron Turon-2/+2
RFC 344 proposes a set of naming conventions for lints. This commit renames existing lints to follow the conventions. Use the following sed script to bring your code up to date: ``` s/unnecessary_typecast/unused_typecasts/g s/unsigned_negate/unsigned_negation/g s/type_limits/unused_comparisons/g s/type_overflow/overflowing_literals/g s/ctypes/improper_ctypes/g s/owned_heap_memory/box_pointers/g s/unused_attribute/unused_attributes/g s/path_statement/path_statements/g s/unused_must_use/unused_must_use/g s/unused_result/unused_results/g s/non_uppercase_statics/non_upper_case_globals/g s/unnecessary_parens/unused_parens/g s/unnecessary_import_braces/unused_import_braces/g s/unused_unsafe/unused_unsafe/g s/unsafe_block/unsafe_blocks/g s/unused_mut/unused_mut/g s/unnecessary_allocation/unused_allocation/g s/missing_doc/missing_docs/g s/unused_imports/unused_imports/g s/unused_extern_crate/unused_extern_crates/g s/unnecessary_qualification/unused_qualifications/g s/unrecognized_lint/unknown_lints/g s/unused_variable/unused_variables/g s/dead_assignment/unused_assignments/g s/unknown_crate_type/unknown_crate_types/g s/variant_size_difference/variant_size_differences/g s/transmute_fat_ptr/fat_ptr_transmutes/g ``` Closes #16545 Closes #17932 Due to deprecation, this is a: [breaking-change]
2014-10-10auto merge of #17037 : kmcallister/rust/no-stack-check, r=thestingerbors-0/+2
r? @brson Fixes #16980.
2014-10-09Add -C no-stack-checkKeegan McAllister-0/+2
Fixes #16980.
2014-10-09rustc: Convert statics to constantsAlex Crichton-3/+3
2014-10-06Properly handle cfgs in rustdocSteven Fackler-1/+1
Rustdoc would previously improperly handle key="value" style cfgs, which are notably used for Cargo features.
2014-10-03Set the `non_uppercase_statics` lint to warn by defaultP1start-0/+2
2014-10-02rollup merge of #17682 : nodakai/librustc-handy-versionAlex Crichton-4/+20
2014-10-02auto merge of #17590 : bjadamson/rust/rustc-improvements, r=alexcrichtonbors-5/+2
Removes an unnecessary allocation when passing the command line arguments to the librustc driver.
2014-10-02auto merge of #17681 : jgallagher/rust/dep-info-escape-spaces, r=alexcrichtonbors-1/+7
cc #17627
2014-10-02librustc/driver: expose build information of rustc.NODA, Kai-4/+20
CFG_RELEASE, CFG_VER_HASH and CFG_VER_DATE were only available as an output to stdout from the driver::version() function that had an inconvenient signature.
2014-10-01Make --dep-info escape spaces in filenamesJohn Gallagher-1/+7
Closes #17627
2014-10-01Limit recursion depth for macro expansions, closes #17628Florian Hahn-0/+1
2014-09-30Remove unnecessary allocation, update API name for starting the rustc driver.Benjamin Adamson-5/+2
2014-09-29rollup merge of #17592 : kmcallister/inline-asm-locAlex Crichton-0/+2
2014-09-29rollup merge of #17576 : kmcallister/hide-quotesAlex Crichton-1/+2
2014-09-28auto merge of #17527 : sfackler/rust/cfg-syntax, r=alexcrichtonbors-2/+2
We'll need a snapshot before we can convert the codebase over and turn on the deprecation warnings. cc #17490 This is sitting on top of #17506
2014-09-27Convert cfg syntax to new systemSteven Fackler-2/+2
This removes the ability to use `foo(bar)` style cfgs. Switch them to `foo_bar` or `foo="bar"` instead. [breaking-change]
2014-09-27Translate inline assembly errors back to source locationsKeegan McAllister-0/+2
Fixes #17552.
2014-09-26Hide the quote_*! macros when the feature gate is offKeegan McAllister-1/+2
This makes it easier to experiment with improved quasiquoting as an ordinary plugin library. The list of quote macros in feature_gate.rs was already out of sync; this commit also prevents that problem in the future.
2014-09-25Remove the last redundant check from kindck, and then remove the pass as well.Niko Matsakis-3/+7
2014-09-25auto merge of #17378 : Gankro/rust/hashmap-entry, r=aturonbors-2/+6
Deprecates the `find_or_*` family of "internal mutation" methods on `HashMap` in favour of the "external mutation" Entry API as part of RFC 60. Part of #17320, but this still needs to be done on the rest of the maps. However they don't have any internal mutation methods defined, so they can be done without deprecating or breaking anything. Work on `BTree` is part of the complete rewrite in #17334. The implemented API deviates from the API described in the RFC in two key places: * `VacantEntry.set` yields a mutable reference to the inserted element to avoid code duplication where complex logic needs to be done *regardless* of whether the entry was vacant or not. * `OccupiedEntry.into_mut` was added so that it is possible to return a reference into the map beyond the lifetime of the Entry itself, providing functional parity to `VacantEntry.set`. This allows the full find_or_insert functionality to be implemented using this API. A PR will be submitted to the RFC to amend this. [breaking-change]