about summary refs log tree commit diff
path: root/src/librustc_mir/transform
AgeCommit message (Collapse)AuthorLines
2017-10-02incr.comp.: Re-execute queries during red/green marking in order to find out ↵Michael Woerister-8/+7
their color.
2017-09-29stop using monomorphize::resolve()Douglas Campos-1/+4
2017-09-29take ParamEnv into account when resolvingDouglas Campos-2/+5
2017-09-29make it not to be a methodDouglas Campos-1/+1
2017-09-29always use resolveDouglas Campos-19/+4
2017-09-29re-enable mir inlining across trait methodsDouglas Campos-8/+23
this fixes #44389
2017-09-25Move src/librustc_mir/transform/nll.rs to a subdirectorySimon Sapin-0/+0
2017-09-24remove test code accidentally checked inAriel Ben-Yehuda-10/+0
2017-09-24move unsafety checking to MIRAriel Ben-Yehuda-0/+400
No functional changes intended.
2017-09-24add lint levels to VisibilityScopeAriel Ben-Yehuda-4/+7
2017-09-21Make the fallback of generator resumption be unreachable instead of using returnJohn Kåre Alsaker-10/+11
2017-09-17Remove rustc_bitflags; use the bitflags crateTamir Duberstein-10/+10
2017-09-16Rollup merge of #44560 - qmx:import-TyCtxt, r=eddybAlex Crichton-1/+1
bring TyCtxt into scope got comments both from @eddyb and @nikomatsakis (via https://github.com/rust-lang/rust/pull/44505) that we should always put `TyCtxt` in scope should I just go and import it at other places in the codebase or we just keep doing small improvements?
2017-09-16Auto merge of #43017 - durka:stabilize-const-invocation, r=eddybbors-22/+38
Individualize feature gates for const fn invocation This PR changes the meaning of `#![feature(const_fn)]` so it is only required to declare a const fn but not to call one. Based on discussion at #24111. I was hoping we could have an FCP here in order to move that conversation forward. This sets the stage for future stabilization of the constness of several functions in the standard library (listed below), so could someone please tag the lang team for review. - `std::cell` - `Cell::new` - `RefCell::new` - `UnsafeCell::new` - `std::mem` - `size_of` - `align_of` - `std::ptr` - `null` - `null_mut` - `std::sync` - `atomic` - `Atomic{Bool,Ptr,Isize,Usize}::new` - `once` - `Once::new` - primitives - `{integer}::min_value` - `{integer}::max_value` Some other functions are const but they are also unstable or hidden, e.g. `Unique::new` so they don't have to be considered at this time. After this stabilization, the following `*_INIT` constants in the standard library can be deprecated. I wasn't sure whether to include those deprecations in the current PR. - `std::sync` - `atomic` - `ATOMIC_{BOOL,ISIZE,USIZE}_INIT` - `once` - `ONCE_INIT`
2017-09-14bring TyCtxt into scopeDouglas Campos-1/+1
2017-09-13Fix a bug where StorageIgnored had an incorrect buffer lengthJohn Kåre Alsaker-2/+2
2017-09-13Fix nits and refactor creation of StorageLive blocksJohn Kåre Alsaker-75/+52
2017-09-13Make sure we aren't using dead localsJohn Kåre Alsaker-5/+6
2017-09-13Analyse storage liveness and preserve it during generator transformationJohn Kåre Alsaker-169/+222
2017-09-13honor #[rustc_const_unstable] attributesAlex Burka-22/+38
2017-09-13Auto merge of #44456 - eddyb:stable-drop-const, r=nikomatsakisbors-132/+16
Stabilize drop_types_in_const. Closes #33156, stabilizing the new, revised, rules, and improving the error message. r? @nikomatsakis cc @SergioBenitez
2017-09-12Auto merge of #44275 - eddyb:deferred-ctfe, r=nikomatsakisbors-38/+44
Evaluate fixed-length array length expressions lazily. This is in preparation for polymorphic array lengths (aka `[T; T::A]`) and const generics. We need deferred const-evaluation to break cycles when array types show up in positions which require knowing the array type to typeck the array length, e.g. the array type is in a `where` clause. The final step - actually passing bounds in scope to array length expressions from the parent - is not done because it still produces cycles when *normalizing* `ParamEnv`s, and @nikomatsakis' in-progress lazy normalization work is needed to deal with that uniformly. However, the changes here are still useful to unlock work on const generics, which @EpicatSupercell manifested interest in, and I might be mentoring them for that, but we need this baseline first. r? @nikomatsakis cc @oli-obk
2017-09-11rustc: use ConstVal::Unevaluated instead of mir::Literal::Item.Eduard-Mihai Burtescu-3/+6
2017-09-11rustc: use ty::Const for the length of TyArray.Eduard-Mihai Burtescu-2/+3
2017-09-11rustc: replace usize with u64 and ConstUsize.Eduard-Mihai Burtescu-3/+4
2017-09-11rustc: introduce ty::Const { ConstVal, Ty }.Eduard-Mihai Burtescu-32/+31
2017-09-11rustc: intern ConstVal's in TyCtxt.Eduard-Mihai Burtescu-6/+8
2017-09-11Auto merge of #44383 - qmx:gh/40473/no-inline-trait-method, r=nikomatsakisbors-6/+8
MIR: should not inline trait method Fixes #40473. The idea here is bailing out of inlining if we're talking about a trait method.
2017-09-10Use rvalue promotion to 'static instead of static items.Eduard-Mihai Burtescu-1/+0
2017-09-09Stabilize drop_types_in_const.Eduard-Mihai Burtescu-132/+16
2017-09-09Auto merge of #44212 - eddyb:drop-const, r=nikomatsakisbors-5/+7
Allow Drop types in const's too, with #![feature(drop_types_in_const)]. Implements the remaining amendment, see #33156. cc @SergioBenitez r? @nikomatsakis
2017-09-08simplifyDouglas Campos-9/+1
2017-09-08Auto merge of #44142 - alexcrichton:dllimport-query, r=nikomatsakisbors-6/+6
Migrate a slew of metadata methods to queries This PR intends to make more progress on #41417, knocking off some low-hanging fruit. Closes #44190 cc #44137
2017-09-07Auto merge of #44249 - pnkfelix:debugflag-emit-end-regions, r=arielb1bors-1/+3
Debugflag: -Z emit-end-regions Skip EndRegion emission by default. Use `-Z emit-end-regions` to reenable it. The main intent is to fix cases where `EndRegion` emission is believed to be causing excess peak memory pressure. It may also be a welcome change to people inspecting the MIR output who find the EndRegions to be a distraction. (In later follow-up PR's I will put in safe-guards against using the current mir-borrowck without enabling `EndRegion` emission. But I wanted this PR to be minimal, in part because we may wish to backport it to the beta channel if we find that it reduces peak memory usage significantly.)
2017-09-06ugly, but works!Douglas Campos-6/+16
2017-09-06Reintroduce the early returnsOliver Schneider-4/+9
2017-09-06Fix a bug in the inlinerOliver Schneider-1/+2
2017-09-05rustc: Store InternedString in `DefPathData`Alex Crichton-1/+1
Previously a `Symbol` was stored there, but this ended up causing hash collisions in situations that otherwise shouldn't have a hash collision. Only the symbol's string value was hashed, but it was possible for distinct symbols to have the same string value, fooling various calcuations into thinking that these paths *didn't* need disambiguating data when in fact they did! By storing `InternedString` instead we're hopefully triggering all the exising logic to disambiguate paths with same-name `Symbol` but actually distinct locations.
2017-09-05rustc: Migrate lang items to a queryAlex Crichton-5/+5
This commit moves the calculation of the `LanguageItems` structure into a query rather than being calculated before the `TyCtxt` exists, with the eventual end goal of removing some `CrateStore` methods.
2017-09-05Emit `EndRegion` statements when given `-Z mir-emit-validate=N` (for N > 0).Felix S. Klock II-1/+1
This way the miri test suite does not have to be updated to explcitly request `-Z emit-end-regions`.
2017-09-05Skip EndRegion emission by default. Use `-Z emit-end-regions` to reenable it.Felix S. Klock II-1/+3
The main intent is to fix cases where EndRegion emission is believed to be causing excess peak memory pressure. It may also be a welcome change to people inspecting the MIR output who find the EndRegions to be a distraction.
2017-09-04rustc_mir: use Local instead of Lvalue in Storage{Live,Dead}.Eduard-Mihai Burtescu-23/+9
2017-09-03rustc_mir: use Local in ProjectionElem::Index.Eduard-Mihai Burtescu-4/+3
2017-09-03rustc_mir: implement visit_local instead/along visit_lvalue where possible.Eduard-Mihai Burtescu-119/+120
2017-09-03Auto merge of #44253 - eddyb:nice-scope, r=nikomatsakisbors-7/+7
rustc: rename CodeExtent to Scope and RegionMaps to ScopeTree. r? @nikomatsakis
2017-09-02Allow Drop types in const's too, with #![feature(drop_types_in_const)].Eduard-Mihai Burtescu-5/+7
2017-09-02rustc_mir: actually "promote" constants' MIR to 'static by removing ↵Eduard-Mihai Burtescu-25/+80
StorageDead's.
2017-09-01rustc: rename CodeExtent to Scope and RegionMaps to ScopeTree.Eduard-Mihai Burtescu-7/+7
2017-08-30Auto merge of #43932 - eddyb:const-scoping, r=nikomatsakisbors-8/+63
Forward-compatibly deny drops in constants if they *could* actually run. This is part of #40036, specifically the checks for user-defined destructor invocations on locals which *may not* have been moved away, the motivating example being: ```rust const FOO: i32 = (HasDrop {...}, 0).1; ``` The evaluation of constant MIR will continue to create `'static` slots for more locals than is necessary (if `Storage{Live,Dead}` statements are ignored), but it shouldn't be misusable. r? @nikomatsakis
2017-08-28rustc: treat impl associated consts like const items for constness.Eduard-Mihai Burtescu-3/+8