about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2016-09-10Improve `Eq` derivingVadim Petrochenkov-0/+18
2016-09-10fix span for errors E0537, E0535 & E0536Mikhail Modin-5/+5
2016-09-09Auto merge of #36332 - llogiq:static_consts_feature, r=nikomatsakisbors-0/+3
add static_in_const feature gate also updates tests and deletes the spurious .bk files I inadvertently added last time. r? @nikomatsakis
2016-09-07Auto merge of #36214 - jseyfried:stackless_expansion, r=nrcbors-717/+937
macros: stackless expansion After this PR, macro expansion cannot overflow the stack unless the expanded crate is too deep to fold. Everything but the stackless placeholder expansion commit is also groundwork for macro modularization. r? @nrc or @eddyb
2016-09-07Improve `directory` computation during invocation collection.Jeffrey Seyfried-5/+9
2016-09-07Implement stackless placeholder expansion.Jeffrey Seyfried-8/+22
2016-09-07Strip unconfigured nodes in the `InvocationCollector` fold.Jeffrey Seyfried-19/+67
2016-09-07Refactor code out of the folder implementation for `StripUnconfigured`.Jeffrey Seyfried-55/+75
2016-09-07add static_in_const feature gateAndre Bogus-0/+3
also updates tests and deletes the spurious .bk files I inadvertently added last time.
2016-09-06Auto merge of #36025 - michaelwoerister:incr-comp-hash-spans, r=nikomatsakisbors-20/+4
incr. comp.: Take spans into account for ICH This PR makes the ICH (incr. comp. hash) take spans into account when debuginfo is enabled. A side-effect of this is that the SVH (which is based on the ICHs of all items in the crate) becomes sensitive to the tiniest change in a code base if debuginfo is enabled. Since we are not trying to model ABI compatibility via the SVH anymore (this is done via the crate disambiguator now), this should be not be a problem. Fixes #33888. Fixes #32753.
2016-09-05Rollup merge of #36245 - alexcrichton:add-back-accident, r=arielb1Manish Goregaokar-0/+1
Add back feature accidentally removed This feature was accidentally removed in https://github.com/rust-lang/rust/pull/35957.
2016-09-05Load macros from `extern crate`s in the `InvocationCollector` fold.Jeffrey Seyfried-62/+22
2016-09-05Implement stackless expansion.Jeffrey Seyfried-178/+191
2016-09-05Add module `ext::placeholders` with `placeholder()` and `PlaceholderExpander`.Jeffrey Seyfried-39/+182
2016-09-05Refactor `expand_invoc(.., fld)` -> `self.expand_invoc(..)`.Jeffrey Seyfried-207/+212
2016-09-05Refactor `SyntaxEnv`.Jeffrey Seyfried-126/+119
2016-09-05Refactor `expand_*` into `expander.fold_*`.Jeffrey Seyfried-214/+194
2016-09-05Clean up module processing.Jeffrey Seyfried-34/+20
2016-09-05Refactor out `expand_item` (with better semantics than before).Jeffrey Seyfried-36/+39
2016-09-05Refactor away `expand_item`.Jeffrey Seyfried-7/+3
2016-09-05Generalize `Invocation` to include modifiers/decorators.Jeffrey Seyfried-95/+138
2016-09-05Refactor `with_exts_frame` from a macro to a function.Jeffrey Seyfried-16/+10
2016-09-05Add `Invocation` and `Expansion`, remove `MacroGenerable`.Jeffrey Seyfried-212/+240
2016-09-05Remove `syntax::config::strip_unconfigured`, add `syntax::config::features`.Jeffrey Seyfried-31/+37
2016-09-05Improve `expand_type`.Jeffrey Seyfried-5/+8
2016-09-05In `Parser` and `ExtCtxt`, replace fields `filename` and `mod_path_stack`Jeffrey Seyfried-57/+38
with a single field `directory: PathBuf`.
2016-09-04Replace `_, _` with `..`Vadim Petrochenkov-6/+6
2016-09-04Replace `_, _, _` with `..`Vadim Petrochenkov-1/+1
2016-09-03Add back feature accidentally removedAlex Crichton-0/+1
This feature was accidentally removed in https://github.com/rust-lang/rust/pull/35957.
2016-09-03Translate union constantsVadim Petrochenkov-8/+1
Fix alignment for packed unions Add some missing privacy test Get rid of `unimplemented_unions` macro
2016-09-03Check fields in union patters/expressionsVadim Petrochenkov-1/+3
Make parsing of union items backward compatible Add some tests
2016-09-03Lower unions from AST to HIR and from HIR to typesVadim Petrochenkov-0/+40
Parse union items and add a feature for them
2016-09-03Add unions to ASTVadim Petrochenkov-1/+8
2016-09-03Auto merge of #35957 - alexcrichton:macros-1.1, r=nrcbors-12/+56
rustc: Implement custom derive (macros 1.1) This commit is an implementation of [RFC 1681] which adds support to the compiler for first-class user-define custom `#[derive]` modes with a far more stable API than plugins have today. [RFC 1681]: https://github.com/rust-lang/rfcs/blob/master/text/1681-macros-1.1.md The main features added by this commit are: * A new `rustc-macro` crate-type. This crate type represents one which will provide custom `derive` implementations and perhaps eventually flower into the implementation of macros 2.0 as well. * A new `rustc_macro` crate in the standard distribution. This crate will provide the runtime interface between macro crates and the compiler. The API here is particularly conservative right now but has quite a bit of room to expand into any manner of APIs required by macro authors. * The ability to load new derive modes through the `#[macro_use]` annotations on other crates. All support added here is gated behind the `rustc_macro` feature gate, both for the library support (the `rustc_macro` crate) as well as the language features. There are a few minor differences from the implementation outlined in the RFC, such as the `rustc_macro` crate being available as a dylib and all symbols are `dlsym`'d directly instead of having a shim compiled. These should only affect the implementation, however, not the public interface. This commit also ended up touching a lot of code related to `#[derive]`, making a few notable changes: * Recognized derive attributes are no longer desugared to `derive_Foo`. Wasn't sure how to keep this behavior and *not* expose it to custom derive. * Derive attributes no longer have access to unstable features by default, they have to opt in on a granular level. * The `derive(Copy,Clone)` optimization is now done through another "obscure attribute" which is just intended to ferry along in the compiler that such an optimization is possible. The `derive(PartialEq,Eq)` optimization was also updated to do something similar. --- One part of this PR which needs to be improved before stabilizing are the errors and exact interfaces here. The error messages are relatively poor quality and there are surprising spects of this such as `#[derive(PartialEq, Eq, MyTrait)]` not working by default. The custom attributes added by the compiler end up becoming unstable again when going through a custom impl. Hopefully though this is enough to start allowing experimentation on crates.io!
2016-09-02Rollup merge of #36223 - abhiQmar:e0558-formatting, r=jonathandturnerJonathan Turner-2/+3
Update compiler error E0558 to use new error format Fixes #36196 part of #35233 r? @jonathandturner
2016-09-03Update compiler error E0558 to use new error formatAbhishek Kumar-2/+3
Fixes #36196 part of #35233
2016-09-02rustc: Implement custom derive (macros 1.1)Alex Crichton-12/+56
This commit is an implementation of [RFC 1681] which adds support to the compiler for first-class user-define custom `#[derive]` modes with a far more stable API than plugins have today. [RFC 1681]: https://github.com/rust-lang/rfcs/blob/master/text/1681-macros-1.1.md The main features added by this commit are: * A new `rustc-macro` crate-type. This crate type represents one which will provide custom `derive` implementations and perhaps eventually flower into the implementation of macros 2.0 as well. * A new `rustc_macro` crate in the standard distribution. This crate will provide the runtime interface between macro crates and the compiler. The API here is particularly conservative right now but has quite a bit of room to expand into any manner of APIs required by macro authors. * The ability to load new derive modes through the `#[macro_use]` annotations on other crates. All support added here is gated behind the `rustc_macro` feature gate, both for the library support (the `rustc_macro` crate) as well as the language features. There are a few minor differences from the implementation outlined in the RFC, such as the `rustc_macro` crate being available as a dylib and all symbols are `dlsym`'d directly instead of having a shim compiled. These should only affect the implementation, however, not the public interface. This commit also ended up touching a lot of code related to `#[derive]`, making a few notable changes: * Recognized derive attributes are no longer desugared to `derive_Foo`. Wasn't sure how to keep this behavior and *not* expose it to custom derive. * Derive attributes no longer have access to unstable features by default, they have to opt in on a granular level. * The `derive(Copy,Clone)` optimization is now done through another "obscure attribute" which is just intended to ferry along in the compiler that such an optimization is possible. The `derive(PartialEq,Eq)` optimization was also updated to do something similar. --- One part of this PR which needs to be improved before stabilizing are the errors and exact interfaces here. The error messages are relatively poor quality and there are surprising spects of this such as `#[derive(PartialEq, Eq, MyTrait)]` not working by default. The custom attributes added by the compiler end up becoming unstable again when going through a custom impl. Hopefully though this is enough to start allowing experimentation on crates.io! syntax-[breaking-change]
2016-09-01Add `item_like_imports` feature.Jeffrey Seyfried-1/+4
2016-09-01Auto merge of #34494 - CensoredUsername:allow_sysV64_abi, r=nagisabors-7/+18
Allow specification of the system V AMD64 ABI constraint. This can be specified using `extern "sysV64" fn` on all platforms. This ABI is used as the C ABI on unix platforms, but can only be specified there using extern "C". It was impossible to specify on other platforms. Meanwhile the win64 ABI, which was the extern "C" ABI on the windows platform could be specified on other platforms using extern "win64". This pull request adds the the "sysV64" ABI constraint which exposes this calling convention on platforms where it is not the C ABI.
2016-09-01incr.comp.: Add stable hashing of HIR spans to ICH.Michael Woerister-20/+4
2016-08-31Add a tracking issue to the feature gate of the sysv64 ABICensoredUsername-1/+1
2016-08-31Warn about multiple conflicting #[repr] hintsChris Wong-3/+2
Closes #34622
2016-08-30Feature gate the sysv64 abi as feature(abi_sysv64) and add testsCensoredUsername-7/+16
2016-08-30Change ABI string from sysV64 to sysv64CensoredUsername-1/+1
2016-08-30Allow specification of the system V AMD64 ABI constraint.CensoredUsername-0/+2
This can be specified using `extern sysV64 fn` on all platforms
2016-08-29Remove inherent methods `Annotatable::attrs` and `Annotatable::fold_attrs`.Jeffrey Seyfried-7/+0
2016-08-29Future proof the AST for `union`.Jeffrey Seyfried-2/+18
2016-08-28Rollup merge of #35917 - jseyfried:remove_attr_ext_traits, r=nrcJeffrey Seyfried-113/+72
syntax: Remove traits `AttrMetaMethods`, `AttributeMethods`, and `AttrNestedMetaItemMethods`
2016-08-28Rollup merge of #35850 - SergioBenitez:master, r=nrcJeffrey Seyfried-159/+459
Implement RFC#1559: allow all literals in attributes Implemented rust-lang/rfcs#1559, tracked by #34981.
2016-08-28Rollup merge of #35728 - petrochenkov:empderive, r=manishearthJeffrey Seyfried-20/+20
Fix #[derive] for empty tuple structs/variants This was missing from https://github.com/rust-lang/rust/pull/35138