about summary refs log tree commit diff
path: root/src/libsyntax/ast_map
AgeCommit message (Collapse)AuthorLines
2015-06-10syntax: move ast_map to librustc.Eduard Burtescu-1278/+0
2015-05-26Associate each path in a `use` declaration with the item in the AST mapBarosl Lee-0/+10
Currently, for `use` declarations with multiple paths, only the `use` item itself is saved in the AST map, not the individual path nodes. This can lead to a problem when a span of a specific path node is needed. For example, #24818 caused an ICE because of this, in `ImportResolver::check_for_conflicting_import()`. Fixes #25763.
2015-05-21Make various fixes:Niko Matsakis-3/+2
- 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-21rustc: const-qualify `const fn` function and method calls.Eduard Burtescu-14/+22
2015-05-21syntax: parse `const fn` for free functions and inherent methods.Eduard Burtescu-5/+15
2015-04-23Structural changes for associated constantsSean Patrick Santos-3/+8
Introduces new variants and types in syntax::ast, middle::ty, and middle::def.
2015-04-14Expose visibility for fns in syntax::visitNick Cameron-11/+18
2015-04-01rollup merge of #23860: nikomatsakis/copy-requires-cloneAlex Crichton-3/+3
Conflicts: src/test/compile-fail/coherence-impls-copy.rs
2015-04-01Fallout in libsyntaxNiko Matsakis-3/+3
2015-04-01Fallout in libsyntax/librustc: use newtype'd options for linked lists,Niko Matsakis-5/+16
since `Option` is not fundamental and hence the old impls run afoul of the orphan rules.
2015-03-28cleanup: Remove unused braces in use statementsRicho Healey-1/+1
2015-03-11syntax: move MethMac to MacImplItem and combine {Provided,Required}Method ↵Eduard Burtescu-24/+26
into MethodTraitItem.
2015-03-11syntax: rename TypeMethod to MethodSig and use it in MethDecl.Eduard Burtescu-1/+1
2015-03-11syntax: gather common fields of impl & trait items into their respective types.Eduard Burtescu-200/+77
2015-03-11syntax: move indirection around {Trait,Impl}Item, from within.Eduard Burtescu-30/+26
2015-03-10Auto merge of #23028 - Munksgaard:get_attrs_opt, r=eddybbors-15/+12
This is more flexible and less error-prone. `get_attrs` and `get_attrs_opt` can be used on many more items than the old `get_attrs` could. This is all courtesy of @huonw, and directly taken from here: https://github.com/rust-lang/rust/pull/22348/files#diff-0f85fcb07fb739876892e633fa0e2be6R5575 Also thanks to @Manishearth for pointing it out to me.
2015-03-10with_attrs -> attrsPhilip Munksgaard-15/+12
We don't need to take a closure, instead just return the list of attributes.
2015-03-04std: Deprecate std::old_io::fsAlex Crichton-3/+3
This commit deprecates the majority of std::old_io::fs in favor of std::fs and its new functionality. Some functions remain non-deprecated but are now behind a feature gate called `old_fs`. These functions will be deprecated once suitable replacements have been implemented. The compiler has been migrated to new `std::fs` and `std::path` APIs where appropriate as part of this change.
2015-02-22Rename DefTrait to DefaultImplFlavio Percoco-1/+1
2015-02-22Add support for default trait impls in libsyntaxFlavio Percoco-0/+1
2015-02-18rollup merge of #22502: nikomatsakis/deprecate-bracket-bracketAlex Crichton-12/+12
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-12/+12
2015-02-18Opt for .cloned() over .map(|x| x.clone()) etc.Kevin Butler-1/+1
2015-02-04remove all kind annotations from closuresJorge Aparicio-3/+3
2015-02-03Remove the explicit closure kind syntax from the parser and AST;Niko Matsakis-1/+1
upgrade the inference based on expected type so that it is able to infer the fn kind in isolation even if the full signature is not available (and we could perhaps do better still in some cases, such as extracting just the types of the arguments but not the return value).
2015-02-02`for x in xs.iter()` -> `for x in &xs`Jorge Aparicio-6/+6
2015-01-29Auto merge of #21677 - japaric:no-range, r=alexcrichtonbors-4/+4
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-4/+4
2015-01-28Remove unnecessary to_string() call.Ms2ger-1/+1
2015-01-28Remove a custom variant of iter::Cloned.Ms2ger-16/+3
2015-01-26Fallout of io => old_ioAlex Crichton-1/+1
2015-01-21rollup merge of #20179: eddyb/blind-itemsAlex Crichton-23/+2
Conflicts: src/librustc/diagnostics.rs src/librustdoc/clean/mod.rs src/librustdoc/html/format.rs src/libsyntax/parse/parser.rs
2015-01-21rollup merge of #21457: alexcrichton/issue-21436Alex Crichton-1/+1
Conflicts: src/liballoc/boxed.rs src/librustc/middle/traits/error_reporting.rs src/libstd/sync/mpsc/mod.rs
2015-01-21rollup merge of #21396: japaric/no-parens-in-rangeAlex Crichton-1/+1
Conflicts: src/libsyntax/parse/lexer/comments.rs
2015-01-21syntax: fix fallout of merging ast::ViewItem into ast::Item.Eduard Burtescu-23/+2
2015-01-20std: Rename Show/String to Debug/DisplayAlex Crichton-1/+1
This commit is an implementation of [RFC 565][rfc] which is a stabilization of the `std::fmt` module and the implementations of various formatting traits. Specifically, the following changes were performed: [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0565-show-string-guidelines.md * The `Show` trait is now deprecated, it was renamed to `Debug` * The `String` trait is now deprecated, it was renamed to `Display` * Many `Debug` and `Display` implementations were audited in accordance with the RFC and audited implementations now have the `#[stable]` attribute * Integers and floats no longer print a suffix * Smart pointers no longer print details that they are a smart pointer * Paths with `Debug` are now quoted and escape characters * The `unwrap` methods on `Result` now require `Display` instead of `Debug` * The `Error` trait no longer has a `detail` method and now requires that `Display` must be implemented. With the loss of `String`, this has moved into libcore. * `impl<E: Error> FromError<E> for Box<Error>` now exists * `derive(Show)` has been renamed to `derive(Debug)`. This is not currently warned about due to warnings being emitted on stage1+ While backwards compatibility is attempted to be maintained with a blanket implementation of `Display` for the old `String` trait (and the same for `Show`/`Debug`) this is still a breaking change due to primitives no longer implementing `String` as well as modifications such as `unwrap` and the `Error` trait. Most code is fairly straightforward to update with a rename or tweaks of method calls. [breaking-change] Closes #21436
2015-01-19remove unnecessary parentheses from range notationJorge Aparicio-1/+1
2015-01-17libsyntax: uint types to usizePaul Collier-6/+6
2015-01-14auto merge of #21061 : japaric/rust/range, r=nick29581bors-1/+1
2015-01-12cleanup: `&foo[0..a]` -> `&foo[..a]`Jorge Aparicio-1/+1
2015-01-13Add view items to the ast mapNick Cameron-0/+22
2015-01-07rollup merge of #20721: japaric/snapAlex Crichton-14/+14
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-07fix the `&mut _` patternsJorge Aparicio-1/+1
2015-01-07use slicing sugarJorge Aparicio-13/+13
2015-01-07Register new snapshotsAlex Crichton-8/+1
2015-01-06rollup merge of #20481: seanmonstar/fmt-show-stringAlex Crichton-5/+12
Conflicts: src/compiletest/runtest.rs src/libcore/fmt/mod.rs src/libfmt_macros/lib.rs src/libregex/parse.rs src/librustc/middle/cfg/construct.rs src/librustc/middle/dataflow.rs src/librustc/middle/infer/higher_ranked/mod.rs src/librustc/middle/ty.rs src/librustc_back/archive.rs src/librustc_borrowck/borrowck/fragments.rs src/librustc_borrowck/borrowck/gather_loans/mod.rs src/librustc_resolve/lib.rs src/librustc_trans/back/link.rs src/librustc_trans/save/mod.rs src/librustc_trans/trans/base.rs src/librustc_trans/trans/callee.rs src/librustc_trans/trans/common.rs src/librustc_trans/trans/consts.rs src/librustc_trans/trans/controlflow.rs src/librustc_trans/trans/debuginfo.rs src/librustc_trans/trans/expr.rs src/librustc_trans/trans/monomorphize.rs src/librustc_typeck/astconv.rs src/librustc_typeck/check/method/mod.rs src/librustc_typeck/check/mod.rs src/librustc_typeck/check/regionck.rs src/librustc_typeck/collect.rs src/libsyntax/ext/format.rs src/libsyntax/ext/source_util.rs src/libsyntax/ext/tt/transcribe.rs src/libsyntax/parse/mod.rs src/libsyntax/parse/token.rs src/test/run-pass/issue-8898.rs
2015-01-06core: split into fmt::Show and fmt::StringSean McArthur-5/+12
fmt::Show is for debugging, and can and should be implemented for all public types. This trait is used with `{:?}` syntax. There still exists #[derive(Show)]. fmt::String is for types that faithfully be represented as a String. Because of this, there is no way to derive fmt::String, all implementations must be purposeful. It is used by the default format syntax, `{}`. This will break most instances of `{}`, since that now requires the type to impl fmt::String. In most cases, replacing `{}` with `{:?}` is the correct fix. Types that were being printed specifically for users should receive a fmt::String implementation to fix this. Part of #20013 [breaking-change]
2015-01-07Replace full slice notation with index callsNick Cameron-13/+13
2015-01-05remove TyClosureJorge Aparicio-3/+0
2015-01-04Add syntax for negative implementations of traitsFlavio Percoco-1/+1
This commit introduces the syntax for negative implmenetations of traits as shown below: `impl !Trait for Type {}` cc #13231 Part of RFC #3