about summary refs log tree commit diff
path: root/src/librustc/session
AgeCommit message (Collapse)AuthorLines
2017-08-23-Z profile-query-and-key, separate from -Z profile-query; query key is ↵Matthew Hammer-1/+9
string option
2017-08-23inc comp: -Z profile-queries support; see also ↵Matthew Hammer-0/+3
https://github.com/rust-lang-nursery/rust-forge/blob/master/profile-queries.md
2017-08-22Introduce temporary target feature crt_static_respectedSamuel Holland-0/+9
This feature allows targets to opt in to full support of the crt-static feature. Currently, crt-static is allowed on all targets, even those that really can't or really shouldn't support it. This works because it is very loose in the specification of its effects. Changing the behavior of crt-static to be more strict in how it chooses libraries and links executables would likely cause compilation to fail on these platforms. To avoid breaking existing uses of crt-static, whitelist targets that support the new, stricter behavior. For all other targets, this changes crt-static from being "mostly a no-op" to "explicitly a no-op".
2017-08-22Factor out a helper for the getting C runtime linkageSamuel Holland-0/+16
This commit makes no functional changes.
2017-08-22--print=native-static-libsKornel-1/+3
2017-08-16MIR based borrow check (opt-in).Felix S. Klock II-0/+2
One can either use `-Z borrowck-mir` or add the `#[rustc_mir_borrowck]` attribute to opt into MIR based borrow checking. Note that regardless of whether one opts in or not, AST-based borrow check will still run as well. The errors emitted from AST-based borrow check will include a "(Ast)" suffix in their error message, while the errors emitted from MIR-based borrow check will include a "(Mir)" suffix. post-rebase: removed check for intra-statement mutual conflict; replaced with assertion checking that at most one borrow is generated per statement. post-rebase: removed dead code: `IdxSet::pairs` and supporting stuff.
2017-08-12Fix some typosBastien Orivel-2/+2
2017-08-09rustc: Rearchitect lints to be emitted more eagerlyAlex Crichton-18/+11
In preparation for incremental compilation this commit refactors the lint handling infrastructure in the compiler to be more "eager" and overall more incremental-friendly. Many passes of the compiler can emit lints at various points but before this commit all lints were buffered in a table to be emitted at the very end of compilation. This commit changes these lints to be emitted immediately during compilation using pre-calculated lint level-related data structures. Linting today is split into two phases, one set of "early" lints run on the `syntax::ast` and a "late" set of lints run on the HIR. This commit moves the "early" lints to running as late as possible in compilation, just before HIR lowering. This notably means that we're catching resolve-related lints just before HIR lowering. The early linting remains a pass very similar to how it was before, maintaining context of the current lint level as it walks the tree. Post-HIR, however, linting is structured as a method on the `TyCtxt` which transitively executes a query to calculate lint levels. Each request to lint on a `TyCtxt` will query the entire crate's 'lint level data structure' and then go from there about whether the lint should be emitted or not. The query depends on the entire HIR crate but should be very quick to calculate (just a quick walk of the HIR) and the red-green system should notice that the lint level data structure rarely changes, and should hopefully preserve incrementality. Overall this resulted in a pretty big change to the test suite now that lints are emitted much earlier in compilation (on-demand vs only at the end). This in turn necessitated the addition of many `#![allow(warnings)]` directives throughout the compile-fail test suite and a number of updates to the UI test suite.
2017-08-04Auto merge of #43403 - RalfJung:mir-validate, r=nikomatsakisbors-0/+3
Add MIR Validate statement This adds statements to MIR that express when types are to be validated (following [Types as Contracts](https://internals.rust-lang.org/t/types-as-contracts/5562)). Obviously nothing is stabilized, and in fact a `-Z` flag has to be passed for behavior to even change at all. This is meant to make experimentation with Types as Contracts in miri possible. The design is definitely not final. Cc @nikomatsakis @aturon
2017-07-31optionally only emit basic validation for functions containing unsafe block ↵Ralf Jung-2/+3
/ unsafe function
2017-07-31async-llvm(22): mw invokes mad html skillz to produce graphical LLVM timing ↵Michael Woerister-0/+2
reports.
2017-07-31async-llvm(14): Move LTO/codegen-unit conflict check to beginning of ↵Michael Woerister-0/+17
compilation process.
2017-07-30add -Z flag for AddValidation passRalf Jung-0/+2
2017-07-22Use config::pub_only rather than a spearate api modeNick Cameron-5/+0
2017-07-20Auto merge of #43271 - Nashenas88:nll, r=nikomatsakisbors-0/+2
Add empty MIR pass for non-lexical lifetimes This is the first step for #43234.
2017-07-19explanatory error on `--print target-spec-json` without unstable optionsZack M. Davis-2/+9
Resolves #41683.
2017-07-19Add empty MIR pass for non-lexical lifetimesPaul Faria-0/+2
2017-07-18Implement FromStr for RelroLevel rather than duplicating the matchJohannes Löthberg-3/+6
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
2017-07-18Move relro_level from CodegenOptions to DebuggingOptionsJohannes Löthberg-6/+6
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
2017-07-14Support both partial and full RELROJohannes Löthberg-4/+24
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
2017-07-10incr.comp.: Improve debug output for work products.Michael Woerister-0/+6
2017-07-05use field init shorthand in src/librustcZack M. Davis-37/+37
The field init shorthand syntax was stabilized in 1.17.0 (aebd94f); we are now free to use it in the compiler.
2017-07-05rustc: Implement the #[global_allocator] attributeAlex Crichton-1/+7
This PR is an implementation of [RFC 1974] which specifies a new method of defining a global allocator for a program. This obsoletes the old `#![allocator]` attribute and also removes support for it. [RFC 1974]: https://github.com/rust-lang/rfcs/pull/197 The new `#[global_allocator]` attribute solves many issues encountered with the `#![allocator]` attribute such as composition and restrictions on the crate graph itself. The compiler now has much more control over the ABI of the allocator and how it's implemented, allowing much more freedom in terms of how this feature is implemented. cc #27389
2017-07-02report the total number of errors on compilation failureAriel Ben-Yehuda-7/+18
Prior to this PR, when we aborted because a "critical pass" failed, we displayed the number of errors from that critical pass. While that's the number of errors that caused compilation to abort in *that place*, that's not what people really want to know. Instead, always report the total number of errors, and don't bother to track the number of errors from the last pass that failed. This changes the compiler driver API to handle errors more smoothly, and therefore is a compiler-api-[breaking-change]. Fixes #42793.
2017-06-26make lint on-by-default/implied-by messages appear only onceZack M. Davis-17/+43
From review discussion on #38103 (https://github.com/rust-lang/rust/pull/38103#discussion_r94845060).
2017-06-21Integrate jobserver support to parallel codegenAlex Crichton-2/+26
This commit integrates the `jobserver` crate into the compiler. The crate was previously integrated in to Cargo as part of rust-lang/cargo#4110. The purpose here is to two-fold: * Primarily the compiler can cooperate with Cargo on parallelism. When you run `cargo build -j4` then this'll make sure that the entire build process between Cargo/rustc won't use more than 4 cores, whereas today you'd get 4 rustc instances which may all try to spawn lots of threads. * Secondarily rustc/Cargo can now integrate with a foreign GNU `make` jobserver. This means that if you call cargo/rustc from `make` or another jobserver-compatible implementation it'll use foreign parallelism settings instead of creating new ones locally. As the number of parallel codegen instances in the compiler continues to grow over time with the advent of incremental compilation it's expected that this'll become more of a problem, so this is intended to nip concurrent concerns in the bud by having all the tools to cooperate! Note that while rustc has support for itself creating a jobserver it's far more likely that rustc will always use the jobserver configured by Cargo. Cargo today will now set a jobserver unconditionally for rustc to use.
2017-06-20Switch to the crates.io `getopts` crateAlex Crichton-52/+72
This commit deletes the in-tree `getopts` crate in favor of the crates.io-based `getopts` crate. The main difference here is with a new builder-style API, but otherwise everything else remains relatively standard.
2017-06-19Auto merge of #39409 - pnkfelix:mir-borrowck2, r=nikomatsakisbors-0/+4
MIR EndRegion Statements (was MIR dataflow for Borrows) This PR adds an `EndRegion` statement to MIR (where the `EndRegion` statement is what terminates a borrow). An earlier version of the PR implemented a dataflow analysis on borrow expressions, but I am now factoring that into a follow-up PR so that reviewing this one is easier. (And also because there are some revisions I want to make to that dataflow code, but I want this PR to get out of WIP status...) This is a baby step towards MIR borrowck. I just want to get the review process going while I independently work on the remaining steps.
2017-06-17Auto merge of #42650 - nrc:save-slim, r=eddybbors-4/+0
save-analysis: remove a lot of stuff This commits us to the JSON format and the more general def/ref style of output, rather than also supporting different data formats for different data structures. This does not affect the RLS at all, but will break any clients of the CSV form - AFAIK there are none (beyond a few of my own toy projects) - DXR stopped working long ago. r? @eddyb
2017-06-14Remove CSV format of save-analysis dataNick Cameron-4/+0
2017-06-12`-Z identify_regions` toggles rendering of (previously hidden) unnamed regions.Felix S. Klock II-0/+2
Unlike `-Z verbose`, it is succinct. It uniquely identifies regions when displaying them, and distinguishes code extents from user-specified lifetimes in the output by leveraging a syntactic restriction: you cannot write a lifetime that starts with a numeric character. For example, it prints '<num>ce for the more verbose `ReScope(CodeExtent(<num>))`.
2017-06-12Add `-Z span_free_rvalues`.Felix S. Klock II-0/+2
This is solely a hack to make comparing test output plausible; it makes closures print as [closure@node_id] instead of [closure@span-with-host-path] in debug printouts.
2017-06-04Merge branch 'profiling' of github.com:whitequark/rust into profilingMarco Castelluccio-0/+2
2017-06-01Rollup merge of #42302 - GuillaumeGomez:new-error-codes-next, r=SusurrusCorey Farwell-7/+11
New error codes next Part #42229. To be merged after #42264. cc @Susurrus
2017-05-31Rollup merge of #42277 - citizen428:remove-crate-type-metadata, r=nikomatsakisMark Simulacrum-14/+4
Remove --crate-type=metadata deprecation warning Fixes #38640
2017-05-30Add new error codeGuillaume Gomez-7/+11
2017-05-30Remove --crate-type=metadata deprecation warningMichael Kohl-14/+4
Fixes #38640
2017-05-23incr.comp.: Track expanded spans instead of FileMaps.Michael Woerister-19/+4
2017-05-19Rollup merge of #42056 - sylvestre:master, r=alexcrichtonMark Simulacrum-3/+8
Improve the error management when /proc is not mounted This PR does two things: * Triggers an error on GNU/Linux & Android when /proc/self/exe doesn't exist * Handle the error properly
2017-05-19Rollup merge of #41971 - japaric:pre-link-args, r=alexcrichtonMark Simulacrum-2/+6
add -Z pre-link-arg{,s} to rustc This PR adds two unstable flags to `rustc`: `-Z pre-link-arg` and `-Z pre-link-args`. These are the counterpart of the existing `-C link-arg{,s}` flags and can be used to pass extra arguments at the *beginning* of the linker invocation, before the Rust object files are passed. I have [started] a discussion on the rust-embedded RFCs repo about settling on a convention for passing extra arguments to the linker and there are two options on discussion: `.cargo/config`'s `target.$T.rustflags` and custom target specification files (`{pre,,post}-link-args` fields). However, to compare these two options on equal footing this `-Z pre-link-arg` feature is required. [started]: https://github.com/rust-embedded/rfcs/pull/24 Therefore I'm requesting landing this `-Z pre-link-arg` flag as an experimental feature to evaluate these two options. cc @brson r? @alexcrichton
2017-05-18Enable cross-crate incremental compilation by default.Michael Woerister-1/+1
2017-05-17Improve the error management when /proc is not mountedSylvestre Ledru-3/+8
This PR does two things: * Triggers an error on GNU/Linux & Android when /proc/self/exe doesn't exist * Handle the error properly
2017-05-15Remove (direct) rustc_llvm dependency from rustc_driverRobin Kruppe-1/+1
This does not actually improve build times, since it still depends on rustc_trans, but is better layering and fits the multi-backend future slightly better.
2017-05-15Remove rustc_llvm dependency from librustcRobin Kruppe-54/+0
Consequently, session creation can no longer initialize LLVM. The few places that use the compiler without going through rustc_driver/CompilerCalls thus need to be careful to manually initialize LLVM (via rustc_trans!) immediately after session creation. This means librustc is not rebuilt when LLVM changes.
2017-05-13add -Z pre-link-arg{,s} to rustcJorge Aparicio-2/+6
This commit adds two unstable flags to `rustc`: `-Z pre-link-arg` and `-Z pre-link-args`. These are the counterpart of the existing `-C link-arg{,s}` flags and can be used to pass extra arguments at the *beginning* of the linker invocation, before the Rust object files are passed.
2017-05-10rustc: Add a new `-Z force-unstable-if-unmarked` flagAlex Crichton-0/+2
This commit adds a new `-Z` flag to the compiler for use when bootstrapping the compiler itself. We want to be able to use crates.io crates, but we also want the usage of such crates to be as ergonomic as possible! To that end compiler crates are a little tricky in that the crates.io crates are not annotated as unstable, nor do they expect to pull in unstable dependencies. To cover all these situations it's intended that the compiler will forever now bootstrap with `-Z force-unstable-if-unmarked`. This flags serves a dual purpose of forcing crates.io crates to themselves be unstable while also allowing them to use other "unstable" crates.io crates. This should mean that adding a dependency to compiler no longer requires upstream modification with unstable/staged_api attributes for inclusion!
2017-05-08incr.comp.: Hash more pieces of crate metadata to detect changes there.Michael Woerister-3/+20
2017-05-04rustc: Forbid `-Z` flags on stable/beta channelsAlex Crichton-68/+16
First deprecated in rustc 1.8.0 the intention was to never allow `-Z` flags make their way to the stable channel (or unstable options). After a year of warnings we've seen one of the main use cases, `-Z no-trans`, stabilized as `cargo check`. Otherwise while other use cases remain the sentiment is that now's the time to start forbidding `-Z` by default on stable/beta. Closes #31847
2017-05-02remove `mir_passes` from `Session` and add a FIXMENiko Matsakis-3/+0
2017-05-02simplify the MirPass traits and passes dramaticallyNiko Matsakis-0/+2
Overall goal: reduce the amount of context a mir pass needs so that it resembles a query. - The hooks are no longer "threaded down" to the pass, but rather run automatically from the top-level (we also thread down the current pass number, so that the files are sorted better). - The hook now receives a *single* callback, rather than a callback per-MIR. - The traits are no longer lifetime parameters, which moved to the methods -- given that we required `for<'tcx>` objecs, there wasn't much point to that. - Several passes now store a `String` instead of a `&'l str` (again, no point).