about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2016-05-29Auto merge of #33929 - petrochenkov:pathir, r=eddybbors-8/+4
Separate bindings from other patterns in HIR Now when name resolution is done on AST, we can avoid dumping everything that looks like an identifier into `PatKind::Ident` in HIR. `hir::PatKind::Ident` is removed, fresh bindings are now called `hir::PatKind::Binding`, everything else goes to `hir::PatKind::Path`. I intend to do something with `PatKind::Path`/`PatKind::QPath` as well using resolution results, but it requires some audit and maybe some deeper refactoring of relevant resolution/type checking code to do it properly. I'm submitting this part of the patch earlier to notify interested parties that I'm working on this. cc @jseyfried r? @eddyb
2016-05-29Auto merge of #33934 - Byron:libsyntex-ring-buffer-size, r=pnkfelixbors-2/+2
Prevent overflows by increasing ring buffer size Please note that this change is just done to prevent issues as currently seen by syntex_syntax in future. See https://github.com/serde-rs/syntex/pull/47 for details. As shown in https://github.com/serde-rs/syntex/issues/33, complex code can easily overflow the ring-buffer and cause an assertion error.
2016-05-28Prevent overflows by increasing ring buffer sizeSebastian Thiel-2/+2
Please note that this change is just done to prevent issues as currently seen by syntex_syntax in future. See https://github.com/serde-rs/syntex/pull/47 for details. As shown in https://github.com/serde-rs/syntex/issues/33, complex code can easily overflow the ring-buffer and cause an assertion error.
2016-05-28Auto merge of #33821 - sanxiyn:cfg-test, r=nikomatsakisbors-11/+3
Do not inject test harness for --cfg test Fix #33670.
2016-05-28Address review commentsVadim Petrochenkov-2/+4
2016-05-28Refactor away some functions from hir::pat_utilVadim Petrochenkov-12/+6
2016-05-28Rollup merge of #33854 - petrochenkov:prefvis, r=eddybManish Goregaokar-11/+4
Apply visit_path to import prefixes by default Overriding `visit_path` is not enough to visit all paths, some import prefixes are not visited and `visit_path_list_item` need to be overridden as well. This PR removes this catch, it should be less error prone this way. Also, the prefix is visited once now, not repeatedly for each path list item. r? @eddyb
2016-05-28Rollup merge of #33820 - jonathandturner:format_readability_updates, ↵Manish Goregaokar-0/+32
r=nikomatsakis Increase spacing in error format for readability. Two small tweaks that seem to help readability quite a bit: * Add spacing header<->snippet, but use the |> on the side for visual consistency * Fix #33819 * Fix #33763 * Move format-sensitive test (issue-26480 in cfail) to ui test r? @nikomatsakis
2016-05-27Auto merge of #33706 - jseyfried:refactor_cfg, r=nrcbors-603/+348
Perform `cfg` attribute processing during macro expansion and fix bugs This PR refactors `cfg` attribute processing and fixes bugs. More specifically: - It merges gated feature checking for stmt/expr attributes, `cfg_attr` processing, and `cfg` processing into a single fold. - This allows feature gated `cfg` variables to be used in `cfg_attr` on unconfigured items. All other feature gated attributes can already be used on unconfigured items. - It performs `cfg` attribute processing during macro expansion instead of after expansion so that macro-expanded items are configured the same as ordinary items. In particular, to match their non-expanded counterparts, - macro-expanded unconfigured macro invocations are no longer expanded, - macro-expanded unconfigured macro definitions are no longer usable, and - feature gated `cfg` variables on macro-expanded macro definitions/invocations are now errors. This is a [breaking-change]. For example, the following would break: ```rust macro_rules! m { () => { #[cfg(attr)] macro_rules! foo { () => {} } foo!(); // This will be an error macro_rules! bar { () => { fn f() {} } } #[cfg(attr)] bar!(); // This will no longer be expanded ... fn g() { f(); } // ... so that `f` will be unresolved. #[cfg(target_thread_local)] // This will be a gated feature error macro_rules! baz { () => {} } } } m!(); ``` r? @nrc
2016-05-27Comment methods in `CfgFolder`Jeffrey Seyfried-0/+7
2016-05-27Auto merge of #33900 - GuillaumeGomez:rollup, r=GuillaumeGomezbors-7/+10
Rollup of 10 pull requests - Successful merges: #33753, #33815, #33829, #33858, #33865, #33866, #33870, #33874, #33891, #33898 - Failed merges:
2016-05-27Rollup merge of #33870 - jseyfried:ice-issue-33569, r=pnkfelixGuillaume Gomez-7/+10
Fix ICE on parsing a bad metavariable in a macro definition Fixes #33569, fixes #33728. r? @pnkfelix
2016-05-27Rollup merge of #33839 - kamalmarhubi:codemape-get-filemap-option, r=nmatsakisManish Goregaokar-3/+3
This is more idiomatic, putting the caller in charge of whether or not to panic.
2016-05-27Rollup merge of #33644 - petrochenkov:selfast, r=nrcManish Goregaokar-221/+124
The AST part of https://github.com/rust-lang/rust/pull/33505. https://github.com/rust-lang/rust/pull/33505 isn't landed yet, so this PR is based on top of it. r? @nrc plugin-[breaking-change] cc #31645 @Manishearth
2016-05-27Rollup merge of #33639 - petrochenkov:dotdot, r=nmatsakisManish Goregaokar-76/+97
cc https://github.com/rust-lang/rust/issues/33627 r? @nikomatsakis plugin-[breaking-change] cc https://github.com/rust-lang/rust/issues/31645 @Manishearth
2016-05-27Rollup merge of #33351 - birkenfeld:loop-label-spans, r=pnkfelixManish Goregaokar-41/+51
This makes the \"shadowing labels\" warning *not* print the entire loop as a span, but only the lifetime. Also makes #31719 go away, but does not fix its root cause (the span of the expanded loop is still wonky, but not used anymore).
2016-05-27Refactor `expand_expr`Jeffrey Seyfried-35/+22
2016-05-27Strip unconfigured items during macro expansionJeffrey Seyfried-8/+45
2016-05-27Update spans' `expn_id` during the marking foldJeffrey Seyfried-81/+20
2016-05-27Process `cfg_attr` attributes on non-optional expressionsJeffrey Seyfried-38/+37
2016-05-26Move cfg_attr processing and stmt/expr attribute gated feature checking into ↵Jeffrey Seyfried-248/+86
`StripUnconfigured`
2016-05-26Implement `CfgFolder` directly instead of passing a closure to `strip_items`Jeffrey Seyfried-34/+29
2016-05-26Refactor `CfgFolder::in_cfg` -> `CfgFolder::configure`Jeffrey Seyfried-45/+29
2016-05-26Introduce `CfgFolder` traitJeffrey Seyfried-19/+32
2016-05-26Refactor the `syntax::config::fold_*` functions into methodsJeffrey Seyfried-147/+81
2016-05-26Add and use `HasAttrs` traitJeffrey Seyfried-77/+89
2016-05-26Auto merge of #33766 - jseyfried:cleanup_expansion, r=nrcbors-411/+186
Cleanup macro expansion and improve diagnostics Cleanup macro expansion and improve diagnostics. Fixes #33709. r? @nrc
2016-05-26Address review commentsVadim Petrochenkov-2/+6
2016-05-26Implement `..` in tuple (struct) patternsVadim Petrochenkov-76/+93
2016-05-26Fix ICE on failure to parse token treeJeffrey Seyfried-2/+5
2016-05-25parser.rs: fix typos in commentsCarlo Teubner-5/+5
2016-05-25Add a new AST-only type variant `ImplicitSelf`Vadim Petrochenkov-26/+22
2016-05-25Remove ExplicitSelf from ASTVadim Petrochenkov-217/+124
2016-05-25Auto merge of #33713 - LeoTestard:macro-rules-invalid-lhs, r=pnkfelixbors-45/+59
Make sure that macros that didn't pass LHS checking are not expanded. This avoid duplicate errors for things like invalid fragment specifiers, or parsing errors for ambiguous macros.
2016-05-24Apply visit_path to import prefixes by defaultVadim Petrochenkov-11/+4
2016-05-24Back to single line between errors. Add header space to secondary filesJonathan Turner-1/+26
2016-05-24syntax: Make codemap::get_filemap() return an OptionKamal Marhubi-3/+3
This is more idiomatic, putting the caller in charge of whether or not to panic.
2016-05-24syntax/hir: give loop labels a spanGeorg Brandl-41/+51
This makes the "shadowing labels" warning *not* print the entire loop as a span, but only the lifetime. Also makes #31719 go away, but does not fix its root cause (the span of the expanded loop is still wonky, but not used anymore).
2016-05-24Add comments and fix a nitJeffrey Seyfried-1/+9
2016-05-24Avoid iterating two times over the list of LHSes.Leo Testard-5/+4
2016-05-24Make sure that macros that didn't pass LHS checking are not expanded.Leo Testard-41/+56
This avoids duplicate errors for things like invalid fragment specifiers, or parsing errors for ambiguous macros. Fixes #29231.
2016-05-24Remove unused field and argumentSeo Sanghyeon-6/+2
2016-05-23Update error format for readability. Add spacing header<->snippet and ↵Jonathan Turner-1/+8
another line between errors
2016-05-24Do not inject test harness for --cfg testSeo Sanghyeon-5/+1
2016-05-21Move `placement_in_syntax` gated feature checking from expansion to the ↵Jeffrey Seyfried-16/+3
post-expansion visitor
2016-05-21Refactor away `check_attributes`Jeffrey Seyfried-11/+7
2016-05-21Refactor away `expand_item_mac`Jeffrey Seyfried-159/+85
2016-05-21Refactor out `mac_result` in `expand_mac_invoc`Jeffrey Seyfried-54/+53
2016-05-21Check attributes in `expand_mac_invoc`Jeffrey Seyfried-22/+12
2016-05-21Use `expand_mac_invoc` in `expand_pat`Jeffrey Seyfried-75/+3