about summary refs log tree commit diff
path: root/src/librustc/cfg/construct.rs
AgeCommit message (Collapse)AuthorLines
2018-05-15Remove hir::ScopeTargetest31-9/+5
When we want to implement label-break-value, we can't really decide whether to emit ScopeTarget::Loop or ScopeTarget::Block in the code that is supposed to create it. So we get rid of it and reconstruct the information when needed.
2018-04-12AST/HIR: Merge field access expressions for named and numeric fieldsVadim Petrochenkov-1/+0
2018-03-28Remove adjacent all-const match arm hack.Felix S. Klock II-34/+8
An old fix for moves-in-guards had a hack for adjacent all-const match arms. The hack was explained in a comment, which you can see here: https://github.com/rust-lang/rust/pull/22580/files#diff-402a0fa4b3c6755c5650027c6d4cf1efR497 But hack was incomplete (and thus unsound), as pointed out here: https://github.com/rust-lang/rust/issues/47295#issuecomment-357108458 Plus, it is likely to be at least tricky to reimplement this hack in the new NLL borrowck. So rather than try to preserve the hack, we want to try to just remove it outright. (At least to see the results of a crater run.) [breaking-change] This is a breaking-change, but our hope is that no one is actually relying on such an extreme special case. (We hypothesize the hack was originally added to accommodate a file in our own test suite, not code in the wild.)
2017-09-01rustc: rename CodeExtent to Scope and RegionMaps to ScopeTree.Eduard-Mihai Burtescu-8/+8
2017-09-01rustc: use hir::ItemLocalId instead of ast::NodeId in CodeExtent.Eduard-Mihai Burtescu-4/+6
2017-09-01rustc: use hir::ItemLocalId instead of ast::NodeId in CFG.Eduard-Mihai Burtescu-45/+44
2017-07-28Remove support for `gen arg`Alex Crichton-1/+0
2017-07-28Rename suspend to yieldJohn Kåre Alsaker-1/+1
2017-07-28Generator literal supportJohn Kåre Alsaker-0/+2
2017-07-05use field init shorthand in src/librustcZack M. Davis-6/+6
The field init shorthand syntax was stabilized in 1.17.0 (aebd94f); we are now free to use it in the compiler.
2017-06-01rustc: replace method_map with Def::Method and node_substs entries.Eduard-Mihai Burtescu-2/+2
2017-06-01rustc: avoid using MethodCallee's signature where possible.Eduard-Mihai Burtescu-6/+1
2017-06-01rustc: keep overloaded autoderef MethodCallee's in Adjust.Eduard-Mihai Burtescu-2/+1
2017-05-13rustc: stop interning CodeExtent, it's small enough.Eduard-Mihai Burtescu-2/+3
2017-04-30introduce per-fn RegionMapsTaylor Cramer-1/+5
Instead of requesting the region maps for the entire crate, request for a given item etc. Several bits of code were modified to take `&RegionMaps` as input (e.g., the `resolve_regions_and_report_errors()` function). I am not totally happy with this setup -- I *think* I'd rather have the region maps be part of typeck tables -- but at least the `RegionMaps` works in a "parallel" way to `FreeRegionMap`, so it's not too bad. Given that I expect a lot of this code to go away with NLL, I didn't want to invest *too* much energy tweaking it.
2017-04-30intern CodeExtentsNiko Matsakis-3/+3
Make a `CodeExtent<'tcx>` be something allocated in an arena instead of an index into the `RegionMaps`.
2017-04-30On-demandify region mappingTaylor Cramer-4/+4
2017-04-24rustc: rename some of the queries to match tcx methods.Eduard-Mihai Burtescu-1/+1
2017-03-30refactor the `targeted_by_break` fieldNiko Matsakis-2/+2
In master, this field was an arbitrary node-id (in fact, an id for something that doesn't even exist in the HIR -- the `catch` node). Breaks targeting this block used that id. In the newer system, this field is a boolean, and any breaks targeted this block will use the id of the block.
2017-03-30refactor if so that the "then type" is an expressionNiko Matsakis-2/+2
2017-03-17Add more catch-related CFG and lifetime tests and fix CFG bugTaylor Cramer-1/+1
2017-03-17Implement ? in catch expressions and add testsTaylor Cramer-22/+72
2017-03-13some style fixesTshepang Lekhonkhobe-17/+15
2017-02-28remove special-case code for statics and just use `borrowck_fn`Niko Matsakis-14/+6
Fixes #38520
2017-02-18Rename hir::Label to hir::DestinationTaylor Cramer-6/+6
2017-02-18Properly implement labeled breaks in while conditionsTaylor Cramer-7/+22
2017-02-17Normalize labeled and unlabeled breaksTaylor Cramer-10/+5
2017-01-26rustc: rename TyCtxt's `map` field to `hir`.Eduard-Mihai Burtescu-3/+3
2017-01-25rename `Tables` to `TypeckTables`Niko Matsakis-1/+1
2017-01-06rustc: keep track of tables everywhere as if they were per-body.Eduard-Mihai Burtescu-5/+19
2016-12-28rustc: separate bodies for static/(associated)const and embedded constants.Eduard-Mihai Burtescu-5/+2
2016-11-28rustc: embed path resolutions into the HIR instead of keeping DefMap.Eduard-Mihai Burtescu-18/+9
2016-11-28rustc: desugar UFCS as much as possible during HIR lowering.Eduard Burtescu-2/+2
2016-11-21Implement the `loop_break_value` feature.Geoffry Song-3/+4
This implements RFC 1624, tracking issue #37339. - `FnCtxt` (in typeck) gets a stack of `LoopCtxt`s, which store the currently deduced type of that loop, the desired type, and a list of break expressions currently seen. `loop` loops get a fresh type variable as their initial type (this logic is stolen from that for arrays). `while` loops get `()`. - `break {expr}` looks up the broken loop, and unifies the type of `expr` with the type of the loop. - `break` with no expr unifies the loop's type with `()`. - When building MIR, `loop` loops no longer construct a `()` value at termination of the loop; rather, the `break` expression assigns the result of the loop. `while` loops are unchanged. - `break` respects contexts in which expressions may not end with braced blocks. That is, `while break { break-value } { while-body }` is illegal; this preserves backwards compatibility. - The RFC did not make it clear, but I chose to make `break ()` inside of a `while` loop illegal, just in case we wanted to do anything with that design space in the future. This is my first time dealing with this part of rustc so I'm sure there's plenty of problems to pick on here ^_^
2016-11-22Change HirVec<P<T>> to HirVec<T> in Expr.Nicholas Nethercote-6/+6
This changes structures like this: ``` [ ExprArray | 8 | P ] | v [ P | P | P | P | P | P | P | P ] | v [ ExprTup | 2 | P ] | v [ P | P ] | v [ Expr ] ``` to this: ``` [ ExprArray | 8 | P ] | v [ [ ExprTup | 2 | P ] | ... ] | v [ Expr | Expr ] ```
2016-11-10rustc: use an Expr instead of a Block for function bodies.Eduard Burtescu-6/+6
2016-11-02rustc: record the target type of every adjustment.Eduard Burtescu-1/+1
2016-11-02rustc: make all read access to tcx.tables go through a method.Eduard Burtescu-3/+3
2016-10-31Changed most vec! invocations to use square bracesiirelu-3/+3
Most of the Rust community agrees that the vec! macro is clearer when called using square brackets [] instead of regular brackets (). Most of these ocurrences are from before macros allowed using different types of brackets. There is one left unchanged in a pretty-print test, as the pretty printer still wants it to have regular brackets.
2016-09-28Call arrays "arrays" instead of "vecs" internallyJonas Schievink-2/+2
2016-09-04Replace `_, _` with `..`Vadim Petrochenkov-3/+3
2016-08-13Rename empty/bang to neverAndrew Cann-1/+2
Split Ty::is_empty method into is_never and is_uninhabited
2016-08-13Remove obsolete divergence related stuffAndrew Cann-1/+1
Replace FnOutput with Ty Replace FnConverging(ty) with ty Purge FnDiverging, FunctionRetTy::NoReturn and FunctionRetTy::None
2016-08-13Switch on TyEmptyAndrew Cann-1/+1
Parse -> ! as FnConverging(!) Add AdjustEmptyToAny coercion to all ! expressions Some fixes
2016-07-08Merge PatKind::QPath into PatKind::Path in HIRVadim Petrochenkov-1/+0
2016-06-10Introduce TyCtxt::expect_def/expect_resolution helpers and use them where ↵Vadim Petrochenkov-2/+2
possible
2016-05-28Refactor away some functions from hir::pat_utilVadim Petrochenkov-2/+1
2016-05-28Separate bindings from other patterns in HIRVadim Petrochenkov-2/+2
2016-05-26Implement `..` in tuple (struct) patternsVadim Petrochenkov-3/+2
2016-05-16Remove hir::IdentVadim Petrochenkov-2/+2