about summary refs log tree commit diff
path: root/src/libsyntax/ast_util.rs
AgeCommit message (Collapse)AuthorLines
2015-03-05Remove integer suffixes where the types in compiled code are identical.Eduard Burtescu-8/+8
2015-02-26remove some compiler warningsTshepang Lekhonkhobe-4/+4
2015-02-24Implement `<T>::method` UFCS expression syntax.Eduard Burtescu-1/+1
2015-02-24syntax: don't use TraitRef in QPath.Eduard Burtescu-2/+7
2015-02-24syntax: don't store a secondary NodeId for TyPath.Eduard Burtescu-3/+0
2015-02-22Add support for default trait impls in libsyntaxFlavio Percoco-2/+6
2015-02-18rollup merge of #22502: nikomatsakis/deprecate-bracket-bracketAlex Crichton-3/+3
Conflicts: src/libcollections/slice.rs src/libcollections/str.rs src/librustc/middle/lang_items.rs src/librustc_back/rpath.rs src/librustc_typeck/check/regionck.rs src/libstd/ffi/os_str.rs src/libsyntax/diagnostic.rs src/libsyntax/parse/parser.rs src/libsyntax/util/interner.rs src/test/run-pass/regions-refcell.rs
2015-02-18Replace all uses of `&foo[]` with `&foo[..]` en masse.Niko Matsakis-3/+3
2015-02-18Tweak pretty printing.Niko Matsakis-8/+2
2015-02-06Libsyntax has been updatedGuillaumeGomez-2/+1
2015-02-06Replace the get method by the deref one on InternedStringGuillaumeGomez-1/+2
2015-02-02rollup merge of #21830: japaric/for-cleanupAlex Crichton-6/+6
Conflicts: src/librustc/metadata/filesearch.rs src/librustc_back/target/mod.rs src/libstd/os.rs src/libstd/sys/windows/os.rs src/libsyntax/ext/tt/macro_parser.rs src/libsyntax/print/pprust.rs src/test/compile-fail/issue-2149.rs
2015-02-02rollup merge of #21817: edwardw/symmetric-binopAlex Crichton-0/+14
For "symmetric" binary operators, meaning the types of two sides must be equal, if the type of LHS doesn't know yet but RHS does, use that as an hint to infer LHS' type. Closes #21634
2015-02-02`for x in xs.iter()` -> `for x in &xs`Jorge Aparicio-6/+6
2015-02-02Omit integer suffix when unnecessaryAlfie John-10/+10
See PR # 21378 for context
2015-02-01Make use of a binary operator's RHS type for LHS inferenceEdward Wang-0/+14
For "symmetric" binary operators, meaning the types of two side must be equal, if the type of LHS doesn't know yet but RHS does, use that as an hint to infer LHS' type. Closes #21634
2015-01-29Auto merge of #21677 - japaric:no-range, r=alexcrichtonbors-1/+1
Note: Do not merge until we get a newer snapshot that includes #21374 There was some type inference fallout (see 4th commit) because type inference with `a..b` is not as good as with `range(a, b)` (see #21672). r? @alexcrichton
2015-01-29s/Show/Debug/gJorge Aparicio-1/+1
2015-01-28Simplify the implementation of segments_name_eq.Ms2ger-14/+7
2015-01-25Add the span of the operator itself to ast::BinOp.Huon Wilson-6/+6
2015-01-22Fix some grammar inconsistencies for the '..' range notation.Daniel Grunwald-2/+1
Grammar changes: * allow 'for _ in 1..i {}' (fixes #20241) * allow 'for _ in 1.. {}' as infinite loop * prevent use of range notation in contexts where only operators of high precedence are expected (fixes #20811) Parser code cleanup: * remove RESTRICTION_NO_DOTS * make AS_PREC const and follow naming convention * make min_prec inclusive
2015-01-21rollup merge of #20179: eddyb/blind-itemsAlex Crichton-65/+17
Conflicts: src/librustc/diagnostics.rs src/librustdoc/clean/mod.rs src/librustdoc/html/format.rs src/libsyntax/parse/parser.rs
2015-01-21syntax: fix fallout of merging ast::ViewItem into ast::Item.Eduard Burtescu-65/+17
2015-01-18libsyntax: 0u -> 0us, 0i -> 0isPaul Collier-9/+9
2015-01-17libsyntax: uint types to usizePaul Collier-3/+3
2015-01-08Store deprecated status of i/u-suffixed literals.Huon Wilson-6/+10
2015-01-07rollup merge of #20721: japaric/snapAlex Crichton-11/+11
Conflicts: src/libcollections/vec.rs src/libcore/fmt/mod.rs src/librustc/lint/builtin.rs src/librustc/session/config.rs src/librustc_trans/trans/base.rs src/librustc_trans/trans/context.rs src/librustc_trans/trans/type_.rs src/librustc_typeck/check/_match.rs src/librustdoc/html/format.rs src/libsyntax/std_inject.rs src/libsyntax/util/interner.rs src/test/compile-fail/mut-pattern-mismatched.rs
2015-01-08RFC 558: Require parentheses for chained comparisonsDaniel Grunwald-2/+8
Fixes #20724.
2015-01-07use slicing sugarJorge Aparicio-11/+11
2015-01-06rollup merge of #20609: cmr/memAlex Crichton-6/+6
2015-01-06test fallout from isize/usizeCorey Richardson-2/+2
2015-01-07Replace full slice notation with index callsNick Cameron-7/+7
2015-01-06syntax/rustc: implement isize/usizeCorey Richardson-6/+6
2015-01-05Change `&` pat to only work with &T, and `&mut` with &mut T.Huon Wilson-1/+1
This implements RFC 179 by making the pattern `&<pat>` require matching against a variable of type `&T`, and introducing the pattern `&mut <pat>` which only works with variables of type `&mut T`. The pattern `&mut x` currently parses as `&(mut x)` i.e. a pattern match through a `&T` or a `&mut T` that binds the variable `x` to have type `T` and to be mutable. This should be rewritten as follows, for example, for &mut x in slice.iter() { becomes for &x in slice.iter() { let mut x = x; Due to this, this is a [breaking-change] Closes #20496.
2015-01-03sed -i -s 's/#\[deriving(/#\[derive(/g' **/*.rsJorge Aparicio-1/+1
2014-12-31syntax: unbox closures used in function argumentsJorge Aparicio-25/+29
2014-12-22rollup merge of #20033: alexcrichton/deprecate-serialiseAlex Crichton-1/+1
This commit completes the deprecation story for the in-tree serialization library. The compiler will now emit a warning whenever it encounters `deriving(Encodable)` or `deriving(Decodable)`, and the library itself is now marked `#[unstable]` for when feature staging is enabled. All users of serialization can migrate to the `rustc-serialize` crate on crates.io which provides the exact same interface as the libserialize library in-tree. The new deriving modes are named `RustcEncodable` and `RustcDecodable` and require `extern crate "rustc-serialize" as rustc_serialize` at the crate root in order to expand correctly. To migrate all crates, add the following to your `Cargo.toml`: [dependencies] rustc-serialize = "0.1.1" And then add the following to your crate root: extern crate "rustc-serialize" as rustc_serialize; Finally, rename `Encodable` and `Decodable` deriving modes to `RustcEncodable` and `RustcDecodable`. [breaking-change]
2014-12-22serialize: Fully deprecate the libraryAlex Crichton-1/+1
This commit completes the deprecation story for the in-tree serialization library. The compiler will now emit a warning whenever it encounters `deriving(Encodable)` or `deriving(Decodable)`, and the library itself is now marked `#[unstable]` for when feature staging is enabled. All users of serialization can migrate to the `rustc-serialize` crate on crates.io which provides the exact same interface as the libserialize library in-tree. The new deriving modes are named `RustcEncodable` and `RustcDecodable` and require `extern crate "rustc-serialize" as rustc_serialize` at the crate root in order to expand correctly. To migrate all crates, add the following to your `Cargo.toml`: [dependencies] rustc-serialize = "0.1.1" And then add the following to your crate root: extern crate "rustc-serialize" as rustc_serialize; Finally, rename `Encodable` and `Decodable` deriving modes to `RustcEncodable` and `RustcDecodable`. [breaking-change]
2014-12-21Fallout of std::str stabilizationAlex Crichton-7/+7
2014-12-19libsyntax: use `#[deriving(Copy)]`Jorge Aparicio-3/+1
2014-12-18syntax/ast_util: add `is_by_value_unop()`Jorge Aparicio-1/+9
2014-12-18librustc: Always parse `macro!()`/`macro![]` as expressions if notPatrick Walton-10/+14
followed by a semicolon. This allows code like `vec![1i, 2, 3].len();` to work. This breaks code that uses macros as statements without putting semicolons after them, such as: fn main() { ... assert!(a == b) assert!(c == d) println(...); } It also breaks code that uses macros as items without semicolons: local_data_key!(foo) fn main() { println("hello world") } Add semicolons to fix this code. Those two examples can be fixed as follows: fn main() { ... assert!(a == b); assert!(c == d); println(...); } local_data_key!(foo); fn main() { println("hello world") } RFC #378. Closes #18635. [breaking-change]
2014-12-15auto merge of #19448 : japaric/rust/binops-by-value, r=nikomatsakisbors-0/+10
- The following operator traits now take their arguments by value: `Add`, `Sub`, `Mul`, `Div`, `Rem`, `BitAnd`, `BitOr`, `BitXor`, `Shl`, `Shr`. This breaks all existing implementations of these traits. - The binary operation `a OP b` now "desugars" to `OpTrait::op_method(a, b)` and consumes both arguments. - `String` and `Vec` addition have been changed to reuse the LHS owned value, and to avoid internal cloning. Only the following asymmetric operations are available: `String + &str` and `Vec<T> + &[T]`, which are now a short-hand for the "append" operation. [breaking-change] --- This passes `make check` locally. I haven't touch the unary operators in this PR, but converting them to by value should be very similar to this PR. I can work on them after this gets the thumbs up. @nikomatsakis r? the compiler changes @aturon r? the library changes. I think the only controversial bit is the semantic change of the `Vec`/`String` `Add` implementation. cc #19148
2014-12-14Rename FnStyle trait to Unsafety.Niko Matsakis-4/+4
2014-12-13syntax/ast_util: add `is_by_value_binop()`Jorge Aparicio-0/+10
2014-12-13libsyntax: use unboxed closuresJorge Aparicio-5/+6
2014-12-12Add support for equality constraints on associated typesNick Cameron-0/+16
2014-12-08librustc: Make `Copy` opt-in.Niko Matsakis-0/+2
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-29Replace some verbose match statements with their `if let` equivalent.jfager-12/+7
No semantic changes, no enabling `if let` where it wasn't already enabled.
2014-11-26rollup merge of #19329: steveklabnik/doc_style_cleanup2Alex Crichton-5/+1