about summary refs log tree commit diff
path: root/src/libsyntax/ext
AgeCommit message (Collapse)AuthorLines
2015-09-21Use ast::AsmDialect's variants qualified, and drop the pointless prefix.Ms2ger-2/+3
2015-09-20Replace `ast::Mac_` enum with structAndrew Paseltiner-88/+75
Closes #28527.
2015-09-20Move tts instead of cloning in expansionManish Goregaokar-24/+25
2015-09-17Remove Visibility field from enum variantsSimonas Kazlauskas-1/+0
Followup on #28440
2015-09-08Allow tracking issues for lang features.Huon Wilson-2/+10
This is similar to the libs version, which allow an `issue` field in the `#[unstable]` attribute. cc #28244
2015-09-03Use consistent terminology for byte string literalsVadim Petrochenkov-3/+3
Avoid confusion with binary integer literals and binary operator expressions in libsyntax
2015-09-01Auto merge of #28137 - nrc:remove-non-multi, r=huonwbors-151/+2
This is a [breaking-change] for syntax extension authors. The fix is to use MultiModifier or MultiDecorator, which have the same functionality but are more flexible. Users of syntax extensions are unaffected.
2015-09-01Remove the Modifier and Decorator kinds of syntax extensions.Nick Cameron-151/+2
This is a [breaking-change] for syntax extension authors. The fix is to use MultiModifier or MultiDecorator, which have the same functionality but are more flexible. Users of syntax extensions are unaffected.
2015-08-31Closures are not generated code.Nick Cameron-4/+1
2015-08-29Allow #[derive()] to generate unsafe trait implsMichael Layzell-1/+23
2015-08-28Move ExpnInfo to NameManish Goregaokar-19/+19
2015-08-27Enumify CompilerExpansion in ExpnInfoManish Goregaokar-36/+27
2015-08-24Auto merge of #27239 - apasel422:issue-19102, r=huonwbors-1/+7
closes #19102
2015-08-19Auto merge of #27849 - jonas-schievink:macro-errors, r=nikomatsakisbors-46/+50
And some small indentation/code style fixes in the macro parser.
2015-08-17feature gate `cfg(target_feature)`.Huon Wilson-8/+15
This is theoretically a breaking change, but GitHub search turns up no uses of it, and most non-built-in cfg's are passed via cargo features, which look like `feature = "..."`, and hence can't overlap.
2015-08-17Implement `repr(simd)` as an alias for `#[simd]`.Huon Wilson-1/+1
2015-08-15Slightly improved macro diagnostics + Indentation fixesJonas Schievink-46/+50
2015-08-15Auto merge of #27827 - w00ns:for-loop-expn-issue-27639, r=alexcrichtonbors-10/+1
Fixes #27639
2015-08-15Fix issue with for loop expansionw00ns-10/+1
2015-08-15Fix span of invalid metavariable repetitionJonas Schievink-1/+1
2015-08-12Auto merge of #27691 - jonas-schievink:for-macro, r=alexcrichtonbors-1/+1
Closes #27004
2015-08-12Fix macro expansion in for loop patternJonas Schievink-1/+1
2015-08-11Auto merge of #27584 - TimNN:macro-eof-span, r=huonwbors-23/+17
The ideas is to use the span of the complete macro invocation if the span of a macro error is `DUMMY_SP`. fixes #7970
2015-08-10Auto merge of #27451 - seanmonstar:use-groups-as, r=alexcrichtonbors-1/+1
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-10add and use Span.substitute_dummy methodTim Neumann-17/+6
2015-08-08rustc: rename multiple imports in a listSean McArthur-1/+1
2015-08-07improve span of erroneous empty macro invocationTim Neumann-22/+27
The ideas is to use the span of the complete macro invocation if the span of a macro error is `DUMMY_SP`. fixes #7970
2015-08-06Auto merge of #27296 - jroesch:type-macros, r=huonwbors-0/+73
This pull request implements the functionality for [RFC 873](https://github.com/rust-lang/rfcs/blob/master/text/0873-type-macros.md). This is currently just an update of @freebroccolo's branch from January, the corresponding commits are linked in each commit message. @nikomatsakis and I had talked about updating the macro language to support a lifetime fragment specifier, and it is possible to do that work on this branch as well. If so we can (collectively) talk about it next week during the pre-RustCamp work week.
2015-08-04Fix last nitsJared Roesch-1/+2
2015-08-04Actually commit testsJared Roesch-1/+1
2015-08-04Address nitsJared Roesch-1/+0
2015-08-04Add feature gateJared Roesch-19/+29
2015-08-04Update and add test caseJared Roesch-1/+6
Test case from here: https://github.com/freebroccolo/rust/commit/9e93fef3c0e61836a8b56f727eb7a2e94bb4ca09
2015-08-04Extend macro machinery to expand macros in typesJared Roesch-0/+58
Reapplied the changes from https://github.com/freebroccolo/rust/commit/7aafe24139abc2d1f302bbb166bcaa006f12cf4d to a clean branch of master
2015-08-03syntax: Implement #![no_core]Alex Crichton-175/+71
This commit is an implementation of [RFC 1184][rfc] which tweaks the behavior of the `#![no_std]` attribute and adds a new `#![no_core]` attribute. The `#![no_std]` attribute now injects `extern crate core` at the top of the crate as well as the libcore prelude into all modules (in the same manner as the standard library's prelude). The `#![no_core]` attribute disables both std and core injection. [rfc]: https://github.com/rust-lang/rfcs/pull/1184
2015-08-03Auto merge of #27134 - fhartwig:derive, r=huonwbors-0/+11
Fixes #25022 This adapts the deriving mechanism to not repeat bounds for the same type parameter. To give an example: for the following code: ```rust #[derive(Clone)] pub struct FlatMap<I, U: IntoIterator, F> { iter: I, f: F, frontiter: Option<U::IntoIter>, backiter: Option<U::IntoIter>, } ``` the latest nightly generates the following impl signature: ```rust impl <I: ::std::clone::Clone, U: ::std::clone::Clone + IntoIterator, F: ::std::clone::Clone> ::std::clone::Clone for FlatMap<I, U, F> where I: ::std::clone::Clone, F: ::std::clone::Clone, U::IntoIter: ::std::clone::Clone, U::IntoIter: ::std::clone::Clone ``` With these changes, the signature changes to this: ```rust impl <I, U: IntoIterator, F> ::std::clone::Clone for FlatMap<I, U, F> where I: ::std::clone::Clone, F: ::std::clone::Clone, U::IntoIter: ::std::clone::Clone ``` (Nothing in the body of the impl changes) Note that the second impl is more permissive, as it doesn't have a `Clone` bound on `U` at all. There was a compile-fail test that failed due to this. I don't understand why we would want the old behaviour (and nobody on IRC could tell me either), so please tell me if there is a good reason that I missed.
2015-07-28remove `get_ident` and `get_name`, make `as_str` soundOliver Schneider-82/+65
2015-07-26Remove `ast::LocalSource` with only one used variantmitaa-4/+1
`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-25Auto merge of #27253 - bossmc:unbalanced-delimiters-cause-ice, r=nikomatsakisbors-2/+2
This introduces a test for #23389 and improves the error behaviour to treat the malformed LHS as an error, not a compiler bug. The parse phase that precedes the call to `check_lhs_nt_follows` could possibly be enhanced to police the format itself (which the old code suggests was the original intention), but I'm not sure that's any nicer than just parsing the matcher as generic rust code and then policing the specific requirements for being a macro matcher afterwards (as this does). Fixes #23389
2015-07-24Make ICE an error and use a sensible error messageAndy Caldwell-2/+2
2015-07-23review feedback: common-subexpression-elim across functions in pushpop_safe ↵Felix S. Klock II-4/+4
impl.
2015-07-23add `#[allow(unused_qualifications)]` to derived implsAndrew Paseltiner-1/+7
closes #19102
2015-07-22Allow unstable code to be injected by placement-`in` expansion.Felix S. Klock II-3/+23
(Over time the stability checking has gotten more finicky; in particular one must attach the (whole) span of the original `in PLACE BLOCK` expression to the injected references to unstable paths, as noted in the comments.) call `push_compiler_expansion` during the placement-`in` expansion.
2015-07-22Add feature-gates for desugaring-based `box` and placement-`in`.Felix S. Klock II-0/+7
update test/compile-fail/feature-gate-box-expr.rs to reflect new feature gates. Part of what lands with Issue 22181.
2015-07-22Revise placement-in expansion to use `push/pop_unsafe` and `move_val_init`.Felix S. Klock II-24/+37
2015-07-22prototype Placer protocol for unstable overloaded-box and placement-in.Felix S. Klock II-0/+114
2015-07-22Hack for "unsafety hygiene" -- `push_unsafe!` and `pop_unsafe!`.Felix S. Klock II-0/+101
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-21Avoid repeated trait bounds in derived implsFlorian Hartwig-0/+11
2015-07-21Provide a filemap ctor with line infoNick Cameron-2/+2
2015-07-13Auto merge of #27000 - alexcrichton:semi-after-type, r=cmrbors-1/+1
This commit expands the follow set of the `ty` and `path` macro fragments to include the semicolon token as well. A semicolon is already allowed after these tokens, so it's currently a little too restrictive to not have a semicolon allowed. For example: extern { fn foo() -> i32; // semicolon after type } fn main() { struct Foo; Foo; // semicolon after path }