about summary refs log tree commit diff
path: root/src/librustc/session
AgeCommit message (Collapse)AuthorLines
2015-01-07rollup merge of #20721: japaric/snapAlex Crichton-40/+40
Conflicts: src/libcollections/vec.rs src/libcore/fmt/mod.rs src/librustc/lint/builtin.rs src/librustc/session/config.rs src/librustc_trans/trans/base.rs src/librustc_trans/trans/context.rs src/librustc_trans/trans/type_.rs src/librustc_typeck/check/_match.rs src/librustdoc/html/format.rs src/libsyntax/std_inject.rs src/libsyntax/util/interner.rs src/test/compile-fail/mut-pattern-mismatched.rs
2015-01-07rollup merge of #20680: nick29581/target-wordAlex Crichton-3/+3
Closes #20421 [breaking-change] r? @brson
2015-01-07Preliminary feature stagingBrian Anderson-1/+20
This partially implements the feature staging described in the [release channel RFC][rc]. It does not yet fully conform to the RFC as written, but does accomplish its goals sufficiently for the 1.0 alpha release. It has three primary user-visible effects: * On the nightly channel, use of unstable APIs generates a warning. * On the beta channel, use of unstable APIs generates a warning. * On the beta channel, use of feature gates generates a warning. Code that does not trigger these warnings is considered 'stable', modulo pre-1.0 bugs. Disabling the warnings for unstable APIs continues to be done in the existing (i.e. old) style, via `#[allow(...)]`, not that specified in the RFC. I deem this marginally acceptable since any code that must do this is not using the stable dialect of Rust. Use of feature gates is itself gated with the new 'unstable_features' lint, on nightly set to 'allow', and on beta 'warn'. The attribute scheme used here corresponds to an older version of the RFC, with the `#[staged_api]` crate attribute toggling the staging behavior of the stability attributes, but the user impact is only in-tree so I'm not concerned about having to make design changes later (and I may ultimately prefer the scheme here after all, with the `#[staged_api]` crate attribute). Since the Rust codebase itself makes use of unstable features the compiler and build system to a midly elaborate dance to allow it to bootstrap while disobeying these lints (which would otherwise be errors because Rust builds with `-D warnings`). This patch includes one significant hack that causes a regression. Because the `format_args!` macro emits calls to unstable APIs it would trigger the lint. I added a hack to the lint to make it not trigger, but this in turn causes arguments to `println!` not to be checked for feature gates. I don't presently understand macro expansion well enough to fix. This is bug #20661. Closes #16678 [rc]: https://github.com/rust-lang/rfcs/blob/master/text/0507-release-channels.md
2015-01-07use slicing sugarJorge Aparicio-40/+40
2015-01-08Rename `target_word_size` to `target_pointer_width`Nick Cameron-3/+3
Closes #20421 [breaking-change]
2015-01-06rollup merge of #20653: alexcrichton/entry-unstableAlex Crichton-1/+1
There's been some debate over the precise form that these APIs should take, and they've undergone some changes recently, so these APIs are going to be left unstable for now to be fleshed out during the next release cycle.
2015-01-06rollup merge of #20570: sanxiyn/no-analysisAlex Crichton-1/+1
2015-01-07falloutNick Cameron-2/+2
2015-01-07Replace full slice notation with index callsNick Cameron-30/+30
2015-01-06[breaking change] Revert Entry behaviour to take keys by value.Dylan Ede-1/+1
2015-01-05rollup merge of #20258: sanxiyn/show-span-2Alex Crichton-4/+6
2015-01-05Fix -Z no-analysisSeo Sanghyeon-1/+1
2015-01-05auto merge of #20163 : bfops/rust/master, r=Gankrobors-2/+2
TODOs: - ~~Entry is still `<'a, K, V>` instead of `<'a, O, V>`~~ - ~~BTreeMap is still outstanding~~. - ~~Transform appropriate things into `.entry(...).get().or_else(|e| ...)`~~ Things that make me frowny face: - I'm not happy about the fact that this `clone`s the key even when it's already owned. - With small keys (e.g. `int`s), taking a reference seems wasteful. r? @Gankro cc: @cgaebel
2015-01-04Merge pull request #20485 from ipetkov/man-fixbors-1/+1
Man page/--help dialog fix Reviewed-by: alexcrichton
2015-01-04[breaking change] Update entry API as part of RFC 509.Ben Foppa-2/+2
2015-01-03Remove deprecated functionalityAlex Crichton-25/+23
This removes a large array of deprecated functionality, regardless of how recently it was deprecated. The purpose of this commit is to clean out the standard libraries and compiler for the upcoming alpha release. Some notable compiler changes were to enable warnings for all now-deprecated command line arguments (previously the deprecated versions were silently accepted) as well as removing deriving(Zero) entirely (the trait was removed). The distribution no longer contains the libtime or libregex_macros crates. Both of these have been deprecated for some time and are available externally.
2015-01-03sed -i -s 's/#\[deriving(/#\[derive(/g' **/*.rsJorge Aparicio-14/+14
2015-01-03sed -i -s 's/\bmod,/self,/g' **/*.rsJorge Aparicio-1/+1
2015-01-03Man page/--help dialog fixIvan Petkov-1/+1
* Running rustc with the --print option will accept "file-names" but not "output-file-names"
2015-01-03rustc: fix falloutJorge Aparicio-1/+3
2015-01-02rollup merge of #20382: alexcrichton/isuse-20376Alex Crichton-10/+27
2015-01-02std: Stabilize the prelude moduleAlex Crichton-0/+1
This commit is an implementation of [RFC 503][rfc] which is a stabilization story for the prelude. Most of the RFC was directly applied, removing reexports. Some reexports are kept around, however: * `range` remains until range syntax has landed to reduce churn. * `Path` and `GenericPath` remain until path reform lands. This is done to prevent many imports of `GenericPath` which will soon be removed. * All `io` traits remain until I/O reform lands so imports can be rewritten all at once to `std::io::prelude::*`. This is a breaking change because many prelude reexports have been removed, and the RFC can be consulted for the exact list of removed reexports, as well as to find the locations of where to import them. [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0503-prelude-stabilization.md [breaking-change] Closes #20068
2014-12-31rustc: Re-jigger -L and -l for MSYS compatibilityAlex Crichton-10/+27
As discovered in #20376, the MSYS shell will silently rewrite arguemnts that look like unix paths into their windows path counterparts for compatibility, but the recently added `:kind` syntax added to the `-L` flag does not allow for this form of rewriting. This means that the syntax can be difficult to use at an MSYS prompt, as well as causing tests to fail when run manuall right now. This commit takes the other option presented in the original issue to prefix the path with `kind=` instead of suffixing it with `:kind`. For consistence, the `-l` flag is also now migrating to `kind=name`. This is a breaking change due to the *removal* of behavior with `-L`. All code using `:kind` should now pass `kind=` for `-L` arguments. This is not currently, but will become, a breaking change for `-l` flags. The old `name:kind` syntax is still accepted, but all code should update to `kind=name`. [breaking-change] Closes #20376
2014-12-30auto merge of #19941 : alexcrichton/rust/issue-19767, r=brsonbors-12/+86
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-29Add the -Z print-enum-sizes flag for displaying enum info.Huon Wilson-3/+8
This replaces required the RUST_LOG=... invocation to make it much more user friendly.
2014-12-27Use -Z unstable-options for span debuggerSeo Sanghyeon-5/+4
2014-12-27Add unstable_options methodSeo Sanghyeon-0/+3
2014-12-23rustc: Add knowledge of separate lookup pathsAlex Crichton-12/+86
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-22Test fixes and rebase conflictsAlex Crichton-2/+1
2014-12-22rollup merge of #19964: pnkfelix/everybody-loops-pprintAlex Crichton-45/+131
Conflicts: src/librustc/session/config.rs src/librustc_driver/lib.rs src/librustc_driver/pretty.rs
2014-12-22rollup merge of #20129: nagisa/man-fixesAlex Crichton-4/+4
This pull request updates the rustc manual page to represent current state of rustc option handling better. Moved the apparently deprecated options (#19900) to their own section and added all the new codegen options. A bit unrelatedly, I also updated description of `-O` and `-g` flags to point to the new codegen options rather than old, deprecated ones. Fixes #20111.
2014-12-22Update man page with the new optionsSimonas Kazlauskas-4/+4
This pull request updates the rustc manual page to represent post-#19900 state of rustc options better. A bit unrelatedly, --help output is changed to fix some issues too: * -g and -O descriptions were changed from deprected flags to the new codegen flags. * dep-info value was moved from crate-type to emit flag. Fixes #20111 Fixes #20131
2014-12-22Add an unstable `--xpretty _` option to `rustc`. Moved `flowgraph`Felix S. Klock II-3/+8
and `everybody_loops` options to `--xpretty`.
2014-12-22Add `-Z unstable-options` debugging flag, which can then be used toFelix S. Klock II-42/+122
extend the `rustc` command line interface with options that we do not want to commit to making part of the long-term public interface for `rustc`.
2014-12-21Fallout of std::str stabilizationAlex Crichton-31/+31
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-20auto merge of #19900 : alexcrichton/rust/compiler-flags, r=cmrbors-70/+190
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-19rustc: Start "stabilizing" some flagsAlex Crichton-70/+190
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: use `#[deriving(Copy)]`Jorge Aparicio-15/+5
2014-12-18librustc: Always parse `macro!()`/`macro![]` as expressions if notPatrick Walton-9/+9
followed by a semicolon. This allows code like `vec![1i, 2, 3].len();` to work. This breaks code that uses macros as statements without putting semicolons after them, such as: fn main() { ... assert!(a == b) assert!(c == d) println(...); } It also breaks code that uses macros as items without semicolons: local_data_key!(foo) fn main() { println("hello world") } Add semicolons to fix this code. Those two examples can be fixed as follows: fn main() { ... assert!(a == b); assert!(c == d); println(...); } local_data_key!(foo); fn main() { println("hello world") } RFC #378. Closes #18635. [breaking-change]
2014-12-15Added `-Z print-region-graph` debugging option; produces graphvizFelix S. Klock II-2/+6
visualization of region inference constraint graph. Optionally uses environment variables `RUST_REGION_GRAPH=<path_template>` and `RUST_REGION_GRAPH_NODE=<node-id>` to select which file to output to and which AST node to print. Note that in some cases of method AST's, the identification of AST node is based on the id for the *body* of the method; this is largely due to having the body node-id already available at the relevant point in the control-flow of rustc in its current incarnation. Ideally we would handle identifying AST's by name in addition to node-id, e.g. the same way that the pretty-printer supports path suffixes as well as node-ids for identifying subtrees to print.
2014-12-13librustc: fix falloutJorge Aparicio-1/+3
2014-12-08librustc: Make `Copy` opt-in.Niko Matsakis-1/+11
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_mut_slice` callsJorge Aparicio-1/+1
2014-12-06librustc: remove unnecessary `as_slice()` callsJorge Aparicio-11/+10
2014-12-04Remove dependencies on driver from trans et al. by moving variousNiko Matsakis-0/+53
structs out from driver and into other places.
2014-12-03Replace `equiv` method calls with `==` operator sugarJorge Aparicio-1/+1
2014-11-26Do not print any warnings if '-A warnings' is specified on the command lineJakub Bukaj-3/+53
2014-11-26Add -Z print-sysroot commandline option to rustc.Michael Woerister-3/+6
2014-11-25Added fragments.rs: compute drop obligations remaining post moves.Felix S. Klock II-0/+15
Includes differentiation between assigned_fragments and moved_fragments, support for all-but-one array fragments, and instrumentation to print out the moved/assigned/unmmoved/parents for each function, factored out into separate submodule.