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

Skip to content

Rollup of 8 pull requests #65534

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 26 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
f04ea6c
Document JSON message output.
ehuss Sep 30, 2019
3b0fd82
Disable Go and OCaml bindings when building LLVM
tmiasko Oct 8, 2019
bcff266
[const-prop] Handle MIR Rvalue::Repeat
wesleywiser Sep 14, 2019
714d00d
[const-prop] Handle MIR Rvalue::Aggregates
wesleywiser Sep 14, 2019
81fa591
[const-prop] Handle MIR Rvalue::Discriminant
wesleywiser Sep 15, 2019
79c5858
[const-prop] Handle MIR Rvalue::Box
wesleywiser Sep 15, 2019
f2afa98
Cleanup const_prop() some
wesleywiser Sep 15, 2019
77f0aaf
Add more coherence tests
weiznich Oct 12, 2019
b6f6dc4
Don't ICE when evaluating writes to uninhabited enum variants
wesleywiser Oct 9, 2019
10236f1
Add long error explanation for E0577
GuillaumeGomez Oct 15, 2019
3d88f2c
Update ui tests
GuillaumeGomez Oct 15, 2019
9123907
Improve comments and structure of `ConstProp::const_prop()`
wesleywiser Oct 13, 2019
83e97c6
properly document panics in div_euclid and rem_euclid
tspiteri Oct 17, 2019
e417180
Update error_codes.rs
Dylan-DPC Oct 17, 2019
a4d9492
add option to ping llvm ice-breakers to triagebot
nikomatsakis 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
0270858
Rollup merge of #64890 - wesleywiser:const_prop_rvalue, r=oli-obk
Centril Oct 18, 2019
2997a58
Rollup merge of #64925 - ehuss:document-json, r=Mark-Simulacrum
Centril Oct 18, 2019
d80e2e1
Rollup merge of #65201 - tmiasko:no-bindings, r=rkruppe
Centril Oct 18, 2019
001f69d
Rollup merge of #65417 - weiznich:more_coherence_tests, r=nikomatsakis
Centril Oct 18, 2019
030ed01
Rollup merge of #65434 - GuillaumeGomez:long-err-explanation-E0577, r…
Centril Oct 18, 2019
be9a8a9
Rollup merge of #65496 - tspiteri:euc-div-panic, r=KodrAus
Centril Oct 18, 2019
9890b1a
Rollup merge of #65508 - rust-lang:llvm-icebreakers-ping-1, r=simulacrum
Centril Oct 18, 2019
575ee19
Rollup merge of #65513 - RalfJung:fmt, r=Mark-Simulacrum
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
[const-prop] Handle MIR Rvalue::Box
  • Loading branch information
wesleywiser committed Oct 11, 2019
commit 79c5858bfd07f90201b91cd10cd3aa9f062377cc
19 changes: 1 addition & 18 deletions src/librustc_mir/transform/const_prop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use rustc::hir::def::DefKind;
use rustc::hir::def_id::DefId;
use rustc::mir::{
AggregateKind, Constant, Location, Place, PlaceBase, Body, Operand, Rvalue,
Local, NullOp, UnOp, StatementKind, Statement, LocalKind,
Local, UnOp, StatementKind, Statement, LocalKind,
TerminatorKind, Terminator, ClearCrossCrate, SourceInfo, BinOp,
SourceScope, SourceScopeLocalData, LocalDecl, BasicBlock,
};
Expand Down Expand Up @@ -434,23 +434,6 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
) -> Option<Const<'tcx>> {
let span = source_info.span;

// if this isn't a supported operation, then return None
match rvalue {
Rvalue::NullaryOp(NullOp::Box, _) => return None,

Rvalue::Use(_) |
Rvalue::Len(_) |
Rvalue::Repeat(..) |
Rvalue::Aggregate(..) |
Rvalue::Discriminant(..) |
Rvalue::Cast(..) |
Rvalue::NullaryOp(..) |
Rvalue::CheckedBinaryOp(..) |
Rvalue::Ref(..) |
Rvalue::UnaryOp(..) |
Rvalue::BinaryOp(..) => { }
}

// perform any special checking for specific Rvalue types
if let Rvalue::UnaryOp(op, arg) = rvalue {
trace!("checking UnaryOp(op = {:?}, arg = {:?})", op, arg);
Expand Down
53 changes: 53 additions & 0 deletions src/test/mir-opt/const_prop/boxes.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// compile-flags: -O

#![feature(box_syntax)]

// Note: this test verifies that we, in fact, do not const prop `box`

fn main() {
let x = *(box 42) + 0;
}

// END RUST SOURCE
// START rustc.main.ConstProp.before.mir
// bb0: {
// ...
// _4 = Box(i32);
// (*_4) = const 42i32;
// _3 = move _4;
// ...
// _2 = (*_3);
// _1 = Add(move _2, const 0i32);
// ...
// drop(_3) -> [return: bb2, unwind: bb1];
// }
// bb1 (cleanup): {
// resume;
// }
// bb2: {
// ...
// _0 = ();
// ...
// }
// END rustc.main.ConstProp.before.mir
// START rustc.main.ConstProp.after.mir
// bb0: {
// ...
// _4 = Box(i32);
// (*_4) = const 42i32;
// _3 = move _4;
// ...
// _2 = (*_3);
// _1 = Add(move _2, const 0i32);
// ...
// drop(_3) -> [return: bb2, unwind: bb1];
// }
// bb1 (cleanup): {
// resume;
// }
// bb2: {
// ...
// _0 = ();
// ...
// }
// END rustc.main.ConstProp.after.mir
0