about summary refs log tree commit diff
path: root/src/librustc_borrowck
AgeCommit message (Collapse)AuthorLines
2016-05-23Fix #33819 and update ui testJonathan Turner-1/+5
2016-05-23revised mir-dataflow so bitvectors carry a phantom type for their index domain.Felix S. Klock II-180/+272
As some drive-by's: * moved bitwise operators into `mod bitslice` * factored out `fn gen` and `fn kill` methods on `BlockSets` type * removed outdated comment about `fn propagate_call_return`
2016-05-23add `indexed_set` mod for typed wrappers around bitarrays representing sets.Felix S. Klock II-0/+88
It provides an `Idx` trait for usize wrappers used to represent the elements of such sets.
2016-05-20Refactor `bitslice`: distinguish `usize` for indexing vs word type being ↵Felix S. Klock II-11/+13
indexed.
2016-05-20Rollup merge of #33676 - rkruppe:e0509-exact-words, r=sanxiynGuillaume Gomez-1/+1
Reword the short diagnostic for E0509 Saying that a type *implements* a trait is much more idiomatic than saying it *defines* the trait.
2016-05-20review feedback: fix some index-mismatch bugs pointed out by arielb1.Felix S. Klock II-3/+0
2016-05-20Review feedback.Felix S. Klock II-23/+21
Removed `BitDenotation: DataflowOperator` relationship. Alpha-renamed `fn initial_value` to `fn bottom_value`.
2016-05-20`mir::dataflow` arielb1 review feedbackFelix S. Klock II-64/+32
* removed `on_all_children_bits`, rewriting calls to use `super::on_all_children_bits` * moved `fn path` helper routine out of `impl MirBorrowckCtxtPreDataflow`
2016-05-20Added comment pointing out somewhat subtle initialization in `fn ↵Felix S. Klock II-0/+1
start_block_effect`.
2016-05-20`borrowck::mir`: alpha-renamed DropFlagState variant names.Felix S. Klock II-14/+14
2016-05-20fix comment in `impl DataflowOperator for MaybeUninitializedLvals`.Felix S. Klock II-1/+1
2016-05-20`mir::dataflow::sanity_check`: Factor out `fn is_rustc_peek` helper routine.Felix S. Klock II-28/+28
2016-05-19Rollup merge of #33353 - timothy-mcroy:E0502, r=sanxiynManish Goregaokar-1/+27
Add error explanation for E0502 I am questioning the order of presentation on the suggested code fixes, but I'm not sure what would be best. Thoughts? r? @GuillaumeGomez
2016-05-19Reword the short diagnostic for E0509Robin Kruppe-1/+1
Saying that a type *implements* a trait is much more idiomatic than saying it *defines* the trait.
2016-05-18Auto merge of #33688 - jonathandturner:fix_old_school, r=nikomatsakisbors-11/+7
Fix for old school error issues, improvements to new school This PR: * Fixes some old school error issues, specifically #33559, #33543, #33366 * Improves wording borrowck errors with match patterns * De-emphasize multi-line spans, so we don't color the single source character when we're trying to say "span starts here" * Rollup of #33392 (which should help fix #33390) r? @nikomatsakis
2016-05-18Auto merge of #33710 - Manishearth:rollup, r=Manishearthbors-0/+1
Rollup of 5 pull requests - Successful merges: #33656, #33666, #33673, #33675, #33695 - Failed merges:
2016-05-17Add descriptive error explanation for E0502Timothy McRoy-1/+27
2016-05-17Improve a few errors and fix #33366Jonathan Turner-11/+7
2016-05-17`mir::dataflow::sanity_check`: removed hackish `tmp = val` propagation code.Felix S. Klock II-35/+8
(it was an artifact of an earlier design of the `rustc_peek` API, but its totally unnecessary now.)
2016-05-17Fix comments in `mir::dataflow::sanity_check`.Felix S. Klock II-19/+18
2016-05-16Add missing code fence to `diagnostics.rs`Andrew Paseltiner-0/+1
Closes #33662
2016-05-16Remove hir::IdentVadim Petrochenkov-1/+1
2016-05-16`DefinitelyInitializedLvals` dataflow op (goal: move away from ↵Felix S. Klock II-10/+157
`MaybeUninitializedLvals`)
2016-05-16Little unit tests for MIR dataflow analysis.Felix S. Klock II-0/+3
These use new `rustc_peek` (whose semantics is driven by attribute attached to fn).
2016-05-16Add ability to unit-test dataflow results via `rustc_peek` intrinsic.Felix S. Klock II-3/+208
(The static semantics of `rustc_peek` is derived from attributes attached to the function being compiled; in this case, `rustc_peek(&expr)` observes the dataflow state for the l-value `expr`.)
2016-05-16Revised mir-dataflow.Felix S. Klock II-718/+1365
Incorporates many fixes contributed by arielb1. ---- revise borrowck::mir::dataflow code to allow varying domain for bitvectors. This particular code implements the `BitDenotation` trait for three analyses: * `MovingOutStatements`, which, like `borrowck::move_data`, maps each bit-index to a move instruction, and a 1 means "the effect of this move reaches this point" (and the assigned l-value, if a scoped declaration, is still in scope). * `MaybeInitializedLvals`, which maps each bit-index to an l-value. A 1 means "there exists a control flow path to this point that initializes the associated l-value." * `MaybeUninitializedLvals`, which maps each bit-index to an l-value A 1 means "there exists a control flow path to this point that de-initializes the associated l-value." ---- Revised `graphviz` dataflow-rendering support in `borrowck::mir`. One big difference is that this code is now parameterized over the `BitDenotation`, so that it can be used to render dataflow results independent of how the dataflow bitvectors are interpreted; see where reference to `MoveOut` is replaced by the type parameter `D`. ---- Factor out routine to query subattributes in `#[rustc_mir(..)]`. (Later commits build upon this for some unit testing and instrumentation.) ---- thread through a tcx so that I can query types of lvalues as part of analysis. ---- Revised `BitDenotation::Ctxt`, allowing variation beyond `MoveData`. The main motivation is to ease threading through a `TyCtxt`. (In hindsight it might have been better to instead attach the `TyCtxt` to each of the different dataflow implementations, but that would require e.g. switching away from having a `Default` impl, so I am leaving that experiment for another time.)
2016-05-16`borrowck::mir::gather_moves`: create MovePaths for lvalues even if ↵Felix S. Klock II-32/+74
unreferenced. includes misc bug fixes and removal of useless code.
2016-05-16Unit struct defns for 3 dataflow analyses for `borrowck::mir::dataflow`.Felix S. Klock II-0/+117
2016-05-16Remove `&self` parameter from `DataflowOperator::initial_value`.Felix S. Klock II-4/+4
2016-05-16Add helper method for getting the dataflow results at exit from a basic block.Felix S. Klock II-0/+8
2016-05-16fixes to `librustc_borrowck::bitslice::bits_to_string`, used for graphviz ↵Felix S. Klock II-10/+14
printing.
2016-05-16fix bug in `debug!` output from `rustc::middle::dataflow`Felix S. Klock II-2/+2
(bug was cut/pasted into `rustc_borrowck::bitslice`, so I fixed it there as well.)
2016-05-15Auto merge of #33619 - jonathandturner:improve_structured_errors, r=nikomatsakisbors-92/+135
Batch of improvements to errors for new error format This is a batch of improvements to existing errors to help get the most out of the new error format. * Added labels to primary spans (^^^) for a set of errors that didn't currently have them * Highlight the source blue under the secondary notes for better readability * Move some of the "Note:" into secondary spans+labels * Fix span_label to take &mut instead, which makes it work the same as other methods in that set
2016-05-15Add space after equalsJonathan Turner-1/+1
2016-05-15Rollup merge of #33533 - GuillaumeGomez:add_E0500, r=steveklabnikManish Goregaokar-1/+47
Add E0500 error explanation r? @Manishearth Part of #32777.
2016-05-15Rollup merge of #33475 - billyevans:master, r=guillaumegomezManish Goregaokar-1/+79
Add detailed error explanation for E0505 Part of #32777
2016-05-12Update errors to use new error formatJonathan Turner-91/+104
2016-05-12Set of fixes to improve borrowcks that weren't updatedJonathan Turner-16/+46
2016-05-12Auto merge of #33282 - alexcrichton:rustbuild-crate-tests, r=brsonbors-0/+1
rustbuild: Add support for crate tests + doctests This commit adds support to rustbuild to run crate unit tests (those defined by `#[test]`) as well as documentation tests. All tests are powered by `cargo test` under the hood. Each step requires the `libtest` library is built for that corresponding stage. Ideally the `test` crate would be a dev-dependency, but for now it's just easier to ensure that we sequence everything in the right order. Currently no filtering is implemented, so there's not actually a method of testing *only* libstd or *only* libcore, but rather entire swaths of crates are tested all at once. A few points of note here are: * The `coretest` and `collectionstest` crates are just listed as `[[test]]` entires for `cargo test` to naturally pick up. This mean that `cargo test -p core` actually runs all the tests for libcore. * Libraries that aren't tested all mention `test = false` in their `Cargo.toml` * Crates aren't currently allowed to have dev-dependencies due to rust-lang/cargo#860, but we can likely alleviate this restriction once workspaces are implemented. cc #31590
2016-05-12rustbuild: Add support for crate tests + doctestsAlex Crichton-0/+1
This commit adds support to rustbuild to run crate unit tests (those defined by `#[test]`) as well as documentation tests. All tests are powered by `cargo test` under the hood. Each step requires the `libtest` library is built for that corresponding stage. Ideally the `test` crate would be a dev-dependency, but for now it's just easier to ensure that we sequence everything in the right order. Currently no filtering is implemented, so there's not actually a method of testing *only* libstd or *only* libcore, but rather entire swaths of crates are tested all at once. A few points of note here are: * The `coretest` and `collectionstest` crates are just listed as `[[test]]` entires for `cargo test` to naturally pick up. This mean that `cargo test -p core` actually runs all the tests for libcore. * Libraries that aren't tested all mention `test = false` in their `Cargo.toml` * Crates aren't currently allowed to have dev-dependencies due to rust-lang/cargo#860, but we can likely alleviate this restriction once workspaces are implemented. cc #31590
2016-05-11Add detailed error explanation for E0505billyevans-1/+79
Part of #32777
2016-05-11Rollup merge of #33386 - cramertj:E0504, r=steveklabnikSteve Klabnik-1/+104
Add detailed error explanation for E0504 Part of #32777
2016-05-11Add E0500 error explanationggomez-1/+47
2016-05-11rustc: Split local type contexts interners from the global one.Eduard Burtescu-34/+30
2016-05-11rustc: Wrap users of InferCtxt in an anonymous scope.Eduard Burtescu-26/+22
2016-05-11rustc: Remove the TyCtxt field from ParameterEnvironment.Eduard Burtescu-8/+8
2016-05-11rustc: Split 'tcx into 'gcx and 'tcx for InferCtxt and its users.Eduard Burtescu-22/+22
2016-05-11rustc: Replace &'a TyCtxt<'tcx> with a TyCtxt<'a, 'tcx> wrapper.Eduard Burtescu-57/+53
2016-05-11mem_categorization: freely_aliasable doesn't need to take TyCtxt.Eduard Burtescu-1/+1
2016-05-11infer: Use methods for creating an InferCtxt.Eduard Burtescu-14/+8