28 Commits

Author SHA1 Message Date
Eduard-Mihai Burtescu
17cdd356da rustc: replace TyCtxt<'tcx, 'gcx, 'tcx> with TyCtxt<'gcx, 'tcx>. 2019-06-12 13:38:27 +03:00
Eduard-Mihai Burtescu
2441253508 Fix fallout from deny(unused_lifetimes). 2019-06-12 13:38:27 +03:00
Eduard-Mihai Burtescu
37799a5552 rustc: replace TyCtxt<'a, 'gcx, 'tcx> with TyCtxt<'tcx, 'gcx, 'tcx>. 2019-06-12 13:38:27 +03:00
Eduard-Mihai Burtescu
d110d309b6 rustc_mir: deny(unused_lifetimes). 2019-06-11 14:11:58 +03:00
Jad Ghalayini
80ff07f30d Changed usages of mir in librustc::mir and librustc_mir to body 2019-06-09 16:05:05 -04:00
Claude-Alban RANÉLY-VERGÉ-DÉPRÉ
6e5e0daff2 Changes the type mir::Mir into mir::Body
The commit should have changed comments as well.
At the time of writting, it passes the tidy and check tool.

Revisions asked by eddyb :
- Renamed of all the occurences of {visit/super}_mir
- Renamed test structures `CachedMir` to `Cached`

Fixing the missing import on `AggregateKind`
2019-05-28 19:17:51 +02:00
Santiago Pastorino
9613779855 Make borrow_of_local_data iterate instead of recurse 2019-05-24 18:42:04 +02:00
Yuki Okushi
99ebb7a517 Remove Context and ContextKind 2019-05-02 07:12:32 +09:00
flip1995
2e5f0b3c49
Remove unused TyCtxt argument from allow_two_phase_borrow function 2019-04-28 22:17:15 +02:00
flip1995
e1da67e69c
Fix lint findings in librustc_mir 2019-04-28 21:19:27 +02:00
Yuki OKUSHI
542357f52a Remove two-phase-beyond-autoref 2019-04-28 12:51:04 +09:00
Matthew Jasper
aa6fb6caf9 Enable migrate mode by default on the 2015 edition
This also fully stabilizes two-phase borrows on all editions
2019-04-21 20:50:02 +01:00
Saleem Jaffer
7fb1c22da1 promoted is still left in 2 places 2019-03-18 15:03:29 +05:30
Santiago Pastorino
0f993d5a7a Put Local, Static and Promoted as one Base variant of Place 2019-03-01 05:02:00 +01:00
Alexander Regueiro
c3e182cf43 rustc: doc comments 2019-02-10 23:42:32 +00:00
Taiki Endo
725af30809 librustc_mir => 2018 2019-02-08 06:28:15 +09:00
Mark Rousskov
2a663555dd Remove licenses 2018-12-25 21:08:33 -07:00
David Wood
db635fc566
Kill borrows from a projection after assignment.
This commit extends previous work to kill borrows from a local after
assignment into that local to kill borrows from a projection after
assignment into a prefix of that place.
2018-12-17 14:49:52 +01:00
Matthew Jasper
a830732090 Rename places_conflict to borrow_conflicts_with_place
This name better reflects the asymmetry of this function.
2018-09-24 23:33:13 +01:00
Matthew Jasper
ced5c2d08a Add "Shallow" borrow kind
This allows treating the "fake" match borrows differently from shared
borrows.
2018-09-24 23:33:13 +01:00
Matthew Jasper
4603fb8862 Rework checking for borrows conflicting with drops
Previously, we would split the drop access into multiple checks for each
field of a struct/tuple/closure and through `Box` dereferences. This
changes this to check if the borrow is accessed by the drop in
places_conflict.

This also allows us to handle enums in a simpler way, since we don't
have to construct any new places.
2018-09-23 20:27:41 +01:00
Oliver Schneider
de511438cd Promoteds are statics and statics have a place, not just a value 2018-07-23 09:51:30 +02:00
Niko Matsakis
90c90ba542 rename control_flow_graph to graph 2018-07-12 00:38:40 -04:00
David Wood
7eba13f451
Correctly handle an activation from dead code. 2018-07-04 20:08:15 +01:00
Niko Matsakis
edf14d1884 extract places_conflict into its own module 2018-06-27 11:47:58 -04:00
Nicholas Nethercote
ba0bb02f6f Return a SmallVec from place_elements.
These vectors are always small, so this avoids lots of allocations.
2018-06-19 09:37:31 +10:00
Felix S. Klock II
3bc5073dbb Expand two-phase-borrows so that a case like this still compiles:
```rust
fn main() {
    fn reuse<X>(_: &mut X) {}
    let mut t = 2f64;
    match t {
        ref mut _b if { false } => { reuse(_b); }
        _ => {}
    }
}
```

Note: The way this is currently written is confusing; when `autoref`
is off, then the arm body bindings (introduced by
`bind_matched_candidate_for_arm_body`) are *also* used for the guard.
(Any attempt to fix this needs to still ensure that the bindings used
by the guard are introduced before the guard is evaluated.)

(Once we turn NLL on by default, we can presumably simplify all of
that.)
2018-05-29 23:02:40 +02:00
bobtwinkles
e62fa27071 Refactor borrowck to share more code with fact dumping
Following up my changes in #50798, I wanted to grab at least the low-hanging
fruit for code deduplication.
2018-05-18 23:47:48 -07:00