summary refs log tree commit diff
path: root/src/librustc
AgeCommit message (Collapse)AuthorLines
2016-04-07Put in `-Z continue-parse-after-error`Felix S. Klock II-0/+6
This works by adding a boolean flag, `continue_after_error`, to `syntax::errors::Handler` that can be imperatively set to `true` or `false` via a new `fn set_continue_after_error`. The flag starts off true (since we generally try to recover from compiler errors, and `Handler` is shared across all phases). Then, during the `phase_1_parse_input`, we consult the setting of the `-Z continue-parse-after-error` debug flag to determine whether we should leave the flag set to `true` or should change it to `false`. ---- (We might consider adding a debugflag to do such aborts in other places where we are currently attempting recovery, such as resolve, but I think the parser is the really important case to handle in the face of #31994 and the parser bugs of varying degrees that were injected by parse error recovery.)
2016-03-16Do not report errors from regionck if other errors were alreadyNiko Matsakis-2/+13
reported during the lifetime of this inferencer. Fixes #30580.
2016-03-16remove wrong assert in check_matchAriel Ben-Yehuda-4/+1
the assert was invalidated by PR #31020 Fixes #31561
2016-03-01Auto merge of #31962 - sanxiyn:const-eval-map, r=arielb1bors-1/+18
Fix #31910.
2016-02-29std: Stabilize APIs for the 1.8 releaseAlex Crichton-17/+43
This commit is the result of the FCPs ending for the 1.8 release cycle for both the libs and the lang suteams. The full list of changes are: Stabilized * `braced_empty_structs` * `augmented_assignments` * `str::encode_utf16` - renamed from `utf16_units` * `str::EncodeUtf16` - renamed from `Utf16Units` * `Ref::map` * `RefMut::map` * `ptr::drop_in_place` * `time::Instant` * `time::SystemTime` * `{Instant,SystemTime}::now` * `{Instant,SystemTime}::duration_since` - renamed from `duration_from_earlier` * `{Instant,SystemTime}::elapsed` * Various `Add`/`Sub` impls for `Time` and `SystemTime` * `SystemTimeError` * `SystemTimeError::duration` * Various impls for `SystemTimeError` * `UNIX_EPOCH` * `ops::{Add,Sub,Mul,Div,Rem,BitAnd,BitOr,BitXor,Shl,Shr}Assign` Deprecated * Scoped TLS (the `scoped_thread_local!` macro) * `Ref::filter_map` * `RefMut::filter_map` * `RwLockReadGuard::map` * `RwLockWriteGuard::map` * `Condvar::wait_timeout_with` Closes #27714 Closes #27715 Closes #27746 Closes #27748 Closes #27908 Closes #29866
2016-02-29Use HIR map instead of tcx in constant evaluatorSeo Sanghyeon-1/+18
Constant evaluator can be called while tcx is in construction.
2016-02-27Rollup merge of #31929 - dotdash:less_rallocx, r=alexcrichtonManish Goregaokar-0/+5
When foldings Substs, we map over VecPerParamSpace instances using EnumeratedItems which does not provide an accurate size_hint() in its Iterator implementation. This leads to quite a large number or reallocations. Providing a suitable size_hint() implementation reduces the time spent in item-bodies checking quite a bit. ``` crate | before | after | ~change -------|------------------------- core | 7.28s | 5.44s | -25% std | 2.07s | 1.88s | -9.2% syntax | 8.86s | 8.30s | -6.3% ```
2016-02-27Rollup merge of #31926 - llogiq:more_post, r=eddybManish Goregaokar-0/+22
These `_post` methods are quite helpful to control lint behavior without storing e.g. block node ids. So here are a few more I believe will be helpful. r? @Manishearth
2016-02-27Avoid excessive reallocations during item-bodies checkingBjörn Steinbrink-0/+5
When foldings Substs, we map over VecPerParamSpace instances using EnumeratedItems which does not provide an accurate size_hint() in its Iterator implementation. This leads to quite a large number or reallocations. Providing a suitable size_hint() implementation reduces the time spent in item-bodies checking quite a bit. ``` crate | before | after | ~change -------|------------------------- core | 7.28s | 5.44s | -25% std | 2.07s | 1.88s | -9.2% syntax | 8.86s | 8.30s | -6.3% ```
2016-02-27more check_*_post methods for LintPassesllogiq-0/+22
2016-02-26Use .copy_from_slice() where applicableUlrik Sverdrup-2/+3
.copy_from_slice() does the same job of .clone_from_slice(), but the former is explicitly for Copy elements and calls `memcpy` directly, and thus is it efficient without optimization too.
2016-02-25Rollup merge of #31818 - GuillaumeGomez:error_display, r=brsonManish Goregaokar-2/+5
Fixes #31788
2016-02-25Rollup merge of #31793 - alexcrichton:add-real-option-gating, r=nikomatsakisManish Goregaokar-64/+117
This commit adds support for *truly* unstable options in the compiler, as well as adding warnings for the start of the deprecation path of unstable-but-not-really options. Specifically, the following behavior is now in place for handling unstable options: * As before, an unconditional error is emitted if an unstable option is passed and the `-Z unstable-options` flag is not present. Note that passing another `-Z` flag does not require passing `-Z unstable-options` as well. * New flags added to the compiler will be in the `Unstable` category as opposed to the `UnstableButNotReally` category which means they will unconditionally emit an error when used on stable. * All current flags are in a category where they will emit warnings when used that the option will soon be a hard error. Also as before, it is intended that `-Z` is akin to `#![feature]` in a crate where it is required to unlock unstable functionality. A nightly compiler which is used without any `-Z` flags should only be exercising stable behavior.
2016-02-24rustc: Refactor how unstable flags are handledAlex Crichton-64/+117
This commit adds support for *truly* unstable options in the compiler, as well as adding warnings for the start of the deprecation path of unstable-but-not-really options. Specifically, the following behavior is now in place for handling unstable options: * As before, an unconditional error is emitted if an unstable option is passed and the `-Z unstable-options` flag is not present. Note that passing another `-Z` flag does not require passing `-Z unstable-options` as well. * New flags added to the compiler will be in the `Unstable` category as opposed to the `UnstableButNotReally` category which means they will unconditionally emit an error when used on stable. * All current flags are in a category where they will emit warnings when used that the option will soon be a hard error. Also as before, it is intended that `-Z` is akin to `#![feature]` in a crate where it is required to unlock unstable functionality. A nightly compiler which is used without any `-Z` flags should only be exercising stable behavior.
2016-02-24Warn instead of error when using an inaccessable extern crateJeffrey Seyfried-0/+7
2016-02-24Warn when reexporting a private extern crateJeffrey Seyfried-3/+1
2016-02-22Auto merge of #31811 - alexcrichton:clean-deps, r=sanxiynbors-0/+1
The standard library doesn't depend on rustc_bitflags, so move it to explicit dependencies on all other crates. Additionally, the arena/fmt_macros deps could be dropped from libsyntax.
2016-02-21rustbuild: Sync some Cargo.toml/lib.rs dependenciesAlex Crichton-0/+1
The standard library doesn't depend on rustc_bitflags, so move it to explicit dependencies on all other crates. Additionally, the arena/fmt_macros deps could be dropped from libsyntax.
2016-02-22Add crate_name in E0152 error displayggomez-2/+5
2016-02-20Auto merge of #31757 - petrochenkov:unitdotdot, r=nikomatsakisbors-1/+1
This warning was introduced on Nov 28, 2015 and got into 1.6 stable, it was later requalified from a hardwired warning to a warn-by-default lint. If this patch is landed soon enough, then `match_of_unit_variant_via_paren_dotdot` will get into 1.8 stable as a deny-by-default lint. My intention is to turn it into a hard error after March 3, 2016, then it will hit stable at 1.9. r? @nikomatsakis cc @pnkfelix
2016-02-20Auto merge of #31474 - arielb1:mir-typeck, r=nikomatsakisbors-39/+139
This should stop broken MIR from annoying us when we try to implement things
2016-02-20address review commentsAriel Ben-Yehuda-0/+4
2016-02-20use the FulfillmentContext and InferCtxt more correctlyAriel Ben-Yehuda-4/+10
2016-02-20store the normalized types of field accessesAriel Ben-Yehuda-22/+13
Fixes #31504
2016-02-20make *mut T -> *const T a coercionAriel Ben-Yehuda-9/+31
rather than being implicit quasi-subtyping. Nothing good can come out of quasi-subtyping.
2016-02-20add -Z mir-opt-level to disable MIR optimizationsAriel Ben-Yehuda-0/+6
setting -Z mir-opt-level=0 will disable all MIR optimizations for easier debugging
2016-02-19Fix error[E0518] not displayed for #[inline] on structs inside fnsnxnfufunezn-0/+1
2016-02-19begin implementing mir-typeckAriel Ben-Yehuda-4/+75
2016-02-18Make future-compat lint `match_of_unit_variant_via_paren_dotdot` deny by defaultVadim Petrochenkov-1/+1
2016-02-18Fix a weird case in the HIR map, where fields are not present in theNiko Matsakis-1/+11
map. Perhaps I ought to just add them instead, but this seems harmless enough.
2016-02-17Rollup merge of #31679 - GuillaumeGomez:long_error_explanation, r=ManishearthSteve Klabnik-85/+162
r? @Manishearth
2016-02-17Auto merge of #31685 - petrochenkov:patrefact2, r=eddybbors-180/+169
And split `PatKind::Enum` into `PatKind::TupleStruct` and `PatKind::Path`. This is the HIR part of https://github.com/rust-lang/rust/pull/31581. This is also kind of a preparation for https://github.com/rust-lang/rfcs/pull/1492. r? @eddyb
2016-02-16Auto merge of #31680 - arielb1:fast-fulfill, r=nikomatsakisbors-14/+33
this improves typeck performance by 5% (LLVM times are still huge). Basically fixes #25916 (still O(n^2), but the example takes <1s to compile). r? @nikomatsakis
2016-02-16Fix wrong help message left in #31368Johan Lorenzo-1/+1
2016-02-16Split PatKind::Enum into PatKind::TupleStruct and PatKind::PathVadim Petrochenkov-77/+66
2016-02-15use stalled_on in all obligation typesAriel Ben-Yehuda-14/+33
this improves typeck performance by 5% (LLVM times are still huge). Basically fixes #25916 (still O(n^2), but the example takes <1s to compile).
2016-02-15Global error explanations improvementsggomez-85/+162
2016-02-14Stricter matching of `--cfg` options on rustcDirk Gadsden-4/+14
Includes compile-fail test to check that it fails on incomplete `--cfg` matches. Fixes #31497.
2016-02-14Rename hir::Pat_ and its variantsVadim Petrochenkov-132/+132
2016-02-13Auto merge of #31588 - soltanmm:layer, r=nikomatsakisbors-10/+7
<sup>**context:** moving back to a layered approach to type checking.</sup> It looks like they'd not ended up tightly coupled in the time one was owned by the other. Every instance outside of `FnCtxt.inh` was from an `InferCtxt` created and dropped in the same function body. This conflicts slightly with #30652, but there too it looks like the `FulfillmentContext` is from an `InferCtxt` that is created and dropped within the same function body (across one call to a module-private function). That said, I heard that the PR that originally moved `FulfillmentContext` into `InferCtxt` was big, which leaves me concerned that I'm missing something. r? @nikomatsakis
2016-02-13Auto merge of #31562 - llogiq:lint_post, r=Manishearthbors-0/+14
This fixes #31512 for me. A bit of explanation: I want to have `check_block_post(&mut self, &Context, &Block)` and `check_crate_post(&mut self, &Context, &Crate)` methods in both early and late lint passes. Ideally we'd have _post methods for all operations that walk, but this'll do for now. @Manishearth r?
2016-02-13Auto merge of #31358 - japaric:print-targets, r=alexcrichtonbors-1/+3
that prints a list of all the triples supported by the `--target` flag r? @alexcrichton
2016-02-13Auto merge of #31524 - jonas-schievink:autoderef, r=steveklabnikbors-262/+262
2016-02-12Autoderef in librustcJonas Schievink-262/+262
2016-02-12Auto merge of #30726 - GuillaumeGomez:compile-fail, r=brsonbors-120/+208
r? @brson cc @alexcrichton I still need to add error code explanation test with this, but I can't figure out a way to generate the `.md` files in order to test example source codes. Will fix #27328.
2016-02-12fix double check_itemllogiq-1/+1
2016-02-12Auto merge of #31550 - Stebalien:fix-color, r=nrcbors-6/+6
Fixes #31546
2016-02-12rustc: add a `--print target-list` commandJorge Aparicio-1/+3
2016-02-12Auto merge of #31368 - JohanLorenzo:dont-strip-if-test-build, r=alexcrichtonbors-0/+2
Tools which rely on DWARF for generating code coverage report, don't generate accurate numbers on test builds. For instance, [this sample main](https://github.com/JohanLorenzo/rust-testing-example/blob/757bdbf3887f43db9771c20cb72dfc32aa8f4321/src/main.rs) returns [100% coverage](https://coveralls.io/builds/4940156/source?filename=main.rs) when [kcov](https://github.com/SimonKagstrom/kcov/) runs. With @pnkfelix 's great help, we could narrow down the issue: The linker strips unused function during phase 6. Here's a patch which stops stripping when someone calls `rustc --test $ARGS`. @pnkfelix wasn't sure if we should add a new flag, or just use --test. What do you think @alexcrichton ? Also, I'm not too sure: where is the best place to add a test for this addition? Thanks for the help!
2016-02-12Auto merge of #30830 - arcnmx:static-extern, r=alexcrichtonbors-13/+13
See #29676 r? @alexcrichton