about summary refs log tree commit diff
path: root/src/librustc_back
AgeCommit message (Collapse)AuthorLines
2014-09-30Desugar 'if let' into the appropriate 'match'Kevin Ballard-0/+1
2014-09-30librustc: Forbid `..` in range patterns.Patrick Walton-1/+1
This breaks code that looks like: match foo { 1..3 => { ... } } Instead, write: match foo { 1...3 => { ... } } Closes #17295. [breaking-change]
2014-09-19Implement slicing syntax.Nick Cameron-0/+2
`expr[]`, `expr[expr..]`, `expr[..expr]`,`expr[expr..expr]` Uses the Slice and SliceMut traits. Allows ... as well as .. in range patterns.
2014-09-16Fallout from renamingAaron Turon-16/+16
2014-09-15remove the closure_exchange_malloc lang itemDaniel Micay-1/+1
2014-09-14auto merge of #17163 : pcwalton/rust/impls-next-to-struct, r=alexcrichtonbors-0/+1
type they provide an implementation for. This breaks code like: mod foo { struct Foo { ... } } impl foo::Foo { ... } Change this code to: mod foo { struct Foo { ... } impl Foo { ... } } Closes #17059. RFC #155. [breaking-change] r? @brson
2014-09-14rustc: fix fallout from using ptr::P.Eduard Burtescu-1/+1
2014-09-13librustc: Forbid inherent implementations that aren't adjacent to thePatrick Walton-0/+1
type they provide an implementation for. This breaks code like: mod foo { struct Foo { ... } } impl foo::Foo { ... } Change this code to: mod foo { struct Foo { ... } impl Foo { ... } } Additionally, if you used the I/O path extension methods `stat`, `lstat`, `exists`, `is_file`, or `is_dir`, note that these methods have been moved to the the `std::io::fs::PathExtensions` trait. This breaks code like: fn is_it_there() -> bool { Path::new("/foo/bar/baz").exists() } Change this code to: use std::io::fs::PathExtensions; fn is_it_there() -> bool { Path::new("/foo/bar/baz").exists() } Closes #17059. RFC #155. [breaking-change]
2014-09-12auto merge of #17134 : vberger/rust/lint_unused_extern_crate, r=alexcrichtonbors-2/+0
This PR creates a new lint : ``unused_extern_crate``, which do pretty much the same thing as ``unused_import``, but for ``extern crate`` statements. It is related to feature request #10385. I adapted the code tracking used imports so that it tracks extern crates usage as well. This was mainly trial and error and while I believe all cases are covered, there might be some code I added that is useless (long compile times didn't give me the opportunity to check this in detail). Also, I removed some unused ``extern crate`` statements from the libs, that where spotted by this new lint.
2014-09-12Track the visited AST's lifetime throughout Visitor.Eduard Burtescu-2/+3
2014-09-12Remove largely unused context from Visitor.Eduard Burtescu-56/+53
2014-09-12Removing unused extern crates.Victor Berger-2/+0
2014-09-10Implement tuple and tuple struct indexingP1start-0/+2
This allows code to access the fields of tuples and tuple structs: let x = (1i, 2i); assert_eq!(x.1, 2); struct Point(int, int); let origin = Point(0, 0); assert_eq!(origin.0, 0); assert_eq!(origin.1, 0);
2014-09-03Fix spelling errors and capitalization.Joseph Crail-1/+1
2014-08-26DST coercions and DST structsNick Cameron-4/+2
[breaking-change] 1. The internal layout for traits has changed from (vtable, data) to (data, vtable). If you were relying on this in unsafe transmutes, you might get some very weird and apparently unrelated errors. You should not be doing this! Prefer not to do this at all, but if you must, you should use raw::TraitObject rather than hardcoding rustc's internal representation into your code. 2. The minimal type of reference-to-vec-literals (e.g., `&[1, 2, 3]`) is now a fixed size vec (e.g., `&[int, ..3]`) where it used to be an unsized vec (e.g., `&[int]`). If you want the unszied type, you must explicitly give the type (e.g., `let x: &[_] = &[1, 2, 3]`). Note in particular where multiple blocks must have the same type (e.g., if and else clauses, vec elements), the compiler will not coerce to the unsized type without a hint. E.g., `[&[1], &[1, 2]]` used to be a valid expression of type '[&[int]]'. It no longer type checks since the first element now has type `&[int, ..1]` and the second has type &[int, ..2]` which are incompatible. 3. The type of blocks (including functions) must be coercible to the expected type (used to be a subtype). Mostly this makes things more flexible and not less (in particular, in the case of coercing function bodies to the return type). However, in some rare cases, this is less flexible. TBH, I'm not exactly sure of the exact effects. I think the change causes us to resolve inferred type variables slightly earlier which might make us slightly more restrictive. Possibly it only affects blocks with unreachable code. E.g., `if ... { fail!(); "Hello" }` used to type check, it no longer does. The fix is to add a semicolon after the string.
2014-08-26Use the slice repr for ~[T]Nick Cameron-6/+0
2014-08-18libsyntax: Remove the `use foo = bar` syntax from the language in favorPatrick Walton-1/+1
of `use bar as foo`. Change all uses of `use foo = bar` to `use bar as foo`. Implements RFC #47. Closes #16461. [breaking-change]
2014-08-15auto merge of #16435 : vadimcn/rust/windows, r=pcwaltonbors-9/+9
Using "win32" to mean "Windows" is confusing, especially now, that Rust supports win64 builds. Let's call spade a spade.
2014-08-14librustc: Stop assuming that implementations and traits only containPatrick Walton-2/+2
methods. This paves the way to associated items by introducing an extra level of abstraction ("impl-or-trait item") between traits/implementations and methods. This new abstraction is encoded in the metadata and used throughout the compiler where appropriate. There are no functional changes; this is purely a refactoring.
2014-08-12Replace all references to "Win32" with "Windows".Vadim Chugunov-9/+9
For historical reasons, "Win32" has been used in Rust codebase to mean "Windows OS in general". This is confusing, especially now, that Rust supports Win64 builds. [breaking-change]
2014-08-07Temporary bootstrapping hack: introduce syntax for r egion bounds like `'b:'a`,Niko Matsakis-2/+2
meaning `'b outlives 'a`. Syntax currently does nothing but is needed for full fix to #5763. To use this syntax, the issue_5763_bootstrap feature guard is required.
2014-08-04rustc: Link entire archives of native librariesAlex Crichton-24/+27
As discovered in #15460, a particular #[link(kind = "static", ...)] line is not actually guaranteed to link the library at all. The reason for this is that if the external library doesn't have any referenced symbols in the object generated by rustc, the entire library is dropped by the linker. For dynamic native libraries, this is solved by passing -lfoo for all downstream compilations unconditionally. For static libraries in rlibs this is solved because the entire archive is bundled in the rlib. The only situation in which this was a problem was when a static native library was linked to a rust dynamic library. This commit brings the behavior of dylibs in line with rlibs by passing the --whole-archive flag to the linker when linking native libraries. On OSX, this uses the -force_load flag. This flag ensures that the entire archive is considered candidate for being linked into the final dynamic library. This is a breaking change because if any static library is included twice in the same compilation unit then the linker will start emitting errors about duplicate definitions now. The fix for this would involve only statically linking to a library once. Closes #15460 [breaking-change]
2014-08-02Rewrite read_u32v_be() and write_u32_be() to make sure that all memory ↵Palmer Cox-15/+17
access is properly aligned
2014-07-31auto merge of #16073 : mneumann/rust/dragonfly2, r=alexcrichtonbors-4/+34
Not included are two required patches: * LLVM: segmented stack support for DragonFly [1] * jemalloc: simple configure patches [1]: http://reviews.llvm.org/D4705
2014-07-29speed up static linking by combining `ar` invocationsStuart Pernsteiner-47/+128
2014-07-29Port Rust to DragonFlyBSDMichael Neumann-4/+34
Not included are two required patches: * LLVM: segmented stack support for DragonFly [1] * jemalloc: simple configure patches [1]: http://reviews.llvm.org/D4705
2014-07-24librustc: Stop desugaring `for` expressions and translate them directly.Patrick Walton-1/+2
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-19Register new snapshotsAlex Crichton-2/+0
2014-07-18librustc: Implement unboxed closures with mutable receiversPatrick Walton-0/+2
2014-07-14Fix rebase fallout. Sorry.Brian Anderson-1/+1
2014-07-14rustc: Move util::sha2 to rustc_backBrian Anderson-2/+685
2014-07-14rustc: Move util::fs to rustc_backBrian Anderson-0/+104
2014-07-14rustc_back: Update crate docsBrian Anderson-1/+14
Indicate that anything that can be extracted here should and that things with syntax deps should be split out someday.
2014-07-14rustc: Move archive to rustc_backBrian Anderson-0/+232
2014-07-14Extract rpath to rustc_back::rpathBrian Anderson-0/+239
2014-07-14Extract librustc_back from librustcBrian Anderson-0/+941