summary refs log tree commit diff
path: root/src/libsyntax/ast.rs
AgeCommit message (Collapse)AuthorLines
2015-09-04Auto merge of #28170 - nagisa:loopctl-label-spans, r=alexcrichtonbors-2/+2
r? @alexcrichton
2015-09-03Use consistent terminology for byte string literalsVadim Petrochenkov-1/+1
Avoid confusion with binary integer literals and binary operator expressions in libsyntax
2015-09-03Use proper span for break and continue labelsSimonas Kazlauskas-2/+2
Fixes #28109
2015-08-30Make a macro a const fn and remove outdated NBTobias Bucher-2/+0
2015-08-24move def-id to rustc crateNiko Matsakis-32/+1
2015-08-20syntax: remove suffix_len methods from LitIntTypesGeorg Brandl-27/+0
The methods gave wrong results for TyIs and TyUs, whose suffix len should be 5 nowadays. But since they were only used for parsing, and unneeded for that since 606a309d, remove them rather than fixing.
2015-08-17Clean up simd_cast translation.Huon Wilson-0/+24
2015-08-14move InlinedItem into librustc, where it belongsNiko Matsakis-12/+0
2015-08-12Add two new kinds of predicates, WellFormed and ObjectSafe.Niko Matsakis-1/+1
2015-08-11syntax: fix use of "vector" for [x; n] literal and [x, y] patternsGeorg Brandl-1/+1
2015-08-10Auto merge of #27451 - seanmonstar:use-groups-as, r=alexcrichtonbors-3/+18
An implementation of [RFC 1219](https://github.com/rust-lang/rfcs/pull/1219). The RFC is not merged yet, but once merged, this could be.
2015-08-08rustc: rename multiple imports in a listSean McArthur-3/+18
2015-08-04Add a macro invocation to the type ASTJared Roesch-0/+2
Reapplied the changes from https://github.com/freebroccolo/rust/commit/dc64b731d7f66c2b43d5e5e8c721be7bd3b59540 to a clean branch of master
2015-07-28remove `get_ident` and `get_name`, make `as_str` soundOliver Schneider-19/+15
2015-07-26Remove `ast::LocalSource` with only one used variantmitaa-10/+0
`LocalSource` indicated wether a let binding originated from for-loop desugaring to enable specialized error messages, but for-loop expansion has changed and this is now achieved through `MatchSource::ForLoopDesugar`.
2015-07-22Hack for "unsafety hygiene" -- `push_unsafe!` and `pop_unsafe!`.Felix S. Klock II-0/+2
Even after expansion, the generated expressions still track depth of such pushes (i.e. how often you have "pushed" without a corresponding "pop"), and we add a rule that in a context with a positive `push_unsafe!` depth, it is effectively an `unsafe` block context. (This way, we can inject code that uses `unsafe` features, but still contains within it a sub-expression that should inherit the outer safety checking setting, outside of the injected code.) This is a total hack; it not only needs a feature-gate, but probably should be feature-gated forever (if possible). ignore-pretty in test/run-pass/pushpop-unsafe-okay.rs
2015-07-18Fix doc comment parsing in macros.Lee Jeffery-3/+15
2015-07-10Preserve escape sequences in documentation comments on macro expansionBarosl Lee-1/+1
Escape sequences in documentation comments must not be parsed as a normal string when expanding a macro, otherwise some innocent but invalid-escape-sequence-looking comments will trigger an ICE. Although this commit replaces normal string literals with raw string literals in macro expansion, this shouldn't be much a problem considering documentation comments are converted into attributes before being passed to a macro anyways. Fixes #25929. Fixes #25943.
2015-06-19Move AST Repr impls to Debug impls in libsyntax.Eduard Burtescu-9/+67
2015-05-21Make various fixes:Niko Matsakis-1/+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-1/+8
2015-05-04Fix spelling errors in documentation.Joseph Crail-1/+1
2015-04-27Auto merge of #23606 - quantheory:associated_const, r=nikomatsakisbors-0/+8
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-25Interpolate AST nodes in quasiquote.Geoffry Song-6/+0
This changes the `ToTokens` implementations for expressions, statements, etc. with almost-trivial ones that produce `Interpolated(*Nt(...))` pseudo-tokens. In this way, quasiquote now works the same way as macros do: already-parsed AST fragments are used as-is, not reparsed. The `ToSource` trait is removed. Quasiquote no longer involves pretty-printing at all, which removes the need for the `encode_with_hygiene` hack. All associated machinery is removed. A new `Nonterminal` is added, NtArm, which the parser now interpolates. This is just for quasiquote, not macros (although it could be in the future). `ToTokens` is no longer implemented for `Arg` (although this could be added again) and `Generics` (which I don't think makes sense). This breaks any compiler extensions that relied on the ability of `ToTokens` to turn AST fragments back into inspectable token trees. For this reason, this closes #16987. As such, this is a [breaking-change]. Fixes #16472. Fixes #15962. Fixes #17397. Fixes #16617.
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-0/+6
2015-04-23Structural changes for associated constantsSean Patrick Santos-0/+2
Introduces new variants and types in syntax::ast, middle::ty, and middle::def.
2015-04-21std: Remove deprecated/unstable num functionalityAlex Crichton-9/+15
This commit removes all the old casting/generic traits from `std::num` that are no longer in use by the standard library. This additionally removes the old `strconv` module which has not seen much use in quite a long time. All generic functionality has been supplanted with traits in the `num` crate and the `strconv` module is supplanted with the [rust-strconv crate][rust-strconv]. [rust-strconv]: https://github.com/lifthrasiir/rust-strconv This is a breaking change due to the removal of these deprecated crates, and the alternative crates are listed above. [breaking-change]
2015-04-14Negative case of `len()` -> `is_empty()`Tamir Duberstein-5/+5
`s/([^\(\s]+\.)len\(\) [(?:!=)>] 0/!$1is_empty()/g`
2015-04-01fallout when bootstrapping `rustc`.Felix S. Klock II-1/+1
2015-03-31Stabilize std::numAaron Turon-0/+2
This commit stabilizes the `std::num` module: * The `Int` and `Float` traits are deprecated in favor of (1) the newly-added inherent methods and (2) the generic traits available in rust-lang/num. * The `Zero` and `One` traits are reintroduced in `std::num`, which together with various other traits allow you to recover the most common forms of generic programming. * The `FromStrRadix` trait, and associated free function, is deprecated in favor of inherent implementations. * A wide range of methods and constants for both integers and floating point numbers are now `#[stable]`, having been adjusted for integer guidelines. * `is_positive` and `is_negative` are renamed to `is_sign_positive` and `is_sign_negative`, in order to address #22985 * The `Wrapping` type is moved to `std::num` and stabilized; `WrappingOps` is deprecated in favor of inherent methods on the integer types, and direct implementation of operations on `Wrapping<X>` for each concrete integer type `X`. Closes #22985 Closes #21069 [breaking-change]
2015-03-25rustc: Remove support for int/uintAlex Crichton-36/+6
This commit removes all parsing, resolve, and compiler support for the old and long-deprecated int/uint types.
2015-03-24rustc: Add support for `extern crate foo as bar`Alex Crichton-2/+2
The compiler will now issue a warning for crates that have syntax of the form `extern crate "foo" as bar`, but it will still continue to accept this syntax. Additionally, the string `foo-bar` will match the crate name `foo_bar` to assist in the transition period as well. This patch will land hopefully in tandem with a Cargo patch that will start translating all crate names to have underscores instead of hyphens. cc #23533
2015-03-19Auto merge of #23507 - jbcrail:fix-comment-spelling, r=alexcrichtonbors-1/+1
I corrected misspelled comments in several crates.
2015-03-19Fix spelling errors in comments.Joseph Crail-1/+1
I corrected misspelled comments in several crates.
2015-03-19Rollup merge of #23428 - Manishearth:ast-doc, r=steveklabnikManish Goregaokar-15/+42
I often have to run `ast-json` or look into the pretty-printer source to figure out what the fields of an AST enum mean. I've tried to document most of what I know (and some semi-obvious stuff). r? @steveklabnik f? @eddyb
2015-03-19Space and punctuation fixesManish Goregaokar-14/+41
2015-03-19Address huon's commentsManish Goregaokar-1/+1
2015-03-19Update ast.rsmdinger-1/+1
Typo
2015-03-18Address huon's commentsManish Goregaokar-17/+21
2015-03-18Clarify ExprManish Goregaokar-5/+10
2015-03-18ast: Document Item and ForeignItemManish Goregaokar-9/+27
2015-03-18ast: Document LitManish Goregaokar-1/+15
2015-03-18ast: Document Pat and BlockManish Goregaokar-1/+19
2015-03-18ast: Document paths and `where` clausesManish Goregaokar-1/+15
2015-03-18ast: Document Expr_, UnOp, and BinOpManish Goregaokar-1/+70
2015-03-11syntax: move MethMac to MacImplItem and combine {Provided,Required}Method ↵Eduard Burtescu-12/+3
into MethodTraitItem.
2015-03-11syntax: rename TypeMethod to MethodSig and use it in MethDecl.Eduard Burtescu-10/+5
2015-03-11syntax: gather common fields of impl & trait items into their respective types.Eduard Burtescu-39/+27
2015-03-11syntax: move indirection around {Trait,Impl}Item, from within.Eduard Burtescu-6/+6