summary refs log tree commit diff
path: root/src/librustc_resolve/lib.rs
AgeCommit message (Collapse)AuthorLines
2016-02-26Auto merge of #31857 - jseyfried:fix_scoping, r=nikomatsakisbors-19/+27
This fixes a bug (#31845) introduced in #31105 in which lexical scopes contain items from all anonymous module ancestors, even if the path to the anonymous module includes a normal module: ```rust fn f() { fn g() {} mod foo { fn h() { g(); // This erroneously resolves on nightly } } } ``` This is a [breaking-change] on nightly but not on stable or beta. r? @nikomatsakis
2016-02-24Improve unused import detectionJeffrey Seyfried-4/+6
2016-02-24Resolve: include normal modules in the ribsJeffrey Seyfried-15/+21
2016-02-24Fix the visibility of extern crate declarations and stop warning on pub ↵Jeffrey Seyfried-10/+37
extern crate
2016-02-20Auto merge of #31747 - jseyfried:stop_resolve_after_fail, r=nrcbors-23/+5
Now that #31461 is merged, a failing resolution can never become indeterminate or succeed, so we no longer have to keep trying to resolve failing import directives. r? @nrc
2016-02-20Auto merge of #31674 - VladUreche:issue/21221, r=nikomatsakisbors-26/+231
This commit adds functionality that allows the name resolution pass to search for entities (traits/types/enums/structs) by name, in order to show recommendations along with the errors. For now, only E0405 and E0412 have suggestions attached, as per the request in bug #21221, but it's likely other errors can also benefit from the ability to generate suggestions.
2016-02-19Auto merge of #31742 - frewsxcv:needless-lifetimes, r=pnkfelixbors-3/+3
These explicit lifetimes can be ommitted because of lifetime elision rules. Instances were found using rust-clippy.
2016-02-19Auto merge of #31716 - jseyfried:fix_privacy_for_def_err, r=nrcbors-0/+1
Fixes #31714
2016-02-19Show candidates for names not in scopeVlad Ureche-26/+231
This commit adds functionality that allows the name resolution pass to search for entities (traits/types/enums/structs) by name, in order to show recommendations along with the errors. For now, only E0405 and E0412 have suggestions attached, as per the request in bug #21221, but it's likely other errors can also benefit from the ability to generate suggestions.
2016-02-18Remove unnecessary explicit lifetime bounds.Corey Farwell-3/+3
These explicit lifetimes can be ommitted because of lifetime elision rules. Instances were found using rust-clippy.
2016-02-18Replace the field `imports` in Module with `unresolved_imports` and refactor ↵Jeffrey Seyfried-23/+5
away `resolved_import_count`
2016-02-17Auto merge of #31685 - petrochenkov:patrefact2, r=eddybbors-16/+12
And split `PatKind::Enum` into `PatKind::TupleStruct` and `PatKind::Path`. This is the HIR part of https://github.com/rust-lang/rust/pull/31581. This is also kind of a preparation for https://github.com/rust-lang/rfcs/pull/1492. r? @eddyb
2016-02-16Don't compute LastPrivate data for Def::Err.Jeffrey Seyfried-0/+1
2016-02-16Split PatKind::Enum into PatKind::TupleStruct and PatKind::PathVadim Petrochenkov-8/+5
2016-02-14Rename hir::Pat_ and its variantsVadim Petrochenkov-11/+10
2016-02-14Rename Module field anonymous_children to module_children, expand it to ↵Jeffrey Seyfried-50/+11
include both named an anonymous modules, and fix #31644
2016-02-14Rename Module field children to resolutionsJeffrey Seyfried-7/+7
2016-02-12Autoderef in librustc_resolveJonas Schievink-36/+36
2016-02-11[breaking-change] don't glob export ast::{UintTy, IntTy} variantsOliver Schneider-12/+11
2016-02-11[breaking-change] don't glob export ast::FloatTy variantsOliver Schneider-4/+4
2016-02-08Reallow methods from traits that are shadowed by non-import itemsJeffrey Seyfried-2/+26
2016-02-08Replace children and import_resolutions with a single NameResolution-valued map.Jeffrey Seyfried-111/+64
Refactor away resolve_name_in_module in resolve_imports.rs Rewrite and improve the core name resolution procedure in NameResolution::result and Module::resolve_name Refactor the duplicate checking code into NameResolution::try_define
2016-02-08Change try_define_child to return a Result instead of an OptionJeffrey Seyfried-3/+3
2016-02-08Write and use increment_outstanding_references_for and ↵Jeffrey Seyfried-0/+20
decrement_outstanding_references_for
2016-02-08Refactor away the fields id and is_public of ImportResolution and rename ↵Jeffrey Seyfried-14/+21
ImportResolution to NameResolution
2016-02-08Refactor away separate tracking of used_public and used_reexport.Jeffrey Seyfried-21/+18
NameBinding now encodes these directly with binding.is_public() and (binding.is_public() && binding.is_import()) (respectively)
2016-02-08Expand NameBinding to better represent bindings from importsJeffrey Seyfried-12/+26
2016-02-08Add and use an arena for `NameBinding`sJeffrey Seyfried-13/+18
2016-02-08Refactor away TargetJeffrey Seyfried-28/+28
2016-02-08Make resolve_name_in_module solely responsible for tracking used crates in ↵Jeffrey Seyfried-12/+6
lib.rs
2016-02-05Instrument a bunch of tasks that employ the HIR map in one way orNiko Matsakis-0/+10
another and were not previously instrumented.
2016-02-03Remove unneeded borrows and slicesJeffrey Seyfried-5/+5
2016-02-03Remove unneeded use of CellJeffrey Seyfried-6/+6
2016-02-03Refactor away resolve_item_by_name_in_lexical_scopeJeffrey Seyfried-45/+10
2016-02-03Refactor resolve_import_for_moduleJeffrey Seyfried-6/+8
2016-02-03Refactor away resolve_module_in_lexical_scopeJeffrey Seyfried-34/+11
2016-02-03Refactor more functionality into record_import_useJeffrey Seyfried-24/+14
2016-02-03Refactor resolve_item_in_lexical_scopeJeffrey Seyfried-56/+18
2016-02-03Improve detection of unused importsJeffrey Seyfried-10/+15
2016-02-02Add fake import resolutions & targets for names in bad importsDirk Gadsden-2/+3
2016-01-31Refactor away the field Module::external_module_children in resolveJeffrey Seyfried-72/+32
2016-01-29Remove resolve::dump_moduleJeffrey Seyfried-29/+0
2016-01-29Nits and other local improvements in resolveJeffrey Seyfried-16/+12
2016-01-29Refactor away NameBindings, NsDef, ImportResolutionPerNamespace, ↵Jeffrey Seyfried-228/+72
DuplicateCheckingMode, and NamespaceDefinition.
2016-01-29Auto merge of #31212 - jseyfried:fix_ICE_in_resolve, r=nrcbors-70/+14
This fixes an ICE introduced by #31065 that occurs when a path cannot be resolved because of a certain class of unresolved import (`Indeterminate` imports). For example, this currently causes an ICE: ```rust mod foo { pub use self::*; } fn main() { foo::f() } ``` r? @nrc
2016-01-29Auto merge of #31144 - jseyfried:remove_import_ordering_restriction, r=nrcbors-23/+0
We no longer require `use` and `extern crate` items to precede other items in modules thanks to [RFC #385](https://github.com/rust-lang/rfcs/pull/385), but we still require `use` and `extern crate` items to precede statements in blocks (other items can appear anywhere in a block). I think that this is a needless distinction between imports and other items that contradicts the intent of the RFC.
2016-01-28Refactor away NameSearchTypeJeffrey Seyfried-52/+10
2016-01-28Resolve: Fix an ICE that occurs when an identifier refers to an ↵Jeffrey Seyfried-18/+4
indeterminate import (i.e. one that is not resolved and not known to have failed)
2016-01-26Auto merge of #31120 - alexcrichton:attribute-deny-warnings, r=brsonbors-0/+1
This commit removes the `-D warnings` flag being passed through the makefiles to all crates to instead be a crate attribute. We want these attributes always applied for all our standard builds, and this is more amenable to Cargo-based builds as well. Note that all `deny(warnings)` attributes are gated with a `cfg(stage0)` attribute currently to match the same semantics we have today
2016-01-26Auto merge of #31105 - jseyfried:fix_lexical_scoping, r=nrcbors-30/+50
This fixes #23880, a scoping bug in which items in a block are shadowed by local variables and type parameters that are in scope. After this PR, an item in a block will shadow any local variables or type parameters above the item in the scope hierarchy. Items in a block will continue to be shadowed by local variables in the same block (even if the item is defined after the local variable). This is a [breaking-change]. For example, the following code breaks: ```rust fn foo() { let mut f = 1; { fn f() {} f += 1; // This will resolve to the function instead of the local variable } }