summary refs log tree commit diff
path: root/src/librustc/session
AgeCommit message (Collapse)AuthorLines
2018-02-09Auto merge of #47489 - pnkfelix:limit-2pb-issue-46747, r=nikomatsakisbors-0/+2
NLL: Limit two-phase borrows to autoref-introduced borrows This imposes a restriction on two-phase borrows so that it only applies to autoref-introduced borrows. The goal is to ensure that our initial deployment of two-phase borrows is very conservative. We want it to still cover the `v.push(v.len());` example, but we do not want it to cover cases like `let imm = &v; let mu = &mut v; mu.push(imm.len());` (Why do we want it to be conservative? Because when you are not conservative, then the results you get, at least with the current analysis, are tightly coupled to details of the MIR construction that we would rather remain invisible to the end user.) Fix #46747 I decided, for this PR, to add a debug-flag `-Z two-phase-beyond-autoref`, to re-enable the more general approach. But my intention here is *not* that we would eventually turn on that debugflag by default; the main reason I added it was that I thought it was useful for writing tests to be able to write source that looks like desugared MIR.
2018-02-08Restrict two-phase borrows to solely borrows introduced via autoref.Felix S. Klock II-0/+2
Added `-Z two-phase-beyond-autoref` to bring back old behavior (mainly to allow demonstration of desugared examples). Updated tests to use aforementioned flag when necessary. (But in each case where I added the flag, I made sure to also include a revision without the flag so that one can readily see what the actual behavior we expect is for the initial deployment of NLL.)
2018-02-07Rollup merge of #48014 - Manishearth:stealing-chickens-on-the-internet, ↵Manish Goregaokar-3/+49
r=nikomatsakis Implement RFC 2052 (Epochs) This adds -Zepochs and uses it for tyvar_behind_raw_pointer (#46906) When we move this to --epoch=XXX, we'll need to gate the 2018 epoch on nightly, but not the 2015 one. I can make these changes here itself though it's kinda pointless given that the entire flag is nightly-only. r? @nikomatsakis @aturon cc #44581 (epoch tracking) cc #46906 (tyvar_behind_raw_pointer)
2018-02-06Auto merge of #47203 - varkor:output-filename-conflicts-with-directory, ↵bors-19/+0
r=estebank Warn when rustc output conflicts with existing directories When the compiled executable would conflict with a directory, display a rustc error instead of a verbose and potentially-confusing linker error. This is a usability improvement, and doesn’t actually change behaviour with regards to compilation success. This addresses the concern in #35887. Fixes #13098.
2018-02-05Add -ZepochManish Goregaokar-3/+49
2018-02-01Auto merge of #47540 - Manishearth:suggestion, r=nrcbors-2/+6
Add approximate suggestions for rustfix This adds `span_approximate_suggestion()` that lets you emit a suggestion marked as "non-machine applicable" in the JSON output. UI users see no difference. This is for when rustc and clippy wish to emit suggestions which will make sense to the reader (e.g. they may have placeholders like `<type>`) but are not source-applicable, so that rustfix/etc can ignore these. fixes #39254
2018-01-29Toggle span highlighting on `-Zteach`Esteban Küber-8/+11
2018-01-29Use correct output file paths for error checkingvarkor-39/+0
2018-01-29Warn when rustc output conflicts with existing directoriesvarkor-9/+29
When the compiled executable would conflict with a directory, display a rustc error instead of a verbose and potentially-confusing linker error. This is a usability improvement, and doesn’t actually change behaviour with regards to compilation success. This addresses the concern in #35887.
2018-01-29Add -Zapproximate-suggestionsManish Goregaokar-2/+6
2018-01-26Merge branch 'explain' of https://github.com/estebank/rust into rollupAlex Crichton-2/+7
2018-01-26Merge branch 'no-stderr-sink' of https://github.com/Zoxc/rust into rollupAlex Crichton-9/+9
2018-01-26Do not capture stderr in the compiler. Instead just panic silently for fatal ↵John Kåre Alsaker-9/+9
errors
2018-01-23rustc: Add `-C lto=val` optionAlex Crichton-45/+103
This commit primarily adds the ability to control what kind of LTO happens when rustc performs LTO, namely allowing values to be specified to the `-C lto` option, such as `-C lto=thin` and `-C lto=fat`. (where "fat" is the previous kind of LTO, throw everything in one giant module) Along the way this also refactors a number of fields which store information about whether LTO/ThinLTO are enabled to unify them all into one field through which everything is dispatched, hopefully removing a number of special cases throughout. This is intended to help mitigate #47409 but will require a backport as well, and this would unfortunately need to be an otherwise insta-stable option.
2018-01-23Rename `-Z explain` to `-Z teach`Esteban Küber-3/+3
2018-01-23Create `StructuredDiagnostic`Esteban Küber-0/+4
Create the concept of an `StructuredDiagnostic` that is self-contained with enough knowledge of all variables to create a `DiagnosticBuilder`, including different possible versions (one line output and expanded explanations).
2018-01-23Rollup merge of #47635 - Zoxc:remove-attr, r=michaelwoeristerkennytm-0/+6
Remove the IGNORED_ATTR_NAMES thread local
2018-01-23Rollup merge of #47440 - mark-i-m:zunpretty, r=nikomatsakiskennytm-12/+24
Change the --unpretty flag to -Z unpretty First PR :smile: ! -Z unpretty no longer requires -Z unstable-options. Also, I mildly changed the syntax of the flag to match the other -Z flags. All uses of the flag take the form `unpretty=something` where something can either `string` or `string=string` (see the help messages of the CLI). Fix #47395 r? @nikomatsakis EDIT: apparently rust-highfive doesn't see edits...
2018-01-22Don't make it necessary to enable `unstable-options`Esteban Küber-4/+0
2018-01-22Fix test for variadic error changeEsteban Küber-1/+1
2018-01-22Mark `--explain` as unstableEsteban Küber-2/+5
2018-01-22Add `--explain` for extended error explanationsEsteban Küber-0/+2
2018-01-21Remove the IGNORED_ATTR_NAMES thread localJohn Kåre Alsaker-0/+6
2018-01-19Allow runtime switching between trans backendsbjorn3-0/+2
2018-01-19Auto merge of #47494 - michaelwoerister:proc-macro-incremental, r=nikomatsakisbors-9/+7
Don't include DefIndex in proc-macro registrar function symbol. There can only ever be one registrar function per plugin or proc-macro crate, so adding the `DefIndex` to the function's symbol name does not serve a real purpose. Remove the `DefIndex` from the symbol name makes it stable across incremental compilation sessions. This should fix issue #47292.
2018-01-18Change the --unpretty flag to -Z unprettyMark Mansi-12/+24
-Z unpretty no longer requires -Z unstable-options. Also, I mildly changed the syntax of the flag to match the other -Z flags. All uses of the flag take the form `unpretty=something` where something can either `string` or `string=string` (see the help messages of the CLI).
2018-01-18Rollup merge of #47426 - varkor:default-mir-dump-dir, r=nikomatsakiskennytm-2/+2
Add a default directory for -Zmir-dump-dir The current behaviour of dumping in the current directory is rarely desirable: a sensible default directory for dumping is much more convenient. This makes sets the default value for `-Zmir-dump-dir` to `mir_dump/`. r? @eddyb
2018-01-16Don't include DefIndex in plugin- and proc-macro registrar fn symbol.Michael Woerister-9/+7
2018-01-15Add `-Z dep-info-omit-d-target` to control dep-info styleAdam C. Foltzer-0/+3
This avoids a breaking change to dep-info output, putting the gcc/clang-compliant dep-info behavior behind a flag
2018-01-15Fix testvarkor-1/+1
2018-01-14Make dump_mir_dir non-optionalvarkor-1/+1
2018-01-14Add a default directory for -Zmir-dump-dirvarkor-1/+1
The current behaviour of dumping in the current directory is rarely desirable: a sensible default directory for dumping is much more convenient.
2018-01-13Auto merge of #47181 - michaelwoerister:var-len-def-index, r=eddybbors-2/+2
Use DefIndex encoding that works better with on-disk variable length integer representations. Use the least instead of the most significant bit for representing the address space. r? @eddyb
2018-01-09Auto merge of #47269 - michaelwoerister:mangled-cgu-names, r=alexcrichtonbors-0/+2
Shorten names of some compiler generated artifacts. This PR makes the compiler mangle codegen unit names by default. The name of every codegen unit name will now be a random string of 16 characters. It also makes the file extensions of some intermediate compiler products shorter. Hopefully, these changes will reduce the pressure on tools with path length restrictions like buildbot. The change should also solve problems with case-insensitive file system. cc #47186 and #47222 r? @alexcrichton
2018-01-08Use different DefIndex representation that is better suited for variable ↵Michael Woerister-2/+2
length integer encodings.
2018-01-08Shorten names of some compiler generated artifacts.Michael Woerister-0/+2
2018-01-07Remove redundant -Zdebug-llvm optionBjörn Steinbrink-4/+0
The same effect can be achieved using -Cllvm-args=-debug Refs #46437 as it removes LLVMRustSetDebug()
2018-01-07Rollup merge of #47220 - nagisa:nonamellvm, r=rkruppekennytm-1/+14
Use name-discarding LLVM context This is only applicable when neither of --emit=llvm-ir or --emit=llvm-bc are not requested. In case either of these outputs are wanted, but the benefits of such context are desired as well, -Zfewer_names option provides the same functionality regardless of the outputs requested. Should be a viable fix for https://github.com/rust-lang/rust/issues/46449
2018-01-05rustc: Don't ICE if we invalidate an invalid incr dirAlex Crichton-0/+1
This showed up on the Windows bot for testing this PR, and this pr allows `mark_incr_comp_session_as_invalid` ok if it's already invalid, hopefully avoiding scary ICEs and instead leaving the nicely printed errors
2018-01-05Use name-discarding LLVM contextSimonas Kazlauskas-1/+14
This is only applicable when neither of --emit=llvm-ir or --emit=llvm-bc are not requested. In case either of these outputs are wanted, but the benefits of such context are desired as well, -Zfewer_names option provides the same functionality regardless of the outputs requested.
2017-12-26avoid ICE when fields are not laid out in orderNiko Matsakis-5/+13
2017-12-25Auto merge of #46910 - alexcrichton:thinlto-default, r=michaelwoeristerbors-4/+1
rustc: Set release mode cgus to 16 by default This commit is the next attempt to enable multiple codegen units by default in release mode, getting some of those sweet, sweet parallelism wins by running codegen in parallel. Performance should not be lost due to ThinLTO being on by default as well. Closes #45320
2017-12-23rustc: Set release mode cgus to 16 by defaultAlex Crichton-4/+1
This commit is the next attempt to enable multiple codegen units by default in release mode, getting some of those sweet, sweet parallelism wins by running codegen in parallel. Performance should not be lost due to ThinLTO being on by default as well. Closes #45320
2017-12-22Auto merge of #46779 - Zoxc:par-merge-without-sync, r=arielb1bors-0/+12
Work towards thread safety in rustc This PR is split out from https://github.com/rust-lang/rust/pull/45912. It contains changes which do not require the `sync` module.
2017-12-22Rollup merge of #46814 - varkor:contrib-7, r=alexcrichtonkennytm-0/+25
Prevent rustc overwriting input files If rustc is invoked on a file that would be overwritten by the compilation, the compilation now fails, to avoid accidental loss. This resolves #13019. Kudos to @estebank, whose patch I finished off.
2017-12-21Add a -Z query-threads compiler optionJohn Kåre Alsaker-0/+12
2017-12-20document and tweak the nll, use_mir, etc helpersNiko Matsakis-3/+27
In particular, -Znll might as well imply -Zborrowck=mir by default, just like `#![feature(nll)]` does. Also, if NLL is in use, no reason to emit end regions. The NLL pass just strips them out anyway.
2017-12-20feature nll implies borrowck=mirSantiago Pastorino-2/+20
2017-12-20feature nll implies two-phase-borrowsSantiago Pastorino-0/+3
2017-12-20Add nll feature and make nll imply nll_dump_causeSantiago Pastorino-0/+3