summary refs log tree commit diff
path: root/src/librustc_driver
AgeCommit message (Collapse)AuthorLines
2015-10-23fix bug in hir,identifiedNiko Matsakis-1/+1
2015-09-14move middle::ty and related modules to middle/ty/Ariel Ben-Yehuda-1/+1
2015-09-06add MIR crate and link it into the driverNiko Matsakis-0/+5
2015-09-03Move lints to HIRManish Goregaokar-1/+1
2015-09-03Add an intital HIR and lowering stepNick Cameron-101/+273
2015-08-25Respect `--color` when printing early errorsBarosl Lee-13/+16
Currently, `early_error` and `early_warn` in `librustc::session` always use `ColorConfig::Auto`. Modify them to follow the color configuration set by the `--color` option. As colored output is also printed during the early stage, parsing the `--color` option should be done as early as possible. However, there are still some cases when the output needs to be colored before knowing the exact color settings. In these cases, it will be defaulted to `ColorConfig::Auto`, which is the same as before. Fixes #27879.
2015-08-24fix other testAriel Ben-Yehuda-3/+5
2015-08-24Use a Vec instead of an HashMap for the scope hierarchyAriel Ben-Yehuda-18/+28
This increases regionck performance greatly - type-checking on librustc decreased from 9.1s to 8.1s. Because of Amdahl's law, total performance is improved only by about 1.5% (LLVM wizards, this is your opportunity to shine!). before: 576.91user 4.26system 7:42.36elapsed 125%CPU (0avgtext+0avgdata 1142192maxresident)k after: 566.50user 4.84system 7:36.84elapsed 125%CPU (0avgtext+0avgdata 1124304maxresident)k I am somewhat worried really need to find out why we have this Red Queen's Race going on here. Originally I suspected it may be a problem from RFC1214's warnings, but it seems to be an effect from other changes. However, the increase seems to be mostly in LLVM's time, so I guess it's the LLVM wizards' problem.
2015-08-21Add a `allow_asm` option so virtual ISA based targets (JS/PNaCl/WAsm) can ↵Richard Diamond-0/+3
disallow the asm! macro.
2015-08-17Add some SIMD target_feature cfg's when appropriate.Huon Wilson-1/+101
NB. this may not be 100% perfect.
2015-08-17feature gate `cfg(target_feature)`.Huon Wilson-3/+16
This is theoretically a breaking change, but GitHub search turns up no uses of it, and most non-built-in cfg's are passed via cargo features, which look like `feature = "..."`, and hence can't overlap.
2015-08-15Add issue for the rustc_private feature everywhereAlex Crichton-1/+1
2015-08-14rustc: Allow changing the default allocatorAlex Crichton-84/+82
This commit is an implementation of [RFC 1183][rfc] which allows swapping out the default allocator on nightly Rust. No new stable surface area should be added as a part of this commit. [rfc]: https://github.com/rust-lang/rfcs/pull/1183 Two new attributes have been added to the compiler: * `#![needs_allocator]` - this is used by liballoc (and likely only liballoc) to indicate that it requires an allocator crate to be in scope. * `#![allocator]` - this is a indicator that the crate is an allocator which can satisfy the `needs_allocator` attribute above. The ABI of the allocator crate is defined to be a set of symbols that implement the standard Rust allocation/deallocation functions. The symbols are not currently checked for exhaustiveness or typechecked. There are also a number of restrictions on these crates: * An allocator crate cannot transitively depend on a crate that is flagged as needing an allocator (e.g. allocator crates can't depend on liballoc). * There can only be one explicitly linked allocator in a final image. * If no allocator is explicitly requested one will be injected on behalf of the compiler. Binaries and Rust dylibs will use jemalloc by default where available and staticlibs/other dylibs will use the system allocator by default. Two allocators are provided by the distribution by default, `alloc_system` and `alloc_jemalloc` which operate as advertised. Closes #27389
2015-08-09Use https URLs to refer to rust-lang.org where appropriate.Eli Friedman-2/+2
Also fixes a few outdated links.
2015-08-05Auto merge of #27458 - mitaa:local_cpath, r=nikomatsakisbors-2/+2
This changes the current behaviour for two cases (that I know of) ```rust mod foo { extern crate bar; } // `bar::` changes to `foo::bar::` ``` ```rust extern crate bar as quux; // `bar::` changes to `quux::` ``` For example: ```rust mod foo { extern crate core; } fn assert_clone<T>() where T : Clone { } fn main() { assert_clone::<foo::core::atomic::AtomicBool>(); // error: the trait `core::clone::Clone` is not implemented for the type `core::atomic::AtomicBool` [E0277] // changes to // error: the trait `foo::core::clone::Clone` is not implemented for the type `foo::core::atomic::AtomicBool` [E0277] } ``` Notably the following test case broke: ```rust #[bench] fn bar(x: isize) { } //~^ ERROR mismatched types //~| expected `fn(&mut test::Bencher)` // changed to //~| expected `fn(&mut __test::test::Bencher)` ``` If a crate is linked multiple times the path with the least segments is stored. Partially addresses #1920. (this doesn't solve the issue raised about re-exports) r? @nikomatsakis
2015-08-03syntax: Implement #![no_core]Alex Crichton-1/+1
This commit is an implementation of [RFC 1184][rfc] which tweaks the behavior of the `#![no_std]` attribute and adds a new `#![no_core]` attribute. The `#![no_std]` attribute now injects `extern crate core` at the top of the crate as well as the libcore prelude into all modules (in the same manner as the standard library's prelude). The `#![no_core]` attribute disables both std and core injection. [rfc]: https://github.com/rust-lang/rfcs/pull/1184
2015-08-01Split off `LocalCrateReader` from `CrateReader`mitaa-2/+2
2015-07-30Rename the unstable option `--xpretty` to `--unpretty`Felix S. Klock II-3/+3
(Inspired by discussion with Gankro.)
2015-07-16Fixup #27046 with pattern bindingsManish Goregaokar-12/+12
2015-07-16Rollup merge of #27046 - nrc:driver-defaults, r=alexcrichtonManish Goregaokar-3/+9
2015-07-15Some more default implementations for the compiler driver callbacks.Nick Cameron-3/+9
2015-07-10Change some instances of .connect() to .join()Wesley Wiser-4/+4
2015-07-08Auto merge of #26869 - alexcrichton:fix-msvc-sepcomp, r=nrcbors-6/+4
This commit alters the implementation of multiple codegen units slightly to be compatible with the MSVC linker. Currently the implementation will take the N object files created by each codegen unit and will run `ld -r` to create a new object file which is then passed along. The MSVC linker, however, is not able to do this operation. The compiler will now no longer attempt to assemble object files together but will instead just pass through all the object files as usual. This implies that rlibs may not contain more than one object file (if the library is compiled with more than one codegen unit) and the output of `-C save-temps` will have changed slightly as object files with the extension `0.o` will not be renamed to `o` unless requested otherwise.
2015-07-08trans: Link rlibs to dylibs with --whole-archiveAlex Crichton-6/+4
This commit starts passing the `--whole-archive` flag (`-force_load` on OSX) to the linker when linking rlibs into dylibs. The primary purpose of this commit is to ensure that the linker doesn't strip out objects from an archive when creating a dynamic library. Information on how this can go wrong can be found in issues #14344 and #25185. The unfortunate part about passing this flag to the linker is that we have to preprocess the rlib to remove the metadata and compressed bytecode found within. This means that creating a dylib will now take longer to link as we've got to copy around the input rlibs to a temporary location, modify them, and then invoke the linker. This isn't done for executables, however, so the "hello world" compile time is not affected. This fix was instigated because of the previous commit where rlibs may not contain multiple object files instead of one due to codegen units being greater than one. That change prevented the main distribution from being compiled with more than one codegen-unit and this commit fixes that. Closes #14344 Closes #25185
2015-07-07Revert "rustc_driver: Print stage info in --version --verbose"Brian Anderson-16/+0
This reverts commit 555b021c6e531fc375c62160a176dcc4fe77b798.
2015-07-07Revert "rustc_driver: Omit stage info for stage2+"Brian Anderson-3/+5
This reverts commit e66ac43ea4ca489486c5c5dc59974577449fad44.
2015-07-07Auto merge of #26699 - eddyb:unstable-prelude_import, r=huonwbors-1/+1
Closes #26690.
2015-07-06rustc_driver: Omit stage info for stage2+Richo Healey-5/+3
2015-07-06rustc_driver: Print stage info in --version --verboseRicho Healey-0/+16
2015-07-05Feature-gate #[prelude_import].Eduard Burtescu-1/+1
2015-07-01Update librustc_driver/test.rsJared Roesch-1/+1
2015-06-29Auto merge of #26582 - jroesch:infer-ctxt-refactor, r=nikomatsakisbors-2/+2
This branch begins the work of unifying our type checking contexts into a single piece of state. The goal is to eventually have a single context that we can pass around instead of the fractured situation we currently have. There are still several things that must be done before beginning to make tables item local: - [ ] move FulfillmentContext into InferCtxt - [ ] modify SelectionContext to only take a single context argument - [ ] remove remaining typer impls - [ ] remove the ClosureTyper + Typer trait - [ ] do some renaming to make these things more applicable to their new roles r? @nikomatsakis As a side note there are a couple oddities that are temporary refactors that will be quickly cleaned up in a follow-up PR. cc @eddyb @Aatch @arielb1 @nrc
2015-06-28Fix librustc_driver/test.rsJared Roesch-1/+1
2015-06-27Address nitsJared Roesch-1/+1
2015-06-27rustc_driver: Fix incorrect commentRicho Healey-2/+1
2015-06-26rustc: switch most remaining middle::ty functions to methods.Eduard Burtescu-21/+21
2015-06-26rustc: make ty::mk_* constructors into methods on ty::ctxt.Eduard Burtescu-37/+31
2015-06-26rustc: combine type-flag-checking traits and fns and into one trait.Eduard Burtescu-7/+7
2015-06-20Auto merge of #26417 - brson:feature-err, r=steveklabnikbors-2/+6
It now says '#[feature] may not be used on the stable release channel'. I had to convert this error from a lint to a normal compiler error. I left the lint previously-used for this in place since removing it is a breaking change. It will just go unused until the end of time. Fixes #24125
2015-06-20Auto merge of #26382 - alexcrichton:less-racy-path, r=brsonbors-7/+0
Environment variables are global state so this can lead to surprising results if the driver is called in a multithreaded environment (e.g. doctests). There shouldn't be any memory corruption that's possible, but a lot of the bots have been failing because they can't find `cc` or `gcc` in the path during doctests, and I highly suspect that it is due to the compiler modifying `PATH` in a multithreaded fashion. This commit moves the logic for appending to `PATH` to only affect the child process instead of also affecting the parent, at least for the linking stage. When loading dynamic libraries the compiler still modifies `PATH` on Windows, but this may be more difficult to fix than spawning off a new process.
2015-06-18Make a better error message for using #[feature] on stable rustBrian Anderson-2/+6
It now says '#[feature] may not be used on the stable release channel'. I had to convert this error from a lint to a normal compiler error. I left the lint previously-used for this in place since removing it is a breaking change. It will just go unused until the end of time. Fixes #24125
2015-06-19rustc: remove Repr and UserString.Eduard Burtescu-37/+26
2015-06-19rustc: replace Repr/UserString impls with Debug/Display ones.Eduard Burtescu-7/+4
2015-06-19rustc: use the TLS type context in Repr and UserString.Eduard Burtescu-20/+20
2015-06-19rustc: use Repr and UserString instead of ppaux::ty_to_string.Eduard Burtescu-6/+4
2015-06-19rustc: enforce stack discipline on ty::ctxt.Eduard Burtescu-145/+172
2015-06-19rustc_resolve: don't require redundant arguments to resolve_crate.Eduard Burtescu-6/+2
2015-06-19rustc: remove ownership of tcx from trans' context.Eduard Burtescu-46/+41
2015-06-17rustc_driver: Frob the global PATH lessAlex Crichton-7/+0
Environment variables are global state so this can lead to surprising results if the driver is called in a multithreaded environment (e.g. doctests). There shouldn't be any memory corruption that's possible, but a lot of the bots have been failing because they can't find `cc` or `gcc` in the path during doctests, and I highly suspect that it is due to the compiler modifying `PATH` in a multithreaded fashion. This commit moves the logic for appending to `PATH` to only affect the child process instead of also affecting the parent, at least for the linking stage. When loading dynamic libraries the compiler still modifies `PATH` on Windows, but this may be more difficult to fix than spawning off a new process.
2015-06-17More test fixes and fallout of stability changesAlex Crichton-2/+2