about summary refs log tree commit diff
path: root/src/librustc
AgeCommit message (Collapse)AuthorLines
2019-07-05Rollup merge of #61545 - flip1995:internal_lints, r=oli-obkMazdak Farrokhzad-46/+85
Implement another internal lints cc #49509 This adds ~~two~~ one internal lint~~s~~: 1. LINT_PASS_IMPL_WITHOUT_MACRO: Make sure, that the `{declare,impl}_lint_pass` macro is used to implement lint passes. cc #59669 2. ~~USAGE_OF_TYCTXT_AND_SPAN_ARGS: item 2 on the list in #49509~~ ~~With 2. I wasn't sure, if this lint should be applied everywhere. That means a careful review of 0955835 would be great. Also 73fb9b4 allows this lint on some functions. Should I also apply this lint there?~~ TODO (not directly relevant for review): - [ ] https://github.com/rust-lang/rust/pull/59316#discussion_r280186517 (not sure yet, if this works or how to query for `rustc_private`, since it's not in [`Features`](https://doc.rust-lang.org/nightly/nightly-rustc/syntax/feature_gate/struct.Features.html) :thinking: cc @eddyb) - [x] https://github.com/rust-lang/rust/pull/61735#discussion_r292389870 - [x] Check explicitly for the `{declare,impl}_lint_pass!` macros r? @oli-obk
2019-07-05Rollup merge of #62169 - Zoxc:store-query-results, r=eddybMazdak Farrokhzad-24/+13
Derive which queries to save using the proc macro Based on https://github.com/rust-lang/rust/pull/62166. r? @eddyb
2019-07-05Auto merge of #62099 - Mark-Simulacrum:syntax-print-clean-2, r=eddybbors-900/+859
Remove io::Result from syntax::print Since we're now writing directly to the vector, there's no need to thread results through the whole printing infrastructure
2019-07-05remove Scalar::is_null_ptrRalf Jung-11/+0
Miri does not need it any more and it is otherwise unused
2019-07-05Add a "total" measurement to -Ztime-passes.Nicholas Nethercote-13/+1
This is useful for getting the total compilation time at the end. To do this, the patch changes `print_time_passes_entry` to not increment the depth, which means that `print_time_passes_entry_internal` is no longer needed.
2019-07-04Auto merge of #61392 - Zoxc:single-interner, r=eddybbors-136/+28
Use a single CtxtInterners Builds on https://github.com/rust-lang/rust/pull/57214 r? @eddyb
2019-07-04infer: fix a Region-related debug messageljedrz-6/+1
2019-07-04fix a dep_graph doc regarding type_of_itemljedrz-1/+1
2019-07-04infer::error_reporting: adjust 2 debug messagesljedrz-8/+2
2019-07-04rename hir::map::opt_local_def_id*ljedrz-4/+4
2019-07-04rename hir::map::local_def_id_from_hir_id to local_def_idljedrz-48/+48
2019-07-04rename hir::map::local_def_id to local_def_id_from_node_idljedrz-11/+12
2019-07-04remove FIXMEs for functions that won't go awayljedrz-4/+0
2019-07-04Rollup merge of #62249 - czipperz:use-mem-take-instead-of-replace-default, ↵Mazdak Farrokhzad-11/+11
r=dtolnay,Centril Use mem::take instead of mem::replace with default
2019-07-04Rollup merge of #62173 - RalfJung:miri-interp, r=oli-obkMazdak Farrokhzad-1/+1
rename InterpretCx -> InterpCx That's more consistent with InterpResult and InterpError. r? @oli-obk
2019-07-04Rollup merge of #62039 - jeremystucki:needless_lifetimes, r=eddybMazdak Farrokhzad-85/+85
Remove needless lifetimes (rustc)
2019-07-03Normalize projections in opaque typesJonas Schievink-0/+6
2019-07-03Auto merge of #61995 - eddyb:hir-sep-ptr, r=petrochenkovbors-21/+169
rustc: use a separate copy of P for HIR than for AST. Note: this currently includes/is based on top of #61987. Like #61968, but goes one step further and uses a separate `P<...>` for the HIR, with no `Clone`, or the ability to mutate after allocation. There is still `into_inner`/`into_iter`, but they're only exposed for `hir::lowering`, and they would take more work to untangle. r? @petrochenkov cc @rust-lang/compiler
2019-07-03Remove needless lifetimesJeremy Stucki-66/+66
2019-07-03Remove needless lifetimesJeremy Stucki-2/+2
2019-07-03Remove needless lifetimesJeremy Stucki-3/+3
2019-07-03Remove needless lifetimesJeremy Stucki-14/+14
2019-07-03typeck: merge opaque type inference logicDavid Wood-1/+75
This commit merges the logic used for opaque type type inference for impl Trait and non-impl Trait cases. This fixes an ICE where existential types used in the return types of functions would be allowed to have an out-of-scope generic type parameter.
2019-07-03Auto merge of #61775 - ↵bors-316/+788
nikomatsakis:issue-56238-multiple-lifetimes-async-fn-region-solver, r=MatthewJasper generalize impl trait to permit multiple lifetime bounds Generalizes the region solver to support "pick constraints". These have the form: ``` pick R0 from [R1..Rn] ``` where `R1..Rn` are called the "option regions". The idea is that `R0` must be equal to *some* region in the set `R1..Rn`. These constraints are then used to handle cases like this: ```rust fn foo<'a, 'b>(...) -> impl Trait<'a, 'b> { .. } ``` The problem here is that every region R in the hidden type must be equal to *either* `'a` *or* `'b` (or `'static`) -- in the past, the only kinds of constraints we had were outlives constraints, and since `'a` and `'b` are unrelated, there was no outlives constraint we could issue that would enforce that (`R: 'a` and `R: 'b` are both too strict, for example). But now we can issue a pick constraint: `pick R from ['a, 'b]`. In general, solving pick constraints is tricky. We integrate them into the solver as follows. In general, during the propagation phase, we are monotonically growing a set of inference regions. To handle a case like `pick R from [O...]`, where `O...` represents the option regions, we do the following: - Look for all the *lower bounds* of the region R -- that is, every region LB such that `R: LB` must hold. - Look for all the *upper bounds* of the region R -- that is, every region UB such that `UB: R` must hold. - Let the *viable options* be each option region O such that `UB: O` and `O: LB` for each UB, LB bound. - Find the *minimal viable option* M, where `O: M` holds for every option region O. If there is such a *minimal viable option*, then we make `R: M`. (This may in turn influence other bits of inference.) If there is no minimal viable option, either because all options were eliminated or because none of the remaining options are minimal, we do nothing. Ultimately, if the pick constraint is not satisfied, an error is reported. For this logic, we currently require that the option regions O are always lifetime parameters. To determine the bounds, we walk the various outlives edges that were otherwise introduced. r? @matthewjasper cc @cramertj Fixes #56238 TODO: - [ ] Error messages include region variable info sometimes, how to fix? - [ ] Tests for bare `existential type` and other impl Trait usage
2019-07-02Add a query to get the `promoted`s for a `mir::Body`Wesley Wiser-0/+2
This is a builidng block toward removing a lot of duplicated code between miri and the cosnt-propagator pass. See this thread for more info: https://rust-lang.zulipchat.com/#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/Using.20.60InterpCx.60.20more/near/169030661
2019-07-02Auto merge of #61268 - michaelwoerister:stabilize-pgo, r=alexcrichtonbors-18/+17
Stabilize support for Profile-guided Optimization This PR makes profile-guided optimization available via the `-C profile-generate` / `-C profile-use` pair of commandline flags and adds end-user documentation for the feature to the [rustc book](https://doc.rust-lang.org/rustc/). The PR thus ticks the last two remaining checkboxes of the [stabilization tracking issue](https://github.com/rust-lang/rust/issues/59913). From the tracking issue: > Profile-guided optimization (PGO) is a common optimization technique for ahead-of-time compilers. It works by collecting data about a program's typical execution (e.g. probability of branches taken, typical runtime values of variables, etc) and then uses this information during program optimization for things like inlining decisions, machine code layout, or indirect call promotion. If you are curious about how this can be used, there is a rendered version of the documentation this PR adds available [here]( https://github.com/michaelwoerister/rust/blob/stabilize-pgo/src/doc/rustc/src/profile-guided-optimization.md). r? @alexcrichton cc @rust-lang/compiler
2019-07-02fix ICE with delay-span-bugNiko Matsakis-3/+6
2019-07-02region_constraints: nitsNiko Matsakis-5/+5
2019-07-02opaque_types: more nitsNiko Matsakis-6/+6
2019-07-02s/abstract_type_generics/opaque_type_generics/Niko Matsakis-5/+5
2019-07-02opaque_types: various nitsNiko Matsakis-10/+10
2019-07-02cleanup formatting of comment and add attributionNiko Matsakis-22/+23
2019-07-02rewrite `dup_vec` to use `IndexVec` instead of `u32`Niko Matsakis-7/+6
2019-07-02various centril nitsNiko Matsakis-10/+11
2019-07-02explain why the code is the way it isNiko Matsakis-0/+2
2019-07-02Update src/librustc/infer/lexical_region_resolve/mod.rsNiko Matsakis-1/+1
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
2019-07-02feature-gate member constraints outside of async-awaitNiko Matsakis-0/+72
Minimizes risk.
2019-07-02implement `TypeFoldable` for `Arc`Niko Matsakis-0/+10
2019-07-02rename to "member constraints"Niko Matsakis-91/+96
2019-07-02implement Lift for ArcNiko Matsakis-0/+8
2019-07-02switch to LrcNiko Matsakis-11/+11
2019-07-02address nits by mattewjasperNiko Matsakis-29/+12
2019-07-02account for the pick-constraint edges when reporting errorsNiko Matsakis-3/+38
Also, thread through better span info to improve the error message to something tolerable.
2019-07-02pacify the mercilous tidyNiko Matsakis-2/+6
long lines, trailing newlines
2019-07-02preliminary integration of "pick constraints" into nll solverNiko Matsakis-7/+8
2019-07-02[WIP] fix `Lift` impl for `Rc`Niko Matsakis-1/+1
2019-07-02propagate the pick-constraints through queriesNiko Matsakis-9/+35
2019-07-02pass a `&mut QueryRegionConstraints` not just outlives constraintsNiko Matsakis-10/+12
2019-07-02introduce `QueryRegionConstraints` structNiko Matsakis-22/+28
2019-07-02introduce `QueryRegionConstraints` struct (no-op)Niko Matsakis-7/+27