Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 13 pull requests #61127

Closed
wants to merge 30 commits into from
Closed
Changes from 2 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
2e39b9c
Make find_local iterate instead of recurse
spastorino May 23, 2019
d5e0353
Update cargo
ehuss May 23, 2019
46ffb6a
tidy: don't short-circuit on license error
ehuss May 23, 2019
d3c73dd
typo
blkerby May 19, 2019
0123fab
Fix typo "spit_paths", add link
blkerby May 24, 2019
9be8b7e
Fixed type-alias-bounds lint doc
Cerber-Ursi May 24, 2019
a8fc09b
Use FnOnce instead of FnBox in libtest
SimonSapin May 24, 2019
67ee286
Remove the incorrect warning from README.md
scottmcm May 24, 2019
73fd349
Deprecate `FnBox`. `Box<dyn FnOnce()>` can be called directly, since …
SimonSapin May 24, 2019
e396f99
Don't arena-allocate static symbols.
nnethercote May 23, 2019
698e50f
Delay ICE in fold_region so feature gate has chance to stop compilati…
pnkfelix May 24, 2019
8e4132a
Delay ICE in early_free_scope so feature gate has chance to stop comp…
pnkfelix May 24, 2019
c235ba4
Regression test for issue #60654.
pnkfelix May 24, 2019
e7c2777
Make eval_place iterate instead of recurse
spastorino May 24, 2019
3dccf83
Make eval_place_to_op iterate instead of recurse
spastorino May 23, 2019
34314ca
Make find iterate instead of recurse
spastorino May 23, 2019
aba152d
Updated my mailmap entry
XAMPPRocky May 24, 2019
bd606ec
Rollup merge of #61077 - nnethercote:tweak-prefill, r=petrochenkov
Centril May 24, 2019
d746cfa
Rollup merge of #61094 - spastorino:find-local-iterate, r=oli-obk
Centril May 24, 2019
4d87f3d
Rollup merge of #61095 - ehuss:update-cargo, r=alexcrichton
Centril May 24, 2019
249b44c
Rollup merge of #61096 - ehuss:tidy-license-short-circuit, r=Centril
Centril May 24, 2019
24ee7ba
Rollup merge of #61103 - spastorino:find-iterate, r=oli-obk
Centril May 24, 2019
a699337
Rollup merge of #61104 - spastorino:eval-place-to-op-iterate, r=oli-obk
Centril May 24, 2019
b2a97b9
Rollup merge of #61107 - blkerby:docs_typos, r=Centril
Centril May 24, 2019
f5b5656
Rollup merge of #61111 - Cerberuser:patch-1, r=steveklabnik
Centril May 24, 2019
373ae48
Rollup merge of #61113 - SimonSapin:fnbox, r=alexcrichton
Centril May 24, 2019
40df4c0
Rollup merge of #61116 - scottmcm:vcpp-download-link, r=alexcrichton
Centril May 24, 2019
85b7dbf
Rollup merge of #61118 - pnkfelix:issue-60654-dont-ice-on-gat, r=varkor
Centril May 24, 2019
cdfacbd
Rollup merge of #61120 - spastorino:eval-place-iterate, r=oli-obk
Centril May 24, 2019
b267b94
Rollup merge of #61125 - XAMPPRocky:master, r=jonas-schievink
Centril May 24, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions src/librustc_mir/dataflow/impls/borrowed_locals.rs
Original file line number Diff line number Diff line change
@@ -91,16 +91,19 @@ struct BorrowedLocalsVisitor<'b, 'c: 'b> {
}

fn find_local<'tcx>(place: &Place<'tcx>) -> Option<Local> {
match *place {
Place::Base(PlaceBase::Local(l)) => Some(l),
Place::Base(PlaceBase::Static(..)) => None,
Place::Projection(ref proj) => {
match proj.elem {
ProjectionElem::Deref => None,
_ => find_local(&proj.base)
place.iterate(|place_base, place_projection| {
for proj in place_projection {
if proj.elem == ProjectionElem::Deref {
return None;
}
}
}

if let PlaceBase::Local(local) = place_base {
Some(*local)
} else {
None
}
})
}

impl<'tcx, 'b, 'c> Visitor<'tcx> for BorrowedLocalsVisitor<'b, 'c> {