summary refs log tree commit diff
path: root/src/librustc_mir/transform
AgeCommit message (Collapse)AuthorLines
2017-11-14check_unsafety: fix unused unsafe block duplicationAriel Ben-Yehuda-1/+0
The duplicate error message is later removed by error message deduplication, but it still appears on beta and is still a bug
2017-11-14Backported merge of #45785 - arielb1:unsafe-fixes, r=eddybbors-69/+113
fixes to MIR effectck r? @eddyb beta-nominating because regression (MIR effectck is new)
2017-10-08Auto merge of #45016 - pnkfelix:mir-borrowck-gather-and-signal-move-errors, ↵bors-2/+2
r=nikomatsakis MIR-borrowck: gather and signal any move errors When building up the `MoveData` structure for a given MIR, also accumulate any erroneous actions, and then report all of those errors when the construction is complete. This PR adds a host of move-related error constructor methods to `trait BorrowckErrors`. I think I got the notes right; but we should plan to audit all of the notes before turning MIR-borrowck on by default. Fix #44830
2017-10-04Make newtype_index get debug_name using reflectionSantiago Pastorino-1/+1
2017-10-04Make newtype_index macro use full path to resolve constantsSantiago Pastorino-2/+0
2017-10-04Generate Idx in nll using newtype_index!Santiago Pastorino-15/+3
2017-10-04Convert regions to IndexVecSantiago Pastorino-2/+19
2017-10-04Store a new Region value every time we create a new region variablePaul Faria-2/+11
2017-10-04Auto merge of #44901 - michaelwoerister:on-demand-eval, r=nikomatsakisbors-8/+7
incr.comp.: Switch to red/green change tracking, remove legacy system. This PR finally switches incremental compilation to [red/green tracking](https://github.com/rust-lang/rust/issues/42293) and completely removes the legacy dependency graph implementation -- which includes a few quite costly passes that are simply not needed with the new system anymore. There's still some documentation to be done and there's certainly still lots of optimizing and tuning ahead -- but the foundation for red/green is in place with this PR. This has been in the making for a long time `:)` r? @nikomatsakis cc @alexcrichton, @rust-lang/compiler
2017-10-04mir-borrowck: Gather move errors during MoveData construction and report them.Felix S. Klock II-2/+2
Currently is using DUMMY_SP as the associated span; a follow-up commit will pass in appropriate spans when constructing the errors.
2017-10-03Auto merge of #44896 - qmx:move-resolve-to-librustc, r=arielb1bors-11/+17
Move monomorphize::resolve() to librustc this moves `monomorphize::resolve(..)` to librustc, and re-enables inlining for some trait methods, fixing #44389 @nikomatsakis I've kept the calls to the new `ty::Instance::resolve(....)` always `.unwrap()`-ing for the moment, how/do you want to add more debugging info via `.unwrap_or()` or something like this? we still have some related `resolve_*` functions on monomorphize, but I wasn't sure moving them was into the scope for this PR too. @eddyb mind to take a look too?
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.