8000 Rollup of 11 pull requests by Centril · Pull Request #65559 · rust-lang/rust · GitHub
[go: up one dir, main page]

Skip to content

Rollup of 11 pull requests #65559

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

Closed
wants to merge 39 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
3b0fd82
Disable Go and OCaml bindings when building LLVM
tmiasko Oct 8, 2019
88b5e94
Make <*const/mut T>::offset_from `const fn`
oli-obk Aug 20, 2019
c716be6
show up some extra info when t!() fails
Oct 17, 2019
83e97c6
properly document panics in div_euclid and rem_euclid
tspiteri Oct 17, 2019
a4d9492
add option to ping llvm ice-breakers to triagebot
nikomatsakis Oct 17, 2019
5fe88ab
save-analysis: Nest tables when processing impl items
Xanewok Oct 17, 2019
ad6ce46
save-analysis: Add a relevant test case
Xanewok Oct 17, 2019
4e6efe4
reorder fmt docs for more clarity
RalfJung Oct 17, 2019
5487994
Update triagebot.toml
nikomatsakis Oct 17, 2019
c0b7e76
example for padding any format
RalfJung Oct 17, 2019
c9b27d1
doc: make BitSet intro more short
tshepang Oct 17, 2019
5de9cb0
super_ty on MutVisitor is empty so avoid the call
spastorino Oct 7, 2019
e069e9c
Prepare promote_consts MutVisitor to have projections interned
spastorino Oct 7, 2019
591cc9a
Prepare simplify MutVisitor to have projections interned
spastorino Oct 7, 2019
bb7d6d1
Prepare renumber MutVisitor to have projections interned
spastorino Oct 7, 2019
e3e9951
Prepare inline MutVisitor to have projections interned
spastorino Oct 7, 2019
0fc063f
Prepare generator MutVisitor to have projections interned
spastorino Oct 7, 2019
39c9ed3
Prepare erase_regions MutVisitor to have projections interned
spastorino Oct 7, 2019
2b2e35b
Prepare def_use MutVisitor to have projections interned
spastorino Oct 8, 2019
4f2a110
Remove unneeded callback and just use the new_local value
spastorino Oct 8, 2019
7fa3425
Setup a different visit place set of methods for mutable and immutabl…
spastorino Oct 8, 2019
d53fc9c
Add process_* place hooks to improve code reutilization
spastorino Oct 8, 2019
769e75b
Fix left/right shift typo in wrapping rotate docs
t-rapp Oct 18, 2019
9617014
Clarify diagnostics when using `~` as a unary op
JohnTitor Oct 18, 2019
4a51801
Use dedicated method for getting the type size
oli-obk Oct 18, 2019
94a6d4b
Adjust const eval code to reflect `offset_from` docs
oli-obk Oct 18, 2019
4834996
Use Cow to handle modifications of projection in preparation for inte…
spastorino Oct 9, 2019
1c9d889
Review nit
oli-obk Oct 18, 2019
58b17d5
Rollup merge of #63810 - oli-obk:const_offset_from, r=RalfJung,nikic
Centril Oct 18, 2019
33197c7
Rollup merge of #65197 - spastorino:place-mut-visitor-adjusts2, r=oli…
Centril Oct 18, 2019
1e9fd2b
Rollup merge of #65201 - tmiasko:no-bindings, r=rkruppe
Centril Oct 18, 2019
ea6d132
Rollup merge of #65496 - tspiteri:euc-div-panic, r=KodrAus
Centril Oct 18, 2019
28386e6
Rollup merge of #65508 - rust-lang:llvm-icebreakers-ping-1, r=simulacrum
Centril Oct 18, 2019
d08536c
Rollup merge of #65511 - Xanewok:sa-nest-in-impls, r=pnkfelix
Centril Oct 18, 2019
835a359
Rollup merge of #65513 - RalfJung:fmt, r=Mark-Simulacrum
Centril Oct 18, 2019
c4f5203
Rollup merge of #65532 - tshepang:shorten-intro, r=Dylan-DPC
Centril Oct 18, 2019
b85d26a
Rollup merge of #65540 - guanqun:extend-t-macro, r=nikomatsakis
Centril Oct 18, 2019
f8663c4
Rollup merge of #65549 - t-rapp:tr-wrapping-rotate-docs, r=jonas-schi…
Centril Oct 18, 2019
4c317fb
Rollup merge of #65552 - JohnTitor:use-bitwise-not, r=Dylan-DPC
Centril Oct 18, 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
Prev Previous commit
Next Next commit
Prepare promote_consts MutVisitor to have projections interned
  • Loading branch information
spastorino committed Oct 18, 2019
commit e069e9ccacbe92de1c893be5ad77fd5d6173f937
26 changes: 25 additions & 1 deletion src/librustc_mir/transform/promote_consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,10 @@ impl<'a, 'tcx> Promoter<'a, 'tcx> {
});
}

fn is_temp_kind(&self, local: Local) -> bool {
self.source.local_kind(local) == LocalKind::Temp
}

/// Copies the initialization of this temp to the
/// promoted MIR, recursing through temps.
fn promote_temp(&mut self, temp: Local) -> Local {
Expand Down Expand Up @@ -396,10 +400,30 @@ impl<'a, 'tcx> MutVisitor<'tcx> for Promoter<'a, 'tcx> {
local: &mut Local,
_: PlaceContext,
_: Location) {
if self.source.local_kind(*local) == LocalKind::Temp {
if self.is_temp_kind(*local) {
*local = self.promote_temp(*local);
}
}

fn visit_place(
&mut self,
place: &mut Place<'tcx>,
context: PlaceContext,
location: Location,
) {
self.visit_place_base(&mut place.base, context, location);

let new_projection: Vec<_> = place.projection.iter().map(|elem|
match elem {
PlaceElem::Index(local) if self.is_temp_kind(*local) => {
PlaceElem::Index(self.promote_temp(*local))
}
_ => elem.clone(),
}
).collect();

place.projection = new_projection.into_boxed_slice();
}
}

pub fn promote_candidates<'tcx>(
Expand Down
0