summary refs log tree commit diff
path: root/src/librustc/middle/check_loop.rs
AgeCommit message (Collapse)AuthorLines
2015-09-03Add an intital HIR and lowering stepNick Cameron-11/+11
2015-04-01Fallout out rustcNiko Matsakis-1/+1
2015-02-03Remove the explicit closure kind syntax from the parser and AST;Niko Matsakis-1/+1
upgrade the inference based on expected type so that it is able to infer the fn kind in isolation even if the full signature is not available (and we could perhaps do better still in some cases, such as extracting just the types of the arguments but not the return value).
2015-01-30remove more `ExprForLoop`sJorge Aparicio-4/+0
2015-01-20Add error codes to rustcBrian Anderson-4/+4
2015-01-07use slicing sugarJorge Aparicio-2/+2
2015-01-07Replace full slice notation with index callsNick Cameron-2/+2
2015-01-03sed -i -s 's/#\[deriving(/#\[derive(/g' **/*.rsJorge Aparicio-2/+2
2014-12-21Fallout of std::str stabilizationAlex Crichton-4/+2
2014-12-19librustc: use `#[deriving(Copy)]`Jorge Aparicio-5/+2
2014-12-14Remove `proc` types/expressions from the parser, compiler, andNiko Matsakis-2/+1
language. Recommend `move||` instead.
2014-12-13librustc: use unboxed closuresJorge Aparicio-1/+3
2014-12-08librustc: Make `Copy` opt-in.Niko Matsakis-0/+4
This change makes the compiler no longer infer whether types (structures and enumerations) implement the `Copy` trait (and thus are implicitly copyable). Rather, you must implement `Copy` yourself via `impl Copy for MyType {}`. A new warning has been added, `missing_copy_implementations`, to warn you if a non-generic public type has been added that could have implemented `Copy` but didn't. For convenience, you may *temporarily* opt out of this behavior by using `#![feature(opt_out_copy)]`. Note though that this feature gate will never be accepted and will be removed by the time that 1.0 is released, so you should transition your code away from using it. This breaks code like: #[deriving(Show)] struct Point2D { x: int, y: int, } fn main() { let mypoint = Point2D { x: 1, y: 1, }; let otherpoint = mypoint; println!("{}{}", mypoint, otherpoint); } Change this code to: #[deriving(Show)] struct Point2D { x: int, y: int, } impl Copy for Point2D {} fn main() { let mypoint = Point2D { x: 1, y: 1, }; let otherpoint = mypoint; println!("{}{}", mypoint, otherpoint); } This is the backwards-incompatible part of #13231. Part of RFC #3. [breaking-change]
2014-11-19Merge the ExprFnBlock and ExprUnboxedClosure into one ExprClosure with an ↵Niko Matsakis-3/+2
optional unboxed closure kind.
2014-11-18Move trans, back, driver, and back into a new crate, rustc_trans. Reduces ↵Niko Matsakis-1/+1
memory usage significantly and opens opportunities for more parallel compilation.
2014-11-17Switch to purely namespaced enumsSteven Fackler-0/+1
This breaks code that referred to variant names in the same namespace as their enum. Reexport the variants in the old location or alter code to refer to the new locations: ``` pub enum Foo { A, B } fn main() { let a = A; } ``` => ``` pub use self::Foo::{A, B}; pub enum Foo { A, B } fn main() { let a = A; } ``` or ``` pub enum Foo { A, B } fn main() { let a = Foo::A; } ``` [breaking-change]
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