summary refs log tree commit diff
path: root/src/librustc/middle/check_loop.rs
AgeCommit message (Collapse)AuthorLines
2014-09-12Track the visited AST's lifetime throughout Visitor.Eduard Burtescu-1/+1
2014-09-12Remove largely unused context from Visitor.Eduard Burtescu-16/+24
2014-08-29Fix formatting, update copyright datesPythoner6-1/+1
2014-08-29Add support for labeled while loops.Pythoner6-1/+1
2014-08-14librustc: Tie up loose ends in unboxed closures.Patrick Walton-1/+1
This patch primarily does two things: (1) it prevents lifetimes from leaking out of unboxed closures; (2) it allows unboxed closure type notation, call notation, and construction notation to construct closures matching any of the three traits. This breaks code that looked like: let mut f; { let x = &5i; f = |&mut:| *x + 10; } Change this code to avoid having a reference escape. For example: { let x = &5i; let mut f; // <-- move here to avoid dangling reference f = |&mut:| *x + 10; } I believe this is enough to consider unboxed closures essentially implemented. Further issues (for example, higher-rank lifetimes) should be filed as followups. Closes #14449. [breaking-change]
2014-08-13librustc: Parse, but do not fully turn on, the `ref` keyword forPatrick Walton-2/+2
by-reference upvars. This partially implements RFC 38. A snapshot will be needed to turn this on, because stage0 cannot yet parse the keyword. Part of #12381.
2014-07-24librustc: Stop desugaring `for` expressions and translate them directly.Patrick Walton-0/+4
This makes edge cases in which the `Iterator` trait was not in scope and/or `Option` or its variants were not in scope work properly. This breaks code that looks like: struct MyStruct { ... } impl MyStruct { fn next(&mut self) -> Option<int> { ... } } for x in MyStruct { ... } { ... } Change ad-hoc `next` methods like the above to implementations of the `Iterator` trait. For example: impl Iterator<int> for MyStruct { fn next(&mut self) -> Option<int> { ... } } Closes #15392. [breaking-change]
2014-07-18librustc: Implement unboxed closures with mutable receiversPatrick Walton-1/+3
2014-06-11rustc: Move the AST from @T to Gc<T>Alex Crichton-7/+7
2014-05-30std: Rename {Eq,Ord} to Partial{Eq,Ord}Alex Crichton-1/+1
This is part of the ongoing renaming of the equality traits. See #12517 for more details. All code using Eq/Ord will temporarily need to move to Partial{Eq,Ord} or the Total{Eq,Ord} traits. The Total traits will soon be renamed to {Eq,Ord}. cc #12517 [breaking-change]
2014-05-22libstd: Remove `~str` from all `libstd` modules except `fmt` and `str`.Patrick Walton-2/+6
2014-04-05rustc: move the check_loop pass earlier.Huon Wilson-8/+6
This pass is purely AST based, and by running it earlier we emit more useful error messages, e.g. type inference fails in the case of `let r = break;` with few constraints on `r`, but its more useful to be told that the `break` is outside a loop (rather than a type error) when it is. Closes #13292.
2014-03-17De-@ ty::ctxt usage.Eduard Burtescu-5/+5
2014-02-13Replace `crate` usage with `krate`Flavio Percoco-2/+2
This patch replaces all `crate` usage with `krate` before introducing the new keyword. This ensures that after introducing the keyword, there won't be any compilation errors. krate might not be the most expressive substitution for crate but it's a very close abbreviation for it. `module` was already used in several places already.
2014-01-09libsyntax: Renamed types, traits and enum variants to CamelCase.Eduard Burtescu-1/+1
2014-01-06Disowned the Visitor.Eduard Burtescu-2/+2
2013-12-18rustc: Allow `return` to return from a closure.Huon Wilson-6/+0
With the old `for` gone, this behaviour is no longer conflicting with that use of `return` in closures, and this allows shortcircuiting in a closure.
2013-12-01Box Block, fn_decl, variant and Ty in the AST, as they were inflating ↵Eduard Burtescu-3/+3
critical enum sizes.
2013-11-12Improve error message for breaks in blocksAlex Crichton-43/+43
Before it was always stated that it was a "break outside of a loop" when you could very well be in a loop, but just in a block instead. Closes #3064
2013-10-29librustc: Implement the `proc` type as sugar for `~once fn` and `proc`Patrick Walton-1/+1
notation for closures, and disable the feature gate for `once fn` if used with the `~` sigil.
2013-09-03Modernized a few more types in syntax::astMarvin Löbel-7/+7
2013-08-15Ported check_loop from oldvisit to <V:Visit> trait API.Felix S. Klock II-24/+30
2013-08-04fix warning still mentioning the `again` keywordDaniel Micay-1/+1
2013-08-04rm obsolete `for` support from the compilerDaniel Micay-8/+0
2013-08-02librustc: Introduce a new visitor type based on traits and port syntax to it.Patrick Walton-9/+9
This is preparation for removing `@fn`. This does *not* use default methods yet, because I don't know whether they work. If they do, a forthcoming PR will use them. This also changes the precedence of `as`.
2013-07-22Ast spanned<T> refactoring, renaming: crate, local, blk, crate_num, crate_cfg.Michael Woerister-1/+1
`crate => Crate` `local => Local` `blk => Block` `crate_num => CrateNum` `crate_cfg => CrateConfig` Also, Crate and Local are not wrapped in spanned<T> anymore.
2013-07-17librustc: Remove all uses of "copy".Patrick Walton-0/+1
2013-06-27Remove many shared pointersPhilipp Brüschweiler-1/+1
Mostly just low-haning fruit, i.e. function arguments that were @ even though & would work just as well. Reduces librustc.so size by 200k when compiling without -O, by 100k when compiling with -O.
2013-06-12Visitor refactoring: Step 1, couple (Env, vt<Env>) together in a tuple.Felix S. Klock II-15/+15
2013-05-02Use static stringsSeo Sanghyeon-3/+3
2013-04-19rustc: de-mode + fallout from libsyntax changesAlex Crichton-1/+1
2013-03-02librustc: Stop parsing `fn@`, `fn~`, and `fn&`Patrick Walton-6/+0
2013-02-25libsyntax: progress on making syntax::visit vecs_implicitly_copyable-freeErick Tryzelaar-5/+5
2013-02-20librustc: tidyLuqman Aden-1/+1
2013-02-20librustc: Get rid of structural records save for front/test.rs.Luqman Aden-9/+24
2013-02-07Make ~fn non-copyable, make &fn copyable, split barefn/closure types,Niko Matsakis-2/+2
correct handling of moves for struct-record update. Part of #3678. Fixes #2828, #3904, #4719.
2013-01-31Workaround for #4717: pad contents of ast. rs=breakageNiko Matsakis-1/+1
2013-01-31Finalize moves-based-on-type implementation.Niko Matsakis-3/+3
Changes: - Refactor move mode computation - Removes move mode arguments, unary move, capture clauses (though they still parse for backwards compatibility) - Simplify how moves are handled in trans - Fix a number of illegal copies that cropped up - Workaround for bug involving def-ids in params (see details below) Future work (I'll open bugs for these...): - Improve error messages for moves that are due to bindings - Add support for moving owned content like a.b.c to borrow check, test in trans (but I think it'll "just work") - Proper fix for def-ids in params Def ids in params: Move captures into a map instead of recomputing. This is a workaround for a larger bug having to do with the def-ids associated with ty_params, which are not always properly preserved when inlining. I am not sure of my preferred fix for the larger bug yet. This current fix removes the only code in trans that I know of which relies on ty_param def-ids, but feels fragile.
2013-01-30librustc: De-export rustc. rs=deexportingPatrick Walton-2/+2
2013-01-20convert ast::expr into a structErick Tryzelaar-1/+1
2013-01-09A collection of refactorings that I found it hard/tiresome to divide:Niko Matsakis-1/+1
- Make `extern fn()` assignable to any closure type, rather than a subtype. - Remove unused int_ty_set and float_ty_set - Refactor variable unification and make it more DRY - Do fn sub/lub/glb on the level of fn_sig - Rename infer::to_str::ToStr to infer::to_str::InferStr - Capitalize names of various types - Correct hashing of FnMeta - Convert various records-of-fns into structs-of-fns. This is both eliminating use of deprecated features and more forwards compatible with fn reform. r=pcwalton
2013-01-07librustc: Make vectors no longer implicitly copyable in rustc. r=graydonPatrick Walton-0/+1
~20% perf win for trans on -O0, with other minor improvements across the board. No effect on -O2.
2012-12-27librustc: Terminate name searches at the nearest module scope for paths that ↵Patrick Walton-0/+2
contain at least two components. r=graydon
2012-12-04librustc: Remove all legacy pattern bindings from libsyntax and librustc. ↵Patrick Walton-8/+8
rs=refactoring
2012-12-03Update license, add license boilerplate to most files. Remainder will follow.Graydon Hoare-0/+10
2012-11-29librustc: Eliminate most expressions of the form `a.b()` that are not method ↵Patrick Walton-6/+8
calls. rs=refactoring
2012-11-07Rename src/rustc to src/librustc. Use the driver crateBrian Anderson-0/+52