about summary refs log tree commit diff
path: root/src/libsyntax/ast_util.rs
AgeCommit message (Collapse)AuthorLines
2014-02-14Refactored ast_map and friends, mainly to have Paths without storing them.Eduard Burtescu-2/+19
2014-02-13auto merge of #12061 : pongad/rust/delorderable, r=cmrbors-3/+3
#12057
2014-02-13Removed num::OrderableMichael Darakananda-3/+3
2014-02-13Replace `crate` usage with `krate`Flavio Percoco-2/+2
This patch replaces all `crate` usage with `krate` before introducing the new keyword. This ensures that after introducing the keyword, there won't be any compilation errors. krate might not be the most expressive substitution for crate but it's a very close abbreviation for it. `module` was already used in several places already.
2014-02-02libsyntax: Remove the `interner_get` function and all usesPatrick Walton-1/+4
2014-01-27Demote self to an (almost) regular argument and remove the env param.Eduard Burtescu-27/+14
Fixes #10667 and closes #10259.
2014-01-25Uppercase numeric constantsChris Wong-2/+2
The following are renamed: * `min_value` => `MIN` * `max_value` => `MAX` * `bits` => `BITS` * `bytes` => `BYTES` Fixes #10010.
2014-01-21[std::vec] Rename .pop_opt() to .pop(), drop the old .pop() behaviorSimon Sapin-1/+1
2014-01-21[std::vec] Rename .last_opt() to .last(), drop the old .last() behaviorSimon Sapin-2/+2
2014-01-21Remove unnecessary parentheses.Huon Wilson-5/+5
2014-01-17auto merge of #11585 : nikomatsakis/rust/issue-3511-rvalue-lifetimes, r=pcwaltonbors-5/+1
Major changes: - Define temporary scopes in a syntax-based way that basically defaults to the innermost statement or conditional block, except for in a `let` initializer, where we default to the innermost block. Rules are documented in the code, but not in the manual (yet). See new test run-pass/cleanup-value-scopes.rs for examples. - Refactors Datum to better define cleanup roles. - Refactor cleanup scopes to not be tied to basic blocks, permitting us to have a very large number of scopes (one per AST node). - Introduce nascent documentation in trans/doc.rs covering datums and cleanup in a more comprehensive way. r? @pcwalton
2014-01-17syntax::ast: Remove/Recover testsklutzy-17/+19
`xorpush_test` and `test_marksof` are at `syntax::ast_util`. Fixes #7952
2014-01-15Issue #3511 - Rationalize temporary lifetimes.Niko Matsakis-5/+1
Major changes: - Define temporary scopes in a syntax-based way that basically defaults to the innermost statement or conditional block, except for in a `let` initializer, where we default to the innermost block. Rules are documented in the code, but not in the manual (yet). See new test run-pass/cleanup-value-scopes.rs for examples. - Refactors Datum to better define cleanup roles. - Refactor cleanup scopes to not be tied to basic blocks, permitting us to have a very large number of scopes (one per AST node). - Introduce nascent documentation in trans/doc.rs covering datums and cleanup in a more comprehensive way.
2014-01-13librustc: Remove `@` pointer patterns from the languagePatrick Walton-1/+10
2014-01-11Remove re-exports of std::io::stdio::{print, println} in the prelude.Brendan Zabarauskas-1/+1
The `print!` and `println!` macros are now the preferred method of printing, and so there is no reason to export the `stdio` functions in the prelude. The functions have also been replaced by their macro counterparts in the tutorial and other documentation so that newcomers don't get confused about what they should be using.
2014-01-09libsyntax: Renamed types, traits and enum variants to CamelCase.Eduard Burtescu-84/+83
2014-01-06Disowned the Visitor.Eduard Burtescu-41/+14
2014-01-03librustc: Remove `@mut` support from the parserPatrick Walton-6/+6
2014-01-03libsyntax: Remove an unnecessary `@mut io::Reader`Patrick Walton-8/+10
2014-01-03libsyntax: De-`@mut` `SCTable`Patrick Walton-10/+14
2014-01-03libsyntax: De-`@mut` `SCTable::rename_memo`Patrick Walton-4/+5
2014-01-03libsyntax: De-`@mut` `SCTable::mark_memo`Patrick Walton-4/+5
2014-01-03libsyntax: De-`@mut` `SCTable::table`Patrick Walton-13/+36
2014-01-03libsyntax: De-`@mut` the resolve tablePatrick Walton-5/+8
2014-01-01Remove `extern mod foo (name="bar")` syntax, closes #9543Florian Hahn-1/+1
2013-12-12Remove fk_anonSeo Sanghyeon-1/+1
2013-12-11Make 'self lifetime illegal.Erik Price-7/+7
Also remove all instances of 'self within the codebase. This fixes #10889.
2013-12-01auto merge of #10750 : Blei/rust/no-at-struct-field, r=alexcrichtonbors-1/+1
2013-12-01ast: Remove one `@` and fix the falloutPhilipp Brüschweiler-1/+1
2013-12-01Box Block, fn_decl, variant and Ty in the AST, as they were inflating ↵Eduard Burtescu-22/+11
critical enum sizes.
2013-11-28Register new snapshotsAlex Crichton-8/+8
2013-11-26auto merge of #10670 : eddyb/rust/node-u32, r=alexcrichtonbors-15/+9
### Rationale There is no reason to support more than 2³² nodes or names at this moment, as compiling something that big (even without considering the quadratic space usage of some analysis passes) would take at least **64GB**. Meanwhile, some can't (or barely can) compile rustc because it requires almost **1.5GB**. ### Potential problems Can someone confirm this doesn't affect metadata (de)serialization? I can't tell myself, I know nothing about it. ### Results Some structures have a size reduction of 25% to 50%: [before](https://gist.github.com/luqmana/3a82a51fa9c86d9191fa) - [after](https://gist.github.com/eddyb/5a75f8973d3d8018afd3). Sadly, there isn't a massive change in the memory used for compiling stage2 librustc (it doesn't go over **1.4GB** as [before](http://huonw.github.io/isrustfastyet/mem/), but I can barely see the difference). However, my own testcase (previously peaking at **1.6GB** in typeck) shows a reduction of **200**-**400MB**.
2013-11-27Shink NodeId, CrateNum, Name and Mrk down to 32 bits on x64.Eduard Burtescu-15/+9
2013-11-26libsyntax: Remove all non-`proc` `do` syntax.Patrick Walton-2/+2
2013-11-26librustc: Remove remaining uses of `&fn()` in favor of `||`.Patrick Walton-1/+1
2013-11-26Take &Pat in visit_patSeo Sanghyeon-1/+1
2013-11-25Take &PatSeo Sanghyeon-1/+1
2013-11-19libsyntax: Change all uses of `&fn` to `||`.Patrick Walton-3/+3
2013-11-18Use '..' as slice wildcard in vectorsBrian Anderson-1/+1
2013-11-08Generalize AST and ty::Generics to accept multiple lifetimes.Niko Matsakis-3/+5
2013-10-25libsyntax/librustc: Allow mut qualifier in patterns.Luqman Aden-1/+1
2013-10-24Remove even more of std::ioAlex Crichton-2/+1
Big fish fried here: extra::json most of the compiler extra::io_util removed extra::fileinput removed Fish left to fry extra::ebml
2013-10-22libsyntax/librustc: Allow specifying mut on by-value self.Luqman Aden-1/+1
2013-10-22Drop the '2' suffix from logging macrosAlex Crichton-10/+10
Who doesn't like a massive renaming?
2013-10-09option: rewrite the API to use compositionDaniel Micay-3/+3
2013-10-07Fix existing privacy/visibility violationsAlex Crichton-1/+1
This commit fixes all of the fallout of the previous commit which is an attempt to refine privacy. There were a few unfortunate leaks which now must be plugged, and the most horrible one is the current `shouldnt_be_public` module now inside `std::rt`. I think that this either needs a slight reorganization of the runtime, or otherwise it needs to just wait for the external users of these modules to get replaced with their `rt` implementations. Other fixes involve making things pub which should be pub, and otherwise updating error messages that now reference privacy instead of referencing an "unresolved name" (yay!).
2013-10-07Extract privacy checking from name resolutionAlex Crichton-26/+0
This commit is the culmination of my recent effort to refine Rust's notion of privacy and visibility among crates. The major goals of this commit were to remove privacy checking from resolve for the sake of sane error messages, and to attempt a much more rigid and well-tested implementation of visibility throughout rust. The implemented rules for name visibility are: 1. Everything pub from the root namespace is visible to anyone 2. You may access any private item of your ancestors. "Accessing a private item" depends on what the item is, so for a function this means that you can call it, but for a module it means that you can look inside of it. Once you look inside a private module, any accessed item must be "pub from the root" where the new root is the private module that you looked into. These rules required some more analysis results to get propagated from trans to privacy in the form of a few hash tables. I added a new test in which my goal was to showcase all of the privacy nuances of the language, and I hope to place any new bugs into this file to prevent regressions. Overall, I was unable to completely remove the notion of privacy from resolve. One use of privacy is for dealing with glob imports. Essentially a glob import can only import *public* items from the destination, and because this must be done at namespace resolution time, resolve must maintain the notion of "what items are public in a module". There are some sad approximations of privacy, but I unfortunately can't see clear methods to extract them outside. The other use case of privacy in resolve now is one that must stick around regardless of glob imports. When dealing with privacy, checking a private path needs to know "what the last private thing was" when looking at a path. Resolve is the only compiler pass which knows the answer to this question, so it maintains the answer on a per-path resolution basis (works similarly to the def_map generated). Closes #8215
2013-10-03Rewrite lint passes with less visitor cruftAlex Crichton-23/+17
This purges about 500 lines of visitor cruft from lint passes. All lints are handled in a much more sane way at this point. The other huge bonus of this commit is that there are no more @-boxes in the lint passes, fixing the 500MB memory regression seen when the lint passes were refactored. Closes #8589
2013-10-02auto merge of #9665 : alexcrichton/rust/snapshot, r=brsonbors-2/+2
Uses the new snapshots to kill the old `loop` and introduce the new `continue`.
2013-10-01Migrate users of 'loop' to 'continue'Alex Crichton-2/+2
Closes #9467