about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2017-12-13tests transcribed from nikos blog post.Felix S. Klock II-0/+101
2017-12-13the minimal test for two-phase borrows: the core example from niko's blog ↵Felix S. Klock II-0/+21
post on it.
2017-12-13Incorporate active-borrows dataflow into MIR borrow check, yieldingFelix S. Klock II-6/+26
two-phase `&mut`-borrow support. This (new) support sits under `-Z two-phase-borrows` debugflag. (Still needs tests. That's coming next.)
2017-12-13Add some doc to `struct Borrows`.Felix S. Klock II-3/+22
2017-12-13Add some doc to `each_borrow_involving_path` iteration function.Felix S. Klock II-0/+12
2017-12-13New `ActiveBorrows` dataflow for two-phase `&mut`; not yet borrowed-checked.Felix S. Klock II-151/+552
High-level picture: The old `Borrows` analysis is now called `Reservations` (implemented as a newtype wrapper around `Borrows`); this continues to compute whether a `Rvalue::Ref` can reach a statement without an intervening `EndRegion`. In addition, we also track what `Place` each such `Rvalue::Ref` was immediately assigned to in a given borrow (yay for MIR-structural properties!). The new `ActiveBorrows` analysis then tracks the initial use of any of those assigned `Places` for a given borrow. I.e. a borrow becomes "active" immediately after it starts being "used" in some way. (This is conservative in the sense that we will treat a copy `x = y;` as a use of `y`; in principle one might further delay activation in such cases.) The new `ActiveBorrows` analysis needs to take the `Reservations` results as an initial input, because the reservation state influences the gen/kill sets for `ActiveBorrows`. In particular, a use of `a` activates a borrow `a = &b` if and only if there exists a path (in the control flow graph) from the borrow to that use. So we need to know if the borrow reaches a given use to know if it really gets a gen-bit or not. * Incorporating the output from one dataflow analysis into the input of another required more changes to the infrastructure than I had expected, and even after those changes, the resulting code is still a bit subtle. * In particular, Since we need to know the intrablock reservation state, we need to dynamically update a bitvector for the reservations as we are also trying to compute the gen/kills bitvector for the active borrows. * The way I ended up deciding to do this (after also toying with at least two other designs) is to put both the reservation state and the active borrow state into a single bitvector. That is why we now have separate (but related) `BorrowIndex` and `ReserveOrActivateIndex`: each borrow index maps to a pair of neighboring reservation and activation indexes. As noted above, these changes are solely adding the active borrows dataflow analysis (and updating the existing code to cope with the switch from `Borrows` to `Reservations`). The code to process the bitvector in the borrow checker currently just skips over all of the active borrow bits. But atop this commit, one *can* observe the analysis results by looking at the graphviz output, e.g. via ```rust #[rustc_mir(borrowck_graphviz_preflow="pre_two_phase.dot", borrowck_graphviz_postflow="post_two_phase.dot")] ``` Includes doc for `FindPlaceUses`, as well as `Reservations` and `ActiveBorrows` structs, which are wrappers are the `Borrows` struct that dictate which flow analysis should be performed.
2017-12-13Allow `mir::Place` to be used as a key in hashtables.Felix S. Klock II-2/+2
2017-12-13Implement Borrow/BorrowMut/ToOwned relationships betweed IdxSetBuf and IdxSet.Felix S. Klock II-0/+20
2017-12-13Refactoring alpha-rename `place` (`BorrowData` field) to `borrowed_place`.Felix S. Klock II-10/+10
2017-12-13Refactoring: Allow `BlockSets.on_entry` to denote locally accumulated ↵Felix S. Klock II-0/+30
intrablock state. (Still musing about whether it could make sense to revise the design here to make these constraints on usage explicit.)
2017-12-13Refactoring: pull bitvector initialization out from other parts of dataflow.Felix S. Klock II-21/+18
This is meant to ease development of multi-stage dataflow analyses where the output from one analysis is used to initialize the state for the next; in such a context, you cannot start with `bottom_value` for all the bits.
2017-12-13Expanded HIR `--unpretty hir,identified` to include HIR local id.Felix S. Klock II-4/+8
Having the HIR local id is useful for cases like understanding the ReScope identifiers, which are now derived from the HIR local id, and thus one can map an ReScope back to the HIR node, once one knows what those local ids are.
2017-12-13Revised graphviz rendering API to avoid requiring borrowed state.Felix S. Klock II-41/+60
Made `do_dataflow` and related API `pub(crate)`.
2017-12-13Auto merge of #46613 - petrochenkov:absext, r=nikomatsakisbors-57/+264
Resolve absolute paths as extern under a feature flag cc https://github.com/rust-lang/rust/issues/44660 r? @nikomatsakis
2017-12-12Auto merge of #46570 - AgustinCB:issue-46553, r=oli-obkbors-2/+33
Ignore `unsopported constant expr` error Fixes #46553
2017-12-13Resolve absolute paths as extern under a feature flagVadim Petrochenkov-3/+238
2017-12-12rustc_metadata: Refactor away `ExternCrateInfo`Vadim Petrochenkov-54/+26
2017-12-13Rollup merge of #46691 - varkor:contrib-3, r=rkruppekennytm-2/+2
Fix return value of `LLVMRustMetadataAsValue` `LLVMRustMetadataAsValue` would previously return `void`, despite the corresponding Rust function expecting to return a `ValueRef`.
2017-12-13Rollup merge of #46672 - GuillaumeGomez:fix-type-filter-search, ↵kennytm-4/+4
r=QuietMisdreavus Fix type filter in rustdoc js Fixes #46612. r? @QuietMisdreavus
2017-12-13Rollup merge of #46668 - GuillaumeGomez:mobile-sidebar, r=QuietMisdreavuskennytm-4/+27
Fix mobile doc style and improve search bar Fixes #46593. r? @QuietMisdreavus
2017-12-12Fix return value of `LLVMRustMetadataAsValue`varkor-2/+2
`LLVMRustMetadataAsValue` would previously return `void`, despite the corresponding Rust function expecting to return a `ValueRef`.
2017-12-12Auto merge of #46647 - varkor:contrib-1, r=sfacklerbors-0/+8
Add `std::fmt::Pointer` implementation for `AtomicPtr` Resolves #29212.
2017-12-12Auto merge of #46250 - canndrew:rename-never-type-impl-gate, r=petrochenkovbors-8/+8
Rename never_type_impls gate We no longer need a separately-named `never_type_impls` gate thanks to https://github.com/rust-lang/rust/issues/43089.
2017-12-12Auto merge of #46674 - malbarbo:undist-armv5te, r=alexcrichtonbors-6/+1
Remove armv5te target from dist-various-1 Reverts https://github.com/rust-lang/rust/pull/46498 I must have made some mistake when I tested that commit and thought armv5te target worked. but testing it now the produced binaries segfaults (https://github.com/rust-lang/rust/pull/46498#issuecomment-350599233). I tried using crosstool-ng and buildroot toolchain (for armv5te) but the produced binaries also segfaults. Maybe there is a issue with the target, but I cannot investigate it any further. I think the best for now is not to distribute the armv5te target. I'm sorry for what happened.
2017-12-12Auto merge of #46598 - davidtwco:issue-46471, r=arielb1bors-51/+297
MIR borrowck: error message confuses locals and temporaries Fixes #46471 and fixes #46472 (see [this Gitter comment](https://gitter.im/rust-impl-period/WG-compiler-nll?at=5a2d5cb53ae2aa6b3facf0c2)). r? @arielb1
2017-12-12Rename never_type_impls gate to never_typeAndrew Cann-8/+8
2017-12-12Auto merge of #46411 - rillian:str_ascii, r=kennytmbors-24/+24
Mark ascii methods on primitive types stable in 1.23.0 not 1.21.0. The ascii_methods_on_intrinsics feature stabilization didn't land in time for 1.21.0. Update the annotation so the documentation is correct about when these methods became available.
2017-12-12Auto merge of #46657 - nikomatsakis:resolve-lifetimes-query, r=arielb1bors-647/+937
move `resolve_lifetimes` into a proper query Now that we made `resolve_lifetimes` into a query, elision errors no longer abort compilation, which affects some tests. Also, remove `dep_graph_crosscontaminate_tables` -- there is no a path in the dep-graph, though red-green handles it. The same scenario is (correctly) tested by issue-42602.rs in any case. r? @michaelwoerister
2017-12-11Remove armv5te target from dist-various-1Marco A L Barbosa-6/+1
Reverts https://github.com/rust-lang/rust/pull/46498 I must have made some mistake when I tested that commit and thought armv5te target worked. but testing it now the produced binaries segfaults (https://github.com/rust-lang/rust/pull/46498#issuecomment-350599233). I tried using crosstool-ng and buildroot toolchain (for armv5te) but the produced binaries also segfaults. Maybe there is a issue with the target, but I cannot investigate it any further. I think the best for now is not to distribute the armv5te target. I'm sorry for what happened.
2017-12-12Fix type filter in rustdoc jsGuillaume Gomez-4/+4
2017-12-11Updated existing tests with new error messages.David Wood-46/+57
2017-12-11Refactored and tidied up report functionDavid Wood-53/+92
2017-12-11Fix mobile doc style and improve search barGuillaume Gomez-4/+27
2017-12-11Auto merge of #46608 - estebank:resolve-return, r=nikomatsakisbors-7/+51
Resolve type on return type suggestion Partially address #45871.
2017-12-11make `krate` infallibleNiko Matsakis-4/+3
2017-12-11Fixed case where borrowed value lives until after scopeDavid Wood-8/+69
2017-12-11Fix error does not know about free/named lifetimesDavid Wood-11/+26
2017-12-11Added test for #46472David Wood-1/+65
2017-12-11Fix error message confuses locals and temporariesDavid Wood-10/+22
2017-12-11Added test for #46471David Wood-0/+44
2017-12-11Auto merge of #46558 - arielb1:union-borrow-refactor, r=nikomatsakisbors-1336/+1358
Clean up the MIR borrowck code I want to avoid the new code to start with so much technical debt. r? @nikomatsakis
2017-12-11move `resolve_lifetimes` into a proper queryNiko Matsakis-237/+283
Now that we made `resolve_lifetimes` into a query, elision errors no longer abort compilation, which affects some tests. Also, remove `dep_graph_crosscontaminate_tables` -- there is no a path in the dep-graph, though red-green handles it. The same scenario is (correctly) tested by issue-42602.rs in any case.
2017-12-11resolve_lifetime: rustfmtNiko Matsakis-476/+721
2017-12-11Auto merge of #46640 - tommyip:ui_tests, r=estebankbors-203/+253
Enforce successful ui tests to have must-compile-successfully flag. r? @nikomatsakis cc @oli-obk Fixes #46587
2017-12-11Auto merge of #46625 - emilio:moar-nits, r=kennytmbors-1/+1
infer: Fix typo in README. Was just reading through it and found this, not a big deal but...
2017-12-11Auto merge of #46624 - emilio:nit, r=kennytmbors-4/+4
rustc_trans: Fix indentation in trans_set_discr. Just noticed this while reading through #46521, which introduced this weird alignment.
2017-12-10Auto merge of #46248 - ↵bors-24/+148
zackmdavis:one_time_private_enum_variant_reexport_error, r=estebank one-time diagnostics for private enum variants glob reëxport ![private_enum_reexport](https://user-images.githubusercontent.com/1076988/33224719-4e5805f0-d121-11e7-8bc0-a708a277a5db.png) r? @estebank
2017-12-10Add `std::fmt::Pointer` implementation for `AtomicPtr`varkor-0/+8
Resolves #29212.
2017-12-10Update ui tests' line numbers.Tommy Ip-192/+192
2017-12-10Add must-compile-successfully comment to appropriate ui tests.Tommy Ip-0/+44