summary refs log tree commit diff
path: root/src/librustc/session
AgeCommit message (Collapse)AuthorLines
2015-12-09Auto merge of #30208 - pnkfelix:fix-issue-30063, r=alexcrichtonbors-1/+46
When given `rustc -C codegen-units=4 --emit=obj`, reset units back to 1. Fix #30063 Note: while this code is careful to handle the case of mutliple emit types (e.g. `--emit=asm,obj`) by reporting all the emit types that conflict with codegen units in its warnings, an invocation with multiple emit types *and* `-o PATH` will continue to ignore the requested target path (with a warning), as it already does today, since the code that checks for that is further downstream. (Multiple emit types without `-o PATH` will "work", though it will downgrade codegen-units to 1 just like all the other cases.) r? @alexcrichton
2015-12-08When given `rustc -C codegen-units=4 -o output --emit=obj`, reset units back ↵Felix S. Klock II-1/+46
to 1. Fix #30063 Note: while this code is careful to handle the case of mutliple emit types (e.g. `--emit=asm,obj`) by reporting all the emit types that conflict with codegen units in its warnings, an invocation with multiple emit types *and* `-o PATH` will continue to ignore the requested target path (with a warning), as it already does today, since the code that checks for that is further downstream.
2015-12-05std: Stabilize APIs for the 1.6 releaseAlex Crichton-2/+2
This commit is the standard API stabilization commit for the 1.6 release cycle. The list of issues and APIs below have all been through their cycle-long FCP and the libs team decisions are listed below Stabilized APIs * `Read::read_exact` * `ErrorKind::UnexpectedEof` (renamed from `UnexpectedEOF`) * libcore -- this was a bit of a nuanced stabilization, the crate itself is now marked as `#[stable]` and the methods appearing via traits for primitives like `char` and `str` are now also marked as stable. Note that the extension traits themeselves are marked as unstable as they're imported via the prelude. The `try!` macro was also moved from the standard library into libcore to have the same interface. Otherwise the functions all have copied stability from the standard library now. * The `#![no_std]` attribute * `fs::DirBuilder` * `fs::DirBuilder::new` * `fs::DirBuilder::recursive` * `fs::DirBuilder::create` * `os::unix::fs::DirBuilderExt` * `os::unix::fs::DirBuilderExt::mode` * `vec::Drain` * `vec::Vec::drain` * `string::Drain` * `string::String::drain` * `vec_deque::Drain` * `vec_deque::VecDeque::drain` * `collections::hash_map::Drain` * `collections::hash_map::HashMap::drain` * `collections::hash_set::Drain` * `collections::hash_set::HashSet::drain` * `collections::binary_heap::Drain` * `collections::binary_heap::BinaryHeap::drain` * `Vec::extend_from_slice` (renamed from `push_all`) * `Mutex::get_mut` * `Mutex::into_inner` * `RwLock::get_mut` * `RwLock::into_inner` * `Iterator::min_by_key` (renamed from `min_by`) * `Iterator::max_by_key` (renamed from `max_by`) Deprecated APIs * `ErrorKind::UnexpectedEOF` (renamed to `UnexpectedEof`) * `OsString::from_bytes` * `OsStr::to_cstring` * `OsStr::to_bytes` * `fs::walk_dir` and `fs::WalkDir` * `path::Components::peek` * `slice::bytes::MutableByteVector` * `slice::bytes::copy_memory` * `Vec::push_all` (renamed to `extend_from_slice`) * `Duration::span` * `IpAddr` * `SocketAddr::ip` * `Read::tee` * `io::Tee` * `Write::broadcast` * `io::Broadcast` * `Iterator::min_by` (renamed to `min_by_key`) * `Iterator::max_by` (renamed to `max_by_key`) * `net::lookup_addr` New APIs (still unstable) * `<[T]>::sort_by_key` (added to mirror `min_by_key`) Closes #27585 Closes #27704 Closes #27707 Closes #27710 Closes #27711 Closes #27727 Closes #27740 Closes #27744 Closes #27799 Closes #27801 cc #27801 (doesn't close as `Chars` is still unstable) Closes #28968
2015-11-26fix rustc-testAriel Ben-Yehuda-6/+11
2015-11-26split the metadata code into rustc_metadataAriel Ben-Yehuda-3/+210
tests & rustdoc still broken
2015-11-26make CrateStore a trait objectAriel Ben-Yehuda-7/+9
rustdoc still broken
2015-11-22Look up macro names as well when suggesting replacements for function ↵Manish Goregaokar-1/+7
resolve errors fixes #5780
2015-11-19Add -C inline-thresholdBrian Anderson-0/+2
Corresponds directly to llvm's inline-threshold
2015-11-12Add -Zinput-statsNick Cameron-25/+27
Emits loc, and node count - before and after expansion. E.g., ``` rustc: x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore Lines of code: 32060 Pre-expansion node count: 120205 Post-expansion node count: 482749 ```
2015-11-10Fix help text for flowgraph debug optionsManish Goregaokar-4/+4
2015-11-04target_family configurationarcnmx-11/+17
2015-10-27Make fatal errors more consistent.Eli Friedman-6/+6
2015-10-09Cache ids between lowering runsNick Cameron-0/+4
So that lowering is reproducible
2015-10-09Move `for` loop desugaring to loweringNick Cameron-4/+7
2015-10-06purge `-Z always-build-mir`, which is no longer relevantNiko Matsakis-6/+0
2015-09-30rustc: Support output filenames for each emit typeAlex Crichton-42/+34
Currently the compiler supports the ability to emit multiple output types as part of one compilation (e.g. asm, LLVM IR, bytecode, link, dep-info, etc). It does not, however, support the ability to customize the output filename for each of these output types. The `-o` flag is ignored if multiple emit types are specified (and the compiler emits a warning about this). Normally this doesn't matter too much, but in the case of `dep-info` it can lead to a number of problems (e.g. see #28716). By allowing customization of the output filename for each emit type we're able to solve the problems in that issue. This commit adds support for the `--emit` option to the compiler to look like: rustc foo.rs --emit dep-info=.deps/foo.d,link This indicates that the `dep-info` output type will be placed at `.deps/foo.d` and the `link` output type will otherwise be determined via the `--out-dir` and `-o` flags. Closes #28716
2015-09-26Auto merge of #28632 - alexcrichton:update-match-indices, r=Kimundibors-2/+2
This commit updates the `MatchIndices` and `RMatchIndices` iterators to follow the same pattern as the `chars` and `char_indices` iterators. The `matches` iterator currently yield `&str` elements, so the `MatchIndices` iterator now yields the index of the match as well as the `&str` that matched (instead of start/end indexes). cc #27743
2015-09-25std: Update MatchIndices to return a subsliceAlex Crichton-2/+2
This commit updates the `MatchIndices` and `RMatchIndices` iterators to follow the same pattern as the `chars` and `char_indices` iterators. The `matches` iterator currently yield `&str` elements, so the `MatchIndices` iterator now yields the index of the match as well as the `&str` that matched (instead of start/end indexes). cc #27743
2015-09-24rustc: Add target_vendor for target triplesSebastian Wicki-0/+2
This adds a new target property, `target_vendor` which can be used as a matcher for conditional compilation. The vendor is part of the autoconf target triple: <arch><sub>-<vendor>-<os>-<env> The default value for `target_vendor` is "unknown". Matching against the `target_vendor` with `#[cfg]` is currently feature gated as `cfg_target_vendor`.
2015-09-17Add compiler option to keep mtwt tablesGarming Sam-0/+2
This is so that the resolution results can be used after analysis, potentially for tool support
2015-09-16Use ast attributes every where (remove HIR attributes).Nick Cameron-5/+3
This could be a [breaking-change] if your lint or syntax extension (is that even possible?) uses HIR attributes or literals.
2015-09-06add -Z always-build-mir optionNiko Matsakis-0/+6
2015-09-03Add an intital HIR and lowering stepNick Cameron-7/+9
2015-08-25Respect `--color` when printing early errorsBarosl Lee-56/+57
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-14rustc: Allow changing the default allocatorAlex Crichton-3/+11
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-12Introduce a "origin/cause" for new requirements (or bugfixes...) introduced ↵Niko Matsakis-0/+14
by RFC 1214, and issue a warning (and explanatory note) when we encounter such a thing.
2015-08-07Turn nonzeroing move hints back off by default.Felix S. Klock II-3/+3
This is a temporary workaround for the bugs that have been found in the implementation of PR #26173. * pnkfelix is unavailable in the short-term (i.e. for the next week) to fix them. * When the bugs are fixed, we will turn this back on by default. (If you want to play with the known-to-be-buggy optimization in the meantime, you can opt-back in via the debugging option that this commit is toggling.)
2015-07-30Rename the unstable option `--xpretty` to `--unpretty`Felix S. Klock II-2/+2
(Inspired by discussion with Gankro.)
2015-07-29Auto merge of #27260 - alexcrichton:cap-lints, r=nrcbors-0/+12
This commit is an implementation of [RFC 1193][rfc] which adds the ability to the compiler to cap the lint level for the entire compilation session. This flag will ensure that no lints will go above this level, and Cargo will primarily use this flag passing `--cap-lints allow` to all upstream dependencies. [rfc]: https://github.com/rust-lang/rfcs/pull/1193 Closes #27259
2015-07-28rustc: Add a --cap-lints flag to the compilerAlex Crichton-0/+12
This commit is an implementation of [RFC 1193][rfc] which adds the ability to the compiler to cap the lint level for the entire compilation session. This flag will ensure that no lints will go above this level, and Cargo will primarily use this flag passing `--cap-lints allow` to all upstream dependencies. [rfc]: https://github.com/rust-lang/rfcs/pull/1193 Closes #27259
2015-07-28debugflag to turn off nonzeroing move hint optimization.Felix S. Klock II-0/+5
(already thumbs-upped pre-rebase by nikomatsakis)
2015-07-18split "has incompatible type for trait" errors into multiple linesAndrew Paseltiner-1/+2
closes #21332
2015-06-18Make a better error message for using #[feature] on stable rustBrian Anderson-16/+2
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-05-24Auto merge of #25168 - Manishearth:register_attr, r=eddybbors-0/+3
This lets plugin authors opt attributes out of the `custom_attribute` and `unused_attribute` checks. cc @thepowersgang
2015-05-14syntax: replace sess.span_diagnostic.cm with sess.codemap().Eduard Burtescu-1/+1
2015-05-14syntax: refactor (Span)Handler and ParseSess constructors to be methods.Eduard Burtescu-4/+4
2015-05-14Move tracking of the next NodeId from syntax's ParseSess to rustc's Session.Eduard Burtescu-4/+14
2015-05-07Add support for registering attributes with rustc in pluginsManish Goregaokar-0/+3
This lets plugin authors opt attributes out of the `custom_attribute` and `unused_attribute` checks.
2015-05-05rustc: Fix more verbatim paths leaking to gccAlex Crichton-2/+3
Turns out that a verbatim path was leaking through to gcc via the PATH environment variable (pointing to the bundled gcc provided by the main distribution) which was wreaking havoc when gcc itself was run. The fix here is to just stop passing verbatim paths down by adding more liberal uses of `fix_windows_verbatim_for_gcc`. Closes #25072
2015-04-29Allow `-g` and `-O` options to be specified multiple times at command line.Felix S. Klock II-2/+5
2015-04-27rustc: Add target_env for triples by defaultAlex Crichton-2/+3
This adds a new `#[cfg]` matcher against the `target_env` property of the destination target triple. For example all windows triples today end with `-gnu` but we will also hopefully support non-`gnu` targets for Windows, at which point we'll need to differentiate between the two. This new `target_env` matches is provided and filled in with the target's environment name. Currently the only non-empty value of this name is `gnu`, but `musl` will be shortly added for the linux triples.
2015-04-26Auto merge of #24367 - ebfull:fix_ice_cat_expr, r=pnkfelixbors-1/+17
An actual typeck error is the cause of many failed compilations but an unrelated bug is being reported instead. It is triggered because a typeck error is presumably not yet identified during compiler execution, which would normally bypass an invariant in the presence of other errors. In this particular situation, we delay the reporting of the bug until abort_if_errors(). Closes #23827, closes #24356, closes #23041, closes #22897, closes #23966, closes #24013, and closes #23729 **There is at least one situation where this bug may still be genuinely triggered (#23437).**
2015-04-24Change name of unit test sub-module to "tests".Johannes Oertel-1/+1
Changes the style guidelines regarding unit tests to recommend using a sub-module named "tests" instead of "test" for unit tests as "test" might clash with imports of libtest.
2015-04-21implement rfc 1054: split_whitespace() fn, deprecate words()kwantam-2/+2
For now, words() is left in (but deprecated), and Words is a type alias for struct SplitWhitespace. Also cleaned up references to s.words() throughout codebase. Closes #15628
2015-04-17Rollup merge of #24430 - laumann:trace-macros-flag, r=pnkfelixManish Goregaokar-1/+3
This is the second attempt at turning the trace_macros macro into a compiler flag. See #22619
2015-04-14Positive case of `len()` -> `is_empty()`Tamir Duberstein-1/+1
`s/(?<!\{ self)(?<=\.)len\(\) == 0/is_empty()/g`
2015-04-14Add "trace-macros" as a compiler flagThomas Jespersen-1/+3
Fixes #22619
2015-04-13Delay specific span_bug() call until abort_if_errors()Sean Bowe-1/+17
An actual typeck error is the cause of many failed compilations but an unrelated bug is being reported instead. It is triggered because a typeck error is presumably not yet identified during compiler execution, which would normally bypass an invariant in the presence of other errors. In this particular situation, we delay the reporting of the bug until abort_if_errors(). Closes #23827, closes #24356, closes #23041, closes #22897, closes #23966, closes #24013, and closes #23729
2015-04-12Auto merge of #24072 - ebfull:explain_closure_type_err, r=pnkfelixbors-1/+1
Also fixed bug calling .note() instead of .help() See #24036
2015-04-10Add a new `span_suggestion` infrastructure. This lets you edit a snippetNiko Matsakis-0/+7
of text (perhaps obtained by span_snippet) and then splice that edited form back into the original file in the form of a suggestion.