about summary refs log tree commit diff
path: root/src/librustc_driver
AgeCommit message (Collapse)AuthorLines
2014-12-21Fallout of std::str stabilizationAlex Crichton-43/+45
2014-12-21rollup merge of #19898: Aatch/issue-19684Alex Crichton-1/+1
#16081 fixed an issue where a nested return statement would cause incorrect behaviour due to the inner return writing over the return stack slot that had already been written too. However, the check was very broad and picked many cases that wouldn't ever be affected by this issue. As a result, the number of allocas increased dramatically and therefore stack-size increased. LLVM is not able to remove all of the extraneous allocas. Any code that had multiple return values in a compound expression at the end of a function (including loops) would be hit by the issue. The check now uses a control-flow graph to only consider the case when the inner return is executed conditionally. By itself, this narrowed definition causes #15763 to return, so the control-flow graph is also used to avoid passing the return slot as a destination when the result won't be used. This change allows the stack-size of the main rustc task to be reduced to 8MB from 32MB.
2014-12-20auto merge of #19900 : alexcrichton/rust/compiler-flags, r=cmrbors-56/+63
This commit shuffles around some CLI flags of the compiler to some more stable locations with some renamings. The changes made were: * The `-v` flag has been repurposes as the "verbose" flag. The version flag has been renamed to `-V`. * The `-h` screen has been split into two parts. Most top-level options (not all) show with `-h`, and the remaining options (generally obscure) can be shown with `--help -v` which is a "verbose help screen" * The `-V` flag (version flag now) has lost its argument as it is now requested with `rustc -vV` "verbose version". * The `--emit` option has had its `ir` and `bc` variants renamed to `llvm-ir` and `llvm-bc` to emphasize that they are LLVM's IR/bytecode. * The `--emit` option has grown a new variant, `dep-info`, which subsumes the `--dep-info` CLI argument. The `--dep-info` flag is now deprecated. * The `--parse-only`, `--no-trans`, `--no-analysis`, and `--pretty` flags have moved behind the `-Z` family of flags. * The `--debuginfo` and `--opt-level` flags were moved behind the top-level `-C` flag. * The `--print-file-name` and `--print-crate-name` flags were moved behind one global `--print` flag which now accepts one of `crate-name`, `file-names`, or `sysroot`. This global `--print` flag is intended to serve as a mechanism for learning various metadata about the compiler itself. * The top-level `--pretty` flag was moved to a number of `-Z` options. No warnings are currently enabled to allow tools like Cargo to have time to migrate to the new flags before spraying warnings to all users. cc https://github.com/rust-lang/rust/issues/19051
2014-12-20auto merge of #19511 : eddyb/rust/no-shadow, r=alexcrichtonbors-1/+1
r? @erickt
2014-12-20Split resolve from rustc::middle into rustc_resolve.Eduard Burtescu-4/+6
2014-12-20middle: resolve: fix inconsistencies around ExportMap and remove the 2 suffix.Eduard Burtescu-3/+3
2014-12-20Remove feature(import_shadowing) from all crates.Eduard Burtescu-1/+1
2014-12-19rustc: Start "stabilizing" some flagsAlex Crichton-56/+63
This commit shuffles around some CLI flags of the compiler to some more stable locations with some renamings. The changes made were: * The `-v` flag has been repurposes as the "verbose" flag. The version flag has been renamed to `-V`. * The `-h` screen has been split into two parts. Most top-level options (not all) show with `-h`, and the remaining options (generally obscure) can be shown with `--help -v` which is a "verbose help screen" * The `-V` flag (version flag now) has lost its argument as it is now requested with `rustc -vV` "verbose version". * The `--emit` option has had its `ir` and `bc` variants renamed to `llvm-ir` and `llvm-bc` to emphasize that they are LLVM's IR/bytecode. * The `--emit` option has grown a new variant, `dep-info`, which subsumes the `--dep-info` CLI argument. The `--dep-info` flag is now deprecated. * The `--parse-only`, `--no-trans`, and `--no-analysis` flags have moved behind the `-Z` family of flags. * The `--debuginfo` and `--opt-level` flags were moved behind the top-level `-C` flag. * The `--print-file-name` and `--print-crate-name` flags were moved behind one global `--print` flag which now accepts one of `crate-name`, `file-names`, or `sysroot`. This global `--print` flag is intended to serve as a mechanism for learning various metadata about the compiler itself. No warnings are currently enabled to allow tools like Cargo to have time to migrate to the new flags before spraying warnings to all users.
2014-12-19librustc_driver: use `#[deriving(Copy)]`Jorge Aparicio-6/+2
2014-12-19auto merge of #19884 : nikomatsakis/rust/issue-19730-perfect-forwarding, ↵bors-2/+125
r=pnkfelix Rewrite how the HRTB algorithm matches impls against obligations. Instead of impls providing higher-ranked trait-references, impls now once again only have early-bound regions. The skolemization checks are thus moved out into trait matching itself. This allows to implement "perfect forwarding" impls like those described in #19730. This PR builds on a previous PR that was already reviewed by @pnkfelix. r? @pnkfelix Fixes #19730
2014-12-19Centralize on using `Binder` to introduce new binding levels, rather than ↵Niko Matsakis-2/+2
having FnSig carry an implicit binding level. This means that we be more typesafe in general, since things that instantiate bound regions can drop the Binder to reflect that.
2014-12-19Fix bug in higher-ranked code that would sometimes leak skolemized regions ↵Niko Matsakis-0/+42
and/or cause incorrect results.
2014-12-19Add tests for sub relationship on free/bound regions, revealing a bug.Niko Matsakis-0/+81
2014-12-18Revise std::thread API to join by defaultAaron Turon-7/+3
This commit is part of a series that introduces a `std::thread` API to replace `std::task`. In the new API, `spawn` returns a `JoinGuard`, which by default will join the spawned thread when dropped. It can also be used to join explicitly at any time, returning the thread's result. Alternatively, the spawned thread can be explicitly detached (so no join takes place). As part of this change, Rust processes now terminate when the main thread exits, even if other detached threads are still running, moving Rust closer to standard threading models. This new behavior may break code that was relying on the previously implicit join-all. In addition to the above, the new thread API also offers some built-in support for building blocking abstractions in user space; see the module doc for details. Closes #18000 [breaking-change]
2014-12-18Fallout from new thread APIAaron Turon-6/+9
2014-12-18Only count nested returns when the outer return is reachableJames Miller-1/+1
This narrows the definition of nested returns such that only when the outer return has a chance of being executed (due to the inner return being conditional) do we mark the function as having nested returns. Fixes #19684
2014-12-17Test fixes and rebase conflictsAlex Crichton-1/+1
2014-12-17rollup merge of #19849: alexcrichton/second-pass-optionAlex Crichton-1/+1
This commit takes a second pass through the `std::option` module to fully stabilize any lingering methods inside of it. These items were made stable as-is * Some * None * as_mut * expect * unwrap * unwrap_or * unwrap_or_else * map * map_or * map_or_else * and_then * or_else * unwrap_or_default * Default implementation * FromIterator implementation * Copy implementation These items were made stable with modifications * iter - now returns a struct called Iter * iter_mut - now returns a struct called IterMut * into_iter - now returns a struct called IntoIter, Clone is never implemented This is a breaking change due to the modifications to the names of the iterator types returned. Code referencing the old names should updated to referencing the newer names instead. This is also a breaking change due to the fact that `IntoIter` no longer implements the `Clone` trait. These items were explicitly not stabilized * as_slice - waiting on indexing conventions * as_mut_slice - waiting on conventions with as_slice as well * cloned - the API was still just recently added * ok_or - API remains experimental * ok_or_else - API remains experimental [breaking-change]
2014-12-15auto merge of #19750 : murarth/rust/rusti-support, r=brsonbors-6/+6
Makes a couple changes that support the implementation of a REPL: * Implementation of wrapper code for LLVM ExecutionEngine API * Fixing a change I made earlier to reset compiler state in `phase_1_[...]` instead of `compile_input` as the latter is not used in a REPL
2014-12-14std: Fully stabilize Option<T>Alex Crichton-1/+1
This commit takes a second pass through the `std::option` module to fully stabilize any lingering methods inside of it. These items were made stable as-is * Some * None * as_mut * expect * unwrap * unwrap_or * unwrap_or_else * map * map_or * map_or_else * and_then * or_else * unwrap_or_default * Default implementation * FromIterator implementation * Copy implementation These items were made stable with modifications * iter - now returns a struct called Iter * iter_mut - now returns a struct called IterMut * into_iter - now returns a struct called IntoIter, Clone is never implemented This is a breaking change due to the modifications to the names of the iterator types returned. Code referencing the old names should updated to referencing the newer names instead. This is also a breaking change due to the fact that `IntoIter` no longer implements the `Clone` trait. These items were explicitly not stabilized * as_slice - waiting on indexing conventions * as_mut_slice - waiting on conventions with as_slice as well * cloned - the API was still just recently added * ok_or - API remains experimental * ok_or_else - API remains experimental [breaking-change]
2014-12-14Rename FnStyle trait to Unsafety.Niko Matsakis-1/+1
2014-12-14Mostly rote conversion of `proc()` to `move||` (and occasionally `Thunk::new`)Niko Matsakis-2/+2
2014-12-13librustc_driver: use unboxed closuresJorge Aparicio-10/+15
2014-12-13librustc_trans: fix falloutJorge Aparicio-5/+3
2014-12-13Separate borrowck into its own crate and remove dead code as well.Niko Matsakis-5/+7
2014-12-11Perform compiler state reset in phase_1Murarth-6/+6
2014-12-11Register new snapshotsAlex Crichton-1/+1
2014-12-09auto merge of #19466 : nikomatsakis/rust/recursion-limit, r=eddybbors-0/+4
This is particularly important for deeply nested types, which generate deeply nested impls. This is a fix for #19318. It's possible we could also improve this particular case not to increment the recursion count, but it's worth being able to adjust the recursion limit anyhow. cc @jdm r? @pcwalton
2014-12-08Add ability to configure recursion limit.Niko Matsakis-0/+4
Fixes #19318.
2014-12-08librustc: Make `Copy` opt-in.Niko Matsakis-0/+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_trans: remove unnecessary `as_mut_slice` callsJorge Aparicio-1/+1
2014-12-06librustc_trans: remove unnecessary `as_slice` callsJorge Aparicio-2/+2
2014-12-05Fix various references in late-running tests and thingsNiko Matsakis-18/+18
2014-12-04FIXME(#19497) -- Stop messing around and just give rustc 32MB of stack ↵Niko Matsakis-7/+1
unconditionally. This is prompted by some sort of bug in trans that causes a stack overflow when the modules in trans are made private. (In particular, the overflow can also be avoided by making `controlflow` and `callee` public, but that seems strictly worse than just using more stack.)
2014-12-04Separate the driver into its own crate that uses trans, typeck.Niko Matsakis-0/+2592