about summary refs log tree commit diff
path: root/src/librustc/middle/resolve.rs
AgeCommit message (Collapse)AuthorLines
2014-12-20Split resolve from rustc::middle into rustc_resolve.Eduard Burtescu-6265/+0
2014-12-20rustc: middle: move some types from resolve to privacy.Eduard Burtescu-46/+1
2014-12-20rustc: middle: move TraitItemKind from resolve to def.Eduard Burtescu-21/+0
2014-12-20rustc: middle: move Export and ExportMap from resolve to def.Eduard Burtescu-9/+0
2014-12-20rustc: middle: use cheaper Name in resolve::Export instead of String.Eduard Burtescu-3/+2
2014-12-20rustc: middle: move TraitMap from resolve to ty.Eduard Burtescu-4/+1
2014-12-20rustc: middle: move DefMap from resolve to def.Eduard Burtescu-3/+0
2014-12-20middle: resolve: fix inconsistencies around ExportMap and remove the 2 suffix.Eduard Burtescu-14/+14
2014-12-20rustc: don't allow(non_camel_case_types) in resolve.Eduard Burtescu-7/+6
2014-12-19librustc: use `#[deriving(Copy)]`Jorge Aparicio-51/+19
2014-12-16Path types to associated types with form `T::A`Nick Cameron-11/+33
Closes #18433
2014-12-15auto merge of #19742 : vhbit/rust/copy-for-bitflags, r=alexcrichtonbors-2/+0
2014-12-14Parse `unsafe impl` but don't do anything particularly interesting with the ↵Niko Matsakis-3/+4
results.
2014-12-14Parse `unsafe trait` but do not do anything with it beyond parsing and ↵Niko Matsakis-2/+2
integrating into rustdoc etc.
2014-12-14auto merge of #19338 : nikomatsakis/rust/unboxed-closure-purge-the-proc, ↵bors-10/+3
r=acrichto They are replaced with unboxed closures. cc @pcwalton @aturon This is a [breaking-change]. Mostly, uses of `proc()` simply need to be converted to `move||` (unboxed closures), but in some cases the adaptations required are more complex (particularly for library authors). A detailed write-up can be found here: http://smallcultfollowing.com/babysteps/blog/2014/11/26/purging-proc/ The commits are ordered to emphasize the more important changes, but are not truly standalone.
2014-12-14auto merge of #19690 : barosl/rust/struct-variant-as-a-function-ice, ↵bors-10/+24
r=alexcrichton Unlike a tuple variant constructor which can be called as a function, a struct variant constructor is not a function, so cannot be called. If the user tries to assign the constructor to a variable, an ICE occurs, because there is no way to use it later. So we should stop the constructor from being used like that. A similar mechanism already exists for a normal struct, as it prohibits a struct from being resolved. This commit does the same for a struct variant. This commit also includes some changes to the existing tests. Fixes #19452.
2014-12-14Remove `proc` types/expressions from the parser, compiler, andNiko Matsakis-10/+3
language. Recommend `move||` instead.
2014-12-13librustc: use unboxed closuresJorge Aparicio-15/+29
2014-12-13Add `Copy` to bitflags-generated structuresValerii Hiora-2/+0
2014-12-12Reviewer commentsNick Cameron-2/+2
2014-12-12Mostly non-behaviour-changing changes (style, etc.)Nick Cameron-35/+39
2014-12-12Add support for equality constraints on associated typesNick Cameron-21/+41
2014-12-10Fix an ICE when trying to resolve a struct variantBarosl Lee-10/+24
Unlike a tuple variant constructor which can be called as a function, a struct variant constructor is not a function, so cannot be called. If the user tries to assign the constructor to a variable, an ICE occurs, because there is no way to use it later. So we should stop the constructor from being used like that. A similar mechanism already exists for a normal struct, as it prohibits a struct from being resolved. This commit does the same for a struct variant. This commit also includes some changes to the existing tests. Fixes #19452.
2014-12-08librustc: Make `Copy` opt-in.Niko Matsakis-0/+40
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-12-08auto merge of #19378 : japaric/rust/no-as-slice, r=alexcrichtonbors-5/+5
Now that we have an overloaded comparison (`==`) operator, and that `Vec`/`String` deref to `[T]`/`str` on method calls, many `as_slice()`/`as_mut_slice()`/`to_string()` calls have become redundant. This patch removes them. These were the most common patterns: - `assert_eq(test_output.as_slice(), "ground truth")` -> `assert_eq(test_output, "ground truth")` - `assert_eq(test_output, "ground truth".to_string())` -> `assert_eq(test_output, "ground truth")` - `vec.as_mut_slice().sort()` -> `vec.sort()` - `vec.as_slice().slice(from, to)` -> `vec.slice(from_to)` --- Note that e.g. `a_string.push_str(b_string.as_slice())` has been left untouched in this PR, since we first need to settle down whether we want to favor the `&*b_string` or the `b_string[]` notation. This is rebased on top of #19167 cc @alexcrichton @aturon
2014-12-07Add compile-fail tests for #19498Mukilan Thiyagarajan-2/+3
2014-12-06librustc: remove unnecessary `as_slice()` callsJorge Aparicio-5/+5
2014-12-04Handle conflicting import of items declared in the same moduleMukilan Thiyagarajan-5/+29
Fixes #19498
2014-12-01auto merge of #19405 : jfager/rust/de-match-pyramid, r=bstriebors-185/+114
No semantic changes, no enabling `if let` where it wasn't already enabled.
2014-11-30Adjust some error messages to start with a lowercase letter and not finish ↵P1start-4/+4
with a full stop
2014-11-29Replace some verbose match statements with their `if let` equivalent.jfager-185/+114
No semantic changes, no enabling `if let` where it wasn't already enabled.
2014-11-26rollup merge of #19298: nikomatsakis/unboxed-closure-parse-the-plusAlex Crichton-46/+64
Implements RFC 438. Fixes #19092. This is a [breaking-change]: change types like `&Foo+Send` or `&'a mut Foo+'a` to `&(Foo+Send)` and `&'a mut (Foo+'a)`, respectively. r? @brson
2014-11-26Rote changes due to the fact that ast paths no longer carry this extraneous ↵Niko Matsakis-7/+8
bounds.
2014-11-26Implement the new parsing rules for types in the parser, modifying the AST ↵Niko Matsakis-39/+56
appropriately.
2014-11-25/** -> ///Steve Klabnik-16/+12
This is considered good convention.
2014-11-23Remove type parameters from ExprField and ExprTupFieldAdolfo Ochagavía-8/+4
2014-11-20Rename remaining Failures to PanicSubhash Bhushan-4/+6
2014-11-20auto merge of #19113 : nikomatsakis/rust/unboxed-boxed-closure-unification, ↵bors-9/+4
r=acrichto Use the expected type to infer the argument/return types of unboxed closures. Also, in `||` expressions, use the expected type to decide if the result should be a boxed or unboxed closure (and if an unboxed closure, what kind). This supercedes PR #19089, which was already reviewed by @pcwalton.
2014-11-19Merge the ExprFnBlock and ExprUnboxedClosure into one ExprClosure with an ↵Niko Matsakis-9/+4
optional unboxed closure kind.
2014-11-19Refactor QPath to take an ast::TraitRefNiko Matsakis-59/+4
2014-11-18Convert TyPolyTraitRef to accept arbitary bounds, so that things likeNiko Matsakis-3/+3
`Box<for<'a> Foo<&'a T> + 'a>` can be accepted. Also cleanup the visitor/fold in general, exposing more callbacks.
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-80/+55
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-11-17auto merge of #18914 : Gankro/rust/cloned, r=aturonbors-10/+10
Part of #18424. r? @aturon [breaking-change]
2014-11-16auto merge of #18994 : sfackler/rust/struct-variants-pt2, r=jakub-bors-4/+4
Struct variant field visibility is now inherited. Remove `pub` keywords from declarations. Closes #18641 [breaking-change] r? @alexcrichton
2014-11-16fallout from deprecating find_copy and get_copyAlexis Beingessner-10/+10
2014-11-16Complete the removal of ty_nil, ast::LitNil, ast::TyBot and ast::TyUniqJakub Bukaj-2/+6
[breaking-change] This will break any uses of macros that assumed () being a valid literal.
2014-11-15Un-feature gate struct variantsSteven Fackler-4/+4
Struct variant field visibility is now inherited. Remove `pub` keywords from declarations. Closes #18641 [breaking-change]
2014-11-07Update parser with `for` syntaxNiko Matsakis-7/+23
2014-11-06rollup merge of #18630 : nikomatsakis/purge-the-barsAlex Crichton-40/+5