about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2015-10-06Non-parametric dropck; instead trust an unsafe attribute (RFC 1238).Felix S. Klock II-0/+9
Implement cannot-assume-parametricity (CAP) from RFC 1238, and add the UGEH attribute. ---- Note that we check for the attribute attached to the dtor method, not the Drop impl. (This is just to match the specification of RFC and the tests; I am not wedded to this approach.)
2015-10-06Add comment for the use of Ident in hash map in mtwtVadim Petrochenkov-0/+2
2015-10-03Implement original version of RFC#1245John Hodge-3/+8
2015-10-03libsyntax: Do not derive Hash for IdentVadim Petrochenkov-15/+29
2015-10-03Auto merge of #28672 - sanxiyn:const-eval-span, r=alexcrichtonbors-1/+5
Fix #28402.
2015-10-03Add a method to test span containmentSeo Sanghyeon-1/+5
2015-10-03Check attribute usageSeo Sanghyeon-1/+0
2015-10-02Auto merge of #28793 - Ms2ger:AttrStyle, r=alexcrichtonbors-25/+24
2015-10-01Stop re-exporting AttrStyle's variants and rename them.Ms2ger-25/+24
2015-10-01Convert DefId to use DefIndex, which is an index into a list ofNiko Matsakis-2/+2
paths, and construct paths for all definitions. Also, stop rewriting DefIds for closures, and instead just load the closure data from the original def-id, which may be in another crate.
2015-10-01Auto merge of #28577 - jethrogb:topic/ast-stmt-debug, r=pcwaltonbors-7/+10
This enables the Debug trait to work on syntax::ast::Stmt.
2015-09-29Restore `if let`s replaced with `for`sVadim Petrochenkov-3/+3
2015-09-29Fill in some missing parts in the default HIR visitorVadim Petrochenkov-11/+18
2015-09-28Fill in some missing parts in the default AST visitorVadim Petrochenkov-341/+267
+ Add helper macro for walking lists (including Options)
2015-09-26Auto merge of #28642 - petrochenkov:name3, r=nrcbors-222/+170
This PR removes random remaining `Ident`s outside of libsyntax and performs general cleanup In particular, interfaces of `Name` and `Ident` are tidied up, `Name`s and `Ident`s being small `Copy` aggregates are always passed to functions by value, and `Ident`s are never used as keys in maps, because `Ident` comparisons are tricky. Although this PR closes https://github.com/rust-lang/rust/issues/6993 there's still work related to it: - `Name` can be made `NonZero` to compress numerous `Option<Name>`s and `Option<Ident>`s but it requires const unsafe functions. - Implementation of `PartialEq` on `Ident` should be eliminated and replaced with explicit hygienic, non-hygienic or member-wise comparisons. - Finally, large parts of AST can potentially be converted to `Name`s in the same way as HIR to clearly separate identifiers used in hygienic and non-hygienic contexts. r? @nrc
2015-09-26Auto merge of #28612 - gandro:targetvendor, r=alexcrichtonbors-0/+7
This adds a new target property, `target_vendor`. It is to be be used as a matcher for conditional compilation. The vendor is part of the [autoconf target triple](http://llvm.org/docs/doxygen/html/classllvm_1_1Triple.html#details): `<arch><sub>-<vendor>-<os>-<env>`. `arch`, `target_os` and `target_env` are already supported by Rust. This change was suggested in PR #28593. It enables conditional compilation based on the vendor. This is needed for the rumprun target, which needs to match against both, target_os and target_vendor. The default value for `target_vendor` is "unknown", "apple" and "pc" are other common values. Matching against the `target_vendor` is introduced behind the feature gate `#![feature(cfg_target_vendor)]`. This is the first time I messed around with rustc internals. I just added the my code where I found the existing `target_*` variables, hopefully I haven't missed anything. Please review with care. :) r? @alexcrichton
2015-09-24Cleanup interfaces of Name, SyntaxContext and IdentVadim Petrochenkov-222/+170
Make sure Name, SyntaxContext and Ident are passed by value Make sure Idents don't serve as keys (or parts of keys) in maps, Ident comparison is not well defined
2015-09-24Remove the deprecated box(PLACE) syntax.Eduard Burtescu-93/+44
2015-09-24rustc: Add target_vendor for target triplesSebastian Wicki-0/+7
This adds a new target property, `target_vendor` which can be used as a matcher for conditional compilation. The vendor is part of the autoconf target triple: <arch><sub>-<vendor>-<os>-<env> The default value for `target_vendor` is "unknown". Matching against the `target_vendor` with `#[cfg]` is currently feature gated as `cfg_target_vendor`.
2015-09-22Encode/decode Names as stringsVadim Petrochenkov-2/+13
2015-09-22Auto merge of #28364 - petrochenkov:usegate, r=alexcrichtonbors-19/+20
Closes https://github.com/rust-lang/rust/issues/28075 Closes https://github.com/rust-lang/rust/issues/28388 r? @eddyb cc @brson
2015-09-21Change syntax::ast_util::stmt_id to not panic on macrosJethro Beekman-7/+10
This enables the Debug trait to work on syntax::ast::Stmt
2015-09-21Use ast::AsmDialect's variants qualified, and drop the pointless prefix.Ms2ger-6/+6
2015-09-21Auto merge of #28552 - apasel422:issue-28527, r=Manishearthbors-139/+114
Closes #28527. r? @Manishearth
2015-09-20Auto merge of #28534 - marcusklaas:fix-mod-inner-span, r=alexcrichtonbors-1/+1
Fixes https://github.com/rust-lang/rust/issues/28520. r? @alexcrichton or @nrc?
2015-09-20Replace `ast::Mac_` enum with structAndrew Paseltiner-139/+114
Closes #28527.
2015-09-20Fix the overly long inner spans of inline modsMarcus Klaas-1/+1
2015-09-20Auto merge of #28529 - Manishearth:rollup, r=Manishearthbors-26/+38
- Successful merges: #28463, #28507, #28522, #28525, #28526 - Failed merges:
2015-09-20Rollup merge of #28526 - Manishearth:expand-clone, r=eddybManish Goregaokar-24/+25
This reduces some clones of `Vec`s. These are not deep copies since the token tree is made using `Rc`s, so this won't be a major improvement. r? @eddyb
2015-09-20Auto merge of #28503 - marcusklaas:pub-extern, r=alexcrichtonbors-7/+4
Fixes https://github.com/rust-lang/rust/issues/28472.
2015-09-20Move tts instead of cloning in expansionManish Goregaokar-24/+25
2015-09-19Feature-gate `#[no_debug]` and `#[omit_gdb_pretty_printer_section]`Andrew Paseltiner-2/+13
Closes #28091.
2015-09-19Auto merge of #28345 - japaric:op-assign, r=nmatsakisbors-0/+6
Implements overload-able augmented/compound assignments, like `a += b` via the `AddAssign` trait, as specified in RFC [953] [953]: https://github.com/rust-lang/rfcs/blob/master/text/0953-op-assign.md r? @nikomatsakis
2015-09-19Auto merge of #28486 - nrc:pub-extern-crate, r=alexcrichtonbors-5/+12
Temporary 'fix' for #26775 r? @brson
2015-09-18Overloaded augmented assignmentsJorge Aparicio-0/+6
2015-09-19Include visibility modifier in span of foreign itemMarcus Klaas-7/+4
2015-09-18Auto merge of #28442 - nagisa:remove-enum-vis-field, r=alexcrichtonbors-14/+4
Followup on #28440 Do not merge before the referenced PR is merged. I will fix the PR once that is merged (or close if it is not)
2015-09-18Add feature gateVadim Petrochenkov-1/+20
2015-09-18Implement empty struct with braces (RFC 218)Vadim Petrochenkov-43/+28
2015-09-18Warn on `pub extern crate`.Nick Cameron-5/+12
Temporary 'fix' for #26775
2015-09-17Resolve prefix in imports with empty bracesVadim Petrochenkov-2/+1
2015-09-17Workaround for imports with empty bracesVadim Petrochenkov-2/+2
2015-09-17Correctly walk import lists in AST visitorsVadim Petrochenkov-19/+21
2015-09-17Remove Visibility field from enum variantsSimonas Kazlauskas-10/+3
Followup on #28440
2015-09-17libsyntax: forbid visibility modifiers for enum variantsAleksey Kladov-5/+2
fixes #28433
2015-09-17Fix the span for ! returnsNick Cameron-1/+1
2015-09-16Use ast attributes every where (remove HIR attributes).Nick Cameron-310/+350
This could be a [breaking-change] if your lint or syntax extension (is that even possible?) uses HIR attributes or literals.
2015-09-15Auto merge of #28351 - jonas-schievink:macro-bt, r=nrcbors-22/+37
The second commit in this PR will stop printing the macro definition site in backtraces, which cuts their length in half and increases readability (the definition site was only correct for local macros). The third commit will not print an invocation if the last one printed occurred at the same place (span). This will make backtraces caused by a self-recursive macro much shorter. (A possible alternative would be to capture the backtrace first, then limit it to a few frames at the start and end of the chain and print `...` inbetween. This would also work with multiple macros calling each other, which is not addressed by this PR - although the backtrace will still be halved) Example: ```rust macro_rules! m { ( 0 $($t:tt)* ) => ( m!($($t)*); ); () => ( fn main() {0} ); } m!(0 0 0 0 0 0 0 0 0 0 0 0 0 0 0); ``` On a semi-recent nightly, this yields: ``` test.rs:3:21: 3:22 error: mismatched types: expected `()`, found `_` (expected (), found integral variable) [E0308] test.rs:3 () => ( fn main() {0} ); ^ test.rs:1:1: 4:2 note: in expansion of m! test.rs:2:23: 2:34 note: expansion site test.rs:1:1: 4:2 note: in expansion of m! test.rs:2:23: 2:34 note: expansion site test.rs:1:1: 4:2 note: in expansion of m! test.rs:2:23: 2:34 note: expansion site test.rs:1:1: 4:2 note: in expansion of m! test.rs:2:23: 2:34 note: expansion site test.rs:1:1: 4:2 note: in expansion of m! test.rs:2:23: 2:34 note: expansion site test.rs:1:1: 4:2 note: in expansion of m! test.rs:2:23: 2:34 note: expansion site test.rs:1:1: 4:2 note: in expansion of m! test.rs:2:23: 2:34 note: expansion site test.rs:1:1: 4:2 note: in expansion of m! test.rs:2:23: 2:34 note: expansion site test.rs:1:1: 4:2 note: in expansion of m! test.rs:2:23: 2:34 note: expansion site test.rs:1:1: 4:2 note: in expansion of m! test.rs:2:23: 2:34 note: expansion site test.rs:1:1: 4:2 note: in expansion of m! test.rs:2:23: 2:34 note: expansion site test.rs:1:1: 4:2 note: in expansion of m! test.rs:2:23: 2:34 note: expansion site test.rs:1:1: 4:2 note: in expansion of m! test.rs:2:23: 2:34 note: expansion site test.rs:1:1: 4:2 note: in expansion of m! test.rs:2:23: 2:34 note: expansion site test.rs:1:1: 4:2 note: in expansion of m! test.rs:2:23: 2:34 note: expansion site test.rs:1:1: 4:2 note: in expansion of m! test.rs:6:1: 6:35 note: expansion site test.rs:3:21: 3:22 help: run `rustc --explain E0308` to see a detailed explanation error: aborting due to previous error ``` After this patch: ``` test.rs:3:21: 3:22 error: mismatched types: expected `()`, found `_` (expected (), found integral variable) [E0308] test.rs:3 () => ( fn main() {0} ); ^ test.rs:2:23: 2:34 note: in this expansion of m! test.rs:6:1: 6:35 note: in this expansion of m! test.rs:3:21: 3:22 help: run `rustc --explain E0308` to see a detailed explanation error: aborting due to previous error ```
2015-09-14Auto merge of #28247 - christopherdumas:fix_28243, r=eddybbors-1/+1
as per #28243.
2015-09-14Fix tuple float bug.christopherdumas-1/+1