Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
342309e
Add assert
JohnTitor Mar 29, 2019
70e7265
Expand uint
JohnTitor Mar 29, 2019
d7bb9de
Clean up
JohnTitor Mar 29, 2019
261c7c1
Remove unnecessary cast
JohnTitor Mar 29, 2019
bf3a744
Add tests
JohnTitor Mar 30, 2019
cfe99be
Remove unnecessary variable
JohnTitor Mar 30, 2019
69dc278
Add bar
JohnTitor Mar 30, 2019
6fcd5bb
WIP: correct flags
JohnTitor Mar 30, 2019
1d12b06
Fix variable name
JohnTitor Apr 1, 2019
1aea502
Fix check
JohnTitor Apr 17, 2019
9b9a1f2
Separate comment
JohnTitor Apr 17, 2019
d8454fc
Add flags
JohnTitor Apr 24, 2019
dca8319
Remove check flag
JohnTitor Apr 24, 2019
e21077c
WIP: fix debuginfo test
JohnTitor Apr 24, 2019
a197466
Ignore line length
JohnTitor Apr 30, 2019
4315c78
WIP: add some flags for debuginfo
JohnTitor Apr 30, 2019
6ed4b52
Ignore line length
JohnTitor Apr 30, 2019
a3aafea
Account for paths in incorrect pub qualifier help
estebank May 1, 2019
2c371b2
build dist-aarch64-linux with --enable-profiler
froydnj May 2, 2019
d72f4de
Constrain all regions in the concrete type for an opaque type
matthewjasper May 1, 2019
a0f4914
This continue is not needed
spastorino Apr 26, 2019
9f7b953
Remove root_local fn in favor of base_local
spastorino May 1, 2019
49f0141
Implement base_local iteratively
spastorino May 1, 2019
1dc4a38
Fix potential integer overflow in SGX memory range calculation.
May 3, 2019
2e85b31
Fix codegen tests
JohnTitor May 3, 2019
544d8e9
Fix argument alias handling for -O and -C opt-level
varkor Apr 30, 2019
226894b
Fix argument alias handling for -g and -C debuginfo
varkor Apr 30, 2019
e5d3c48
Add a run-make test for command aliases
varkor Apr 30, 2019
28b8c20
Add comments
varkor May 1, 2019
f6b5e8a
Update getopts to 0.2.19
varkor May 2, 2019
1e2af7d
Reword casting message
estebank May 3, 2019
9d28309
Rollup merge of #59520 - JohnTitor:add-assert, r=eddyb
Centril May 3, 2019
16f7531
Rollup merge of #60426 - varkor:fix-duplicate-arg-handling, r=alexcri…
Centril May 3, 2019
15494fd
Rollup merge of #60429 - estebank:pub-path, r=michaelwoerister
Centril May 3, 2019
92366d8
Rollup merge of #60449 - matthewjasper:impl-trait-outlives, r=pnkfelix
Centril May 3, 2019
db3f86c
Rollup merge of #60476 - froydnj:aarch64-profiling, r=alexcrichton
Centril May 3, 2019
c2b949a
Rollup merge of #60486 - spastorino:place-related-refactors, r=oli-obk
Centril May 3, 2019
d421649
Rollup merge of #60496 - jethrogb:jb/address-integer-overflow, r=alex…
Centril May 3, 2019
b1d80a6
Rollup merge of #60517 - estebank:wording, r=davidtwco
Centril May 3, 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
11 changes: 7 additions & 4 deletions src/librustc/mir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2055,10 +2055,13 @@ impl<'tcx> Place<'tcx> {

/// Finds the innermost `Local` from this `Place`.
pub fn base_local(&self) -> Option<Local> {
match self {
Place::Base(PlaceBase::Local(local)) => Some(*local),
Place::Projection(box Projection { base, elem: _ }) => base.base_local(),
Place::Base(PlaceBase::Static(..)) => None,
let mut place = self;
loop {
match place {
Place::Projection(proj) => place = &proj.base,
Place::Base(PlaceBase::Static(_)) => return None,
Place::Base(PlaceBase::Local(local)) => return Some(*local),
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/librustc_mir/borrow_check/borrow_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ impl<'a, 'gcx, 'tcx> Visitor<'tcx> for GatherBorrows<'a, 'gcx, 'tcx> {

self.insert_as_pending_if_two_phase(location, &assigned_place, kind, idx);

if let Some(local) = borrowed_place.root_local() {
if let Some(local) = borrowed_place.base_local() {
self.local_map.entry(local).or_default().insert(idx);
}
}
Expand Down
1 change: 0 additions & 1 deletion src/librustc_mir/borrow_check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1831,7 +1831,6 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
}

place = base;
continue;
}
}
}
Expand Down
17 changes: 1 addition & 16 deletions src/librustc_mir/borrow_check/place_ext.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use rustc::hir;
use rustc::mir::ProjectionElem;
use rustc::mir::{Local, Mir, Place, PlaceBase, Mutability, Static, StaticKind};
use rustc::mir::{Mir, Place, PlaceBase, Mutability, Static, StaticKind};
use rustc::ty::{self, TyCtxt};
use crate::borrow_check::borrow_set::LocalsStateAtExit;

Expand All @@ -16,10 +16,6 @@ crate trait PlaceExt<'tcx> {
mir: &Mir<'tcx>,
locals_state_at_exit: &LocalsStateAtExit,
) -> bool;

/// If this is a place like `x.f.g`, returns the local
/// `x`. Returns `None` if this is based in a static.
fn root_local(&self) -> Option<Local>;
}

impl<'tcx> PlaceExt<'tcx> for Place<'tcx> {
Expand Down Expand Up @@ -82,15 +78,4 @@ impl<'tcx> PlaceExt<'tcx> for Place<'tcx> {
},
}
}

fn root_local(&self) -> Option<Local> {
let mut p = self;
loop {
match p {
Place::Projection(pi) => p = &pi.base,
Place::Base(PlaceBase::Static(_)) => return None,
Place::Base(PlaceBase::Local(l)) => return Some(*l),
}
}
}
}