summary refs log tree commit diff
path: root/src/libsyntax/ast_util.rs
AgeCommit message (Collapse)AuthorLines
2015-06-11Conver reborrows to .iter() calls where appropriateJoshua Landau-1/+1
2015-06-10Removed many pointless calls to *iter() and iter_mut()Joshua Landau-1/+1
2015-05-21Make various fixes:Niko Matsakis-2/+1
- add feature gate - add basic tests - adjust parser to eliminate conflict between `const fn` and associated constants - allow `const fn` in traits/trait-impls, but forbid later in type check - correct some merge conflicts
2015-05-21syntax: parse `const fn` for free functions and inherent methods.Eduard Burtescu-0/+1
2015-04-27Auto merge of #23606 - quantheory:associated_const, r=nikomatsakisbors-1/+1
Closes #17841. The majority of the work should be done, e.g. trait and inherent impls, different forms of UFCS syntax, defaults, and cross-crate usage. It's probably enough to replace the constants in `f32`, `i8`, and so on, or close to good enough. There is still some significant functionality missing from this commit: - ~~Associated consts can't be used in match patterns at all. This is simply because I haven't updated the relevant bits in the parser or `resolve`, but it's *probably* not hard to get working.~~ - Since you can't select an impl for trait-associated consts until partway through type-checking, there are some problems with code that assumes that you can check constants earlier. Associated consts that are not in inherent impls cause ICEs if you try to use them in array sizes or match ranges. For similar reasons, `check_static_recursion` doesn't check them properly, so the stack goes ka-blooey if you use an associated constant that's recursively defined. That's a bit trickier to solve; I'm not entirely sure what the best approach is yet. - Dealing with consts associated with type parameters will raise some new issues (e.g. if you have a `T: Int` type parameter and want to use `<T>::ZERO`). See rust-lang/rfcs#865. - ~~Unused associated consts don't seem to trigger the `dead_code` lint when they should. Probably easy to fix.~~ Also, this is the first time I've been spelunking in rustc to such a large extent, so I've probably done some silly things in a couple of places.
2015-04-24Change name of unit test sub-module to "tests".Johannes Oertel-1/+1
Changes the style guidelines regarding unit tests to recommend using a sub-module named "tests" instead of "test" for unit tests as "test" might clash with imports of libtest.
2015-04-23Get associated consts working in match patterns.Sean Patrick Santos-1/+1
2015-04-21syntax: Replace String::from_str with the stable String::fromErick Tryzelaar-1/+1
2015-04-14Expose visibility for fns in syntax::visitNick Cameron-2/+2
2015-04-01Fallout in libsyntaxNiko Matsakis-1/+1
2015-03-30Implement new type-checking strategy for binary operators. Basically,Niko Matsakis-22/+6
the plan is to treat all binary operators as if they were overloaded, relying on the fact that we have impls for all the builtin scalar operations (and no more). But then during writeback we clear the overload if the types correspond to a builtin op. This strategy allows us to avoid having to know the types of the operands ahead of time. It also avoids us overspecializing as we did in the past.
2015-03-25rustc: Remove support for int/uintAlex Crichton-4/+4
This commit removes all parsing, resolve, and compiler support for the old and long-deprecated int/uint types.
2015-03-11syntax: move MethMac to MacImplItem and combine {Provided,Required}Method ↵Eduard Burtescu-30/+2
into MethodTraitItem.
2015-03-11syntax: rename TypeMethod to MethodSig and use it in MethDecl.Eduard Burtescu-19/+4
2015-03-11syntax: gather common fields of impl & trait items into their respective types.Eduard Burtescu-20/+19
2015-03-11syntax: move indirection around {Trait,Impl}Item, from within.Eduard Burtescu-56/+0
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.