about summary refs log tree commit diff
path: root/src/libsyntax/ext
AgeCommit message (Collapse)AuthorLines
2016-12-23Auto merge of #38533 - jseyfried:legacy_custom_derive_deprecation, r=nrcbors-0/+2
Allow legacy custom derive authors to disable warnings in downstream crates This PR allows legacy custom derive authors to use a pre-deprecated method `registry.register_custom_derive()` instead of `registry.register_syntax_extension()` to avoid downstream deprecation warnings. r? @nrc
2016-12-23Allow legacy custom derive authors to disable warnings in downstream crates.Jeffrey Seyfried-0/+2
2016-12-22Refactor how global paths are represented (for both ast and hir).Jeffrey Seyfried-3/+7
2016-12-20Rollup merge of #38171 - jseyfried:cleanup, r=nrcAlex Crichton-140/+85
Miscellaneous cleanup/refactoring in `resolve` and `syntax::ext` r? @nrc
2016-12-19Optimize `ast::PathSegment`.Jeffrey Seyfried-17/+14
2016-12-19Auto merge of #38194 - sgrif:sg-no-span-mangling, r=nrcbors-15/+3
Don't perform span mangling when building field/tup access nodes There are no guarantees that the two spans used to create the new one come from the same place or are even valid. Fixes #36081.
2016-12-18Refactor out `mark.as_placeholder_id()`.Jeffrey Seyfried-5/+9
2016-12-18Avoid including attributes in bang macro invocations.Jeffrey Seyfried-25/+19
2016-12-18Remove scope placeholders, remove method `add_macro` of `ext::base::Resolver`.Jeffrey Seyfried-85/+38
2016-12-18Remove `MacroDef`'s fields `imported_from` and `allow_internal_unstable`,Jeffrey Seyfried-7/+4
remove `export` argument of `resolver.add_macro()`.
2016-12-18Remove some unused functions and fix formatting.Jeffrey Seyfried-6/+6
2016-12-17Auto merge of #38205 - jseyfried:fix_module_directory_regression, r=eddybbors-12/+14
macros: fix the expected paths for a non-inline module matched by an `item` fragment Fixes #38190. r? @nrc
2016-12-07macros: fix the expected paths for a non-inline module matched by an `item` ↵Jeffrey Seyfried-12/+14
fragment.
2016-12-06Don't perform span mangling when building field/tup access nodesSean Griffin-15/+3
There are no guarantees that the two spans used to create the new one come from the same place or are even valid. Fixes #36081.
2016-12-06annotate stricter lifetimes on LateLintPass methods to allow them to forward ↵Oliver Schneider-1/+1
to a Visitor
2016-11-30Support paths in macro invocations.Jeffrey Seyfried-6/+1
2016-11-22Auto merge of #37487 - goffrie:break, r=nikomatsakisbors-1/+1
Implement the `loop_break_value` feature. This implements RFC 1624, tracking issue #37339. - `FnCtxt` (in typeck) gets a stack of `LoopCtxt`s, which store the currently deduced type of that loop, the desired type, and a list of break expressions currently seen. `loop` loops get a fresh type variable as their initial type (this logic is stolen from that for arrays). `while` loops get `()`. - `break {expr}` looks up the broken loop, and unifies the type of `expr` with the type of the loop. - `break` with no expr unifies the loop's type with `()`. - When building MIR, loops no longer construct a `()` value at termination of the loop; rather, the `break` expression assigns the result of the loop. - ~~I have also changed the loop scoping in MIR-building so that the test of a while loop is not considered to be part of that loop. This makes the rules consistent with #37360. The new loop scopes in typeck also follow this rule. That means that `loop { while (break) {} }` now terminates instead of looping forever. This is technically a breaking change.~~ - ~~On that note, expressions like `while break {}` and `if break {}` no longer parse because `{}` is interpreted as an expression argument to `break`. But no code except compiler test cases should do that anyway because it makes no sense.~~ - The RFC did not make it clear, but I chose to make `break ()` inside of a `while` loop illegal, just in case we wanted to do anything with that design space in the future. This is my first time dealing with this part of rustc so I'm sure there's plenty of problems to pick on here ^_^
2016-11-21Implement the `loop_break_value` feature.Geoffry Song-1/+1
This implements RFC 1624, tracking issue #37339. - `FnCtxt` (in typeck) gets a stack of `LoopCtxt`s, which store the currently deduced type of that loop, the desired type, and a list of break expressions currently seen. `loop` loops get a fresh type variable as their initial type (this logic is stolen from that for arrays). `while` loops get `()`. - `break {expr}` looks up the broken loop, and unifies the type of `expr` with the type of the loop. - `break` with no expr unifies the loop's type with `()`. - When building MIR, `loop` loops no longer construct a `()` value at termination of the loop; rather, the `break` expression assigns the result of the loop. `while` loops are unchanged. - `break` respects contexts in which expressions may not end with braced blocks. That is, `while break { break-value } { while-body }` is illegal; this preserves backwards compatibility. - The RFC did not make it clear, but I chose to make `break ()` inside of a `while` loop illegal, just in case we wanted to do anything with that design space in the future. This is my first time dealing with this part of rustc so I'm sure there's plenty of problems to pick on here ^_^
2016-11-22Start warning cycle.Jeffrey Seyfried-1/+1
2016-11-22Clean up directory ownership semantics.Jeffrey Seyfried-22/+28
2016-11-21Cleanup `InternedString`.Jeffrey Seyfried-5/+4
2016-11-21Use `Symbol` instead of `InternedString` in the AST, HIR, and various other ↵Jeffrey Seyfried-26/+21
places.
2016-11-20Move `syntax::util::interner` -> `syntax::symbol`, cleanup.Jeffrey Seyfried-29/+30
2016-11-20Refactor `P<ast::MetaItem>` -> `ast::MetaItem`.Jeffrey Seyfried-10/+10
2016-11-20Refactor `MetaItemKind` to use `Name`s instead of `InternedString`s.Jeffrey Seyfried-11/+11
2016-11-20Refactor away `ast::Attribute_`.Jeffrey Seyfried-4/+4
2016-11-17Resolve imports during expansion.Jeffrey Seyfried-2/+13
2016-11-12Remove extra level of nesting.Mark-Simulacrum-35/+32
2016-11-12Move next_eis out of main loop to avoid re-allocating and dropping it.Mark-Simulacrum-1/+2
2016-11-12Use SmallVector for eof and bb eis.Mark-Simulacrum-6/+4
2016-11-12Factor out inner current Earley item loop.Mark-Simulacrum-146/+153
Change multiple functions to be non-public. Change nameize to accept an iterator so as to avoid an allocation.
2016-11-12Refactor parse_nt.Mark-Simulacrum-8/+13
2016-11-12Factor out NamedParseResult.Mark-Simulacrum-4/+3
2016-11-12Clean up extraneous &mut.Mark-Simulacrum-1/+1
2016-11-12Refactor to extending from a drain instead of while looping.Mark-Simulacrum-3/+1
2016-11-12Remove unused argument from nameize.Mark-Simulacrum-6/+6
Also makes nameize non-public since it's only locally used.
2016-11-12Cleanup macro_parser::parse, removing a few clones.Mark-Simulacrum-51/+35
2016-11-11Change implementation of syntax::util::SmallVector to use ↵Mark-Simulacrum-11/+11
data_structures::SmallVec.
2016-11-11Auto merge of #37246 - goffrie:no-loop, r=jseyfriedbors-1/+3
Don't spin expanding stmt macros. If we can't make progress when parsing a macro expansion as a statement then we should just bail. This alleviates the symptoms shown in e.g. #37113 and #37234 but it doesn't fix the problem that parsing invalid enum bodies (and others) leaves the parser in a crappy state. I'm not sold on this strategy (checking `tokens_consumed`), so if anyone has a better idea, I'm all ears!
2016-11-10Elimite `$crate` before invokng custom derives.Jeffrey Seyfried-0/+2
2016-11-10syntax: don't fake a block around closures' bodies during parsing.Eduard Burtescu-30/+15
2016-11-04Remove field `TtReader::next_tok`.Jeffrey Seyfried-5/+0
2016-11-04Improve `tt`-heavy expansion performance.Jeffrey Seyfried-4/+15
2016-11-03Move doc comment desugaring into the parser.Jeffrey Seyfried-28/+2
2016-11-03Avoid recontructing the `Parser` in `macro_parser.rs`.Jeffrey Seyfried-21/+16
2016-11-03Revert "macros: Improve `tt` fragments"Jeffrey Seyfried-13/+3
This reverts commit 41745f30f751364bdce14428b7d3ffa5dd028903.
2016-11-03Reduce the size of `Token` and make it cheaper to clone by refactoringJeffrey Seyfried-50/+63
`Token::Interpolated(Nonterminal)` -> `Token::Interpolated(Rc<Nonterminal>)`.
2016-10-31Changed most vec! invocations to use square bracesiirelu-47/+47
Most of the Rust community agrees that the vec! macro is clearer when called using square brackets [] instead of regular brackets (). Most of these ocurrences are from before macros allowed using different types of brackets. There is one left unchanged in a pretty-print test, as the pretty printer still wants it to have regular brackets.
2016-10-29Move `CrateConfig` from `Crate` to `ParseSess`.Jeffrey Seyfried-40/+11
2016-10-28Auto merge of #37373 - nnethercote:html5ever-more-more, r=nrcbors-11/+10
Avoid more allocations when compiling html5ever These three commits reduce the number of allocations performed when compiling html5ever from 13.2M to 10.8M, which speeds up compilation by about 2%. r? @nrc