summary refs log tree commit diff
path: root/src/librustc_resolve
AgeCommit message (Collapse)AuthorLines
2016-07-01Add the `after_expand` entry point between import resolution and the rest of ↵Jeffrey Seyfried-17/+6
name resolution
2016-06-29Rollup merge of #34542 - jseyfried:fix_recursive_modules, r=nrcManish Goregaokar-1/+3
Fix non-termination on recursive module re-exports in extern crates Fixes #33776. r? @nrc
2016-06-29Rollup merge of #34467 - GuillaumeGomez:err-codes, r=brsonManish Goregaokar-82/+207
Add new error codes and improve some explanations r? @brson cc @steveklabnik cc @jonathandturner
2016-06-28Fix infinite loop on recursive module exports in an extern crateJeffrey Seyfried-1/+3
2016-06-28groundwork: create the `Resolver` earlier in phase 2Jeffrey Seyfried-7/+4
2016-06-28groundwork: refactor the interface that `resolve` exposes to `driver`Jeffrey Seyfried-45/+30
2016-06-28groundwork: use `resolve_identifier` instead of `resolve_path` to classify ↵Jeffrey Seyfried-5/+6
ident patterns
2016-06-26Rollup merge of #34316 - jseyfried:refactor_ast_stmt, r=eddybJeffrey Seyfried-13/+7
Refactor away `ast::Decl`, refactor `ast::Stmt`, and rename `ast::ExprKind::Again` to `ast::ExprKind::Continue`.
2016-06-26Rollup merge of #33943 - jseyfried:libsyntax_cleanup, r=nrcJeffrey Seyfried-6/+6
Miscellaneous low priority cleanup in `libsyntax`.
2016-06-26Add new error codes and improve some explanationsGuillaume Gomez-82/+207
2016-06-25Rollup merge of #34403 - jonathandturner:move_liberror, r=alexcrichtonJeffrey Seyfried-10/+16
This PR refactors the 'errors' part of libsyntax into its own crate (librustc_errors). This is the first part of a few refactorings to simplify error reporting and potentially support more output formats (like a standardized JSON output and possibly an --explain mode that can work with the user's code), though this PR stands on its own and doesn't assume further changes. As part of separating out the errors crate, I have also refactored the code position portion of codemap into its own crate (libsyntax_pos). While it's helpful to have the common code positions in a separate crate for the new errors crate, this may also enable further simplifications in the future.
2016-06-25Rollup merge of #34368 - petrochenkov:astqpath, r=ManishearthJeffrey Seyfried-11/+2
The AST part of https://github.com/rust-lang/rust/pull/34365 plugin-[breaking-change] cc https://github.com/rust-lang/rust/issues/31645
2016-06-25Rollup merge of #34213 - josephDunne:trait_item_macros, r=jseyfriedJeffrey Seyfried-0/+2
**syntax-[breaking-change]** cc #31645 New `TraitItemKind::Macro` variant This change adds support for macro expansion inside trait items by adding the new `TraitItemKind::Macro` and associated parsing code.
2016-06-23Move errors from libsyntax to its own crateJonathan Turner-10/+16
2016-06-23Improve diagnostics E0425: `use` (public) itemsLiigo Zhuang-0/+11
E0425: unresolved name
2016-06-20Merge PatKind::QPath into PatKind::Path in ASTVadim Petrochenkov-11/+2
2016-06-18Remove unused functions calls and unused E0406Guillaume Gomez-33/+1
2016-06-17Rename `ast::ExprKind::Again` -> `ast::ExprKind::Continue`Jeffrey Seyfried-1/+1
2016-06-17Fix falloutJeffrey Seyfried-12/+6
2016-06-14Remove the type parameter from `syntax::visit::Visitor`Jeffrey Seyfried-6/+6
2016-06-13Add support for macro expansion inside trait itemsJoseph Dunne-0/+2
2016-06-10Address review comments + fix rebaseVadim Petrochenkov-151/+41
2016-06-10Introduce TyCtxt::expect_def/expect_resolution helpers and use them where ↵Vadim Petrochenkov-38/+29
possible
2016-06-10Move the hack with fake partial resolution for <A>::B from typeck to resolveVadim Petrochenkov-83/+37
2016-06-10resolve: Rewrite resolve_patternVadim Petrochenkov-436/+282
2016-06-07Refactor away the prelude injection passJeffrey Seyfried-15/+30
2016-06-06Refactor away method `resolve_name_in_lexical_scope` of `ModuleS`Jeffrey Seyfried-31/+19
2016-06-06Rollup merge of #33955 - zackmdavis:explain_E0429, r=GuillaumeGomezEduard-Mihai Burtescu-1/+24
add explanation for E0429 (`self` use declaration must use brace syntax) This is an item under #32777. r? @GuillaumeGomez
2016-06-02Auto merge of #33878 - GuillaumeGomez:improve_helps, r=jonathandturnerbors-7/+15
Improve help messages for E0425 Fixes #33876. r? @Manishearth cc @steveklabnik cc @jonathandturner
2016-06-02Improve help messages for E0425ggomez-7/+15
2016-06-01Auto merge of #33794 - petrochenkov:sanity, r=nrcbors-36/+3
Add AST validation pass and move some checks to it The purpose of this pass is to catch constructions that fit into AST data structures, but not permitted by the language. As an example, `impl`s don't have visibilities, but for convenience and uniformity with other items they are represented with a structure `Item` which has `Visibility` field. This pass is intended to run after expansion of macros and syntax extensions (and before lowering to HIR), so it can catch erroneous constructions that were generated by them. This pass allows to remove ad hoc semantic checks from the parser, which can be overruled by syntax extensions and occasionally macros. The checks can be put here if they are simple, local, don't require results of any complex analysis like name resolution or type checking and maybe don't logically fall into other passes. I expect most of errors generated by this pass to be non-fatal and allowing the compilation to proceed. I intend to move some more checks to this pass later and maybe extend it with new checks, like, for example, identifier validity. Given that syntax extensions are going to be stabilized in the measurable future, it's important that they would not be able to subvert usual language rules. In this patch I've added two new checks - a check for labels named `'static` and a check for lifetimes and labels named `'_`. The first one gives a hard error, the second one - a future compatibility warning. Fixes https://github.com/rust-lang/rust/issues/33059 ([breaking-change]) cc https://github.com/rust-lang/rfcs/pull/1177 r? @nrc
2016-06-01Rollup merge of #33967 - dsprenkels:enum_pattern_resolve_ice, r=petrochenkovManish Goregaokar-7/+10
resolve: record pattern def when `resolve_pattern` returns `Err(true)` I propose a fix for issue #33293. In 1a374b8, (pr #33046) fixed the error reporting of a specific case, but the change that was introduced did not make sure that `record_def` was called in all cases, which lead to an ICE in [1]. This change restores the original `else` case, but keeps the changes that were committed in 1a374b8. [1] `rustc::middle::mem_categorization::MemCategorizationContext::cat_pattern_`
2016-05-30revise explanation for E0429 (focus on error first)Zack M. Davis-9/+7
2016-05-30librustc_resolve: make sure pattern def gets recorded if `resolve_path` ↵Daan Sprenkels-7/+10
returns `Err(true)` In 1a374b8, (pr #33046) fixed the error reporting of a specific case, but the change that was introduced did not make sure that `record_def` was called in all cases, which lead to an ICE in [1]. This change restores the original `else` case, but keeps the changes that were committed in 1a374b8. This commit fixes issue #33293. [1] `rustc::middle::mem_categorization::MemCategorizationContext::cat_pattern_`
2016-05-30Rollup merge of #33793 - GuillaumeGomez:compile_fail, r=GuillaumeGomezManish Goregaokar-1/+1
Fix compile_fail tag Fixes #33780 r? @steveklabnik
2016-05-29add explanation for E0429 (`self` use declaration must use brace syntax)Zack M. Davis-1/+26
This is an item under #32777.
2016-05-28Move some other checks to AST sanity passVadim Petrochenkov-36/+3
2016-05-27Rollup merge of #33644 - petrochenkov:selfast, r=nrcManish Goregaokar-10/+6
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-1/+1
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-3/+3
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-27* Fix compile_fail tag (in some cases, it compiled whereas it wasn't ↵Guillaume Gomez-1/+1
expected to and was still considered 'ok') * Fix error explanations tests/tags
2016-05-26Implement `..` in tuple (struct) patternsVadim Petrochenkov-1/+1
2016-05-25Fix rebaseVadim Petrochenkov-8/+4
2016-05-25Remove ExplicitSelf from ASTVadim Petrochenkov-2/+2
2016-05-24Auto merge of #33615 - GuillaumeGomez:field_static_method, r=pnkfelixbors-22/+64
Don't suggest using fields in a static method Fixes #33613. cc @LeoTestard
2016-05-24syntax/hir: give loop labels a spanGeorg Brandl-3/+3
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-23Don't suggest using fields in a static methodggomez-22/+64
2016-05-18ignore dep-graph in resolve and lower_crateNiko Matsakis-0/+1
This got removed at some point, it seems.
2016-05-16lowering: Rename identifiers only when necessaryVadim Petrochenkov-0/+4
Do not rename invalid identifiers, they stop being invalid after renaming
2016-05-16Remove hir::IdentVadim Petrochenkov-1/+1