about summary refs log tree commit diff
path: root/src/librustc_resolve
AgeCommit message (Collapse)AuthorLines
2019-04-12Switch to multipart suggestions.David Wood-41/+39
This commit changes the suggestion so that it is split into multiple parts in an effort to reduce the impact the applied suggestion could have on formatting.
2019-04-12Improve robustness of nested check.David Wood-24/+25
This commit removes the assumption that the start of a use statement will always be on one line with a single space - which was silly in the first place.
2019-04-12Handle edge cases.David Wood-68/+239
This commit introduces more dirty span manipulation into the compiler in order to handle the various edge cases in moving/renaming the macro import so it is at the root of the import.
2019-04-12Handle renamed imports.David Wood-18/+19
This commit extends the suggestion to handle imports that are aliased to another name.
2019-04-12Suggest macro import from crate root.David Wood-38/+109
This commit suggests importing a macro from the root of a crate as the intent may have been to import a macro from the definition location that was annotated with `#[macro_export]`.
2019-04-11Remove duplicated redundant spansEsteban Küber-4/+3
2019-04-10clarify what the item is in "not a module" errorAndy Russell-1/+8
2019-04-04tweak unresolved label suggestionAndy Russell-2/+13
Only suggest label names in the same hygiene context, and use a structured suggestion.
2019-04-03Deny internal lints on non conflicting cratesflip1995-0/+1
- libarena - librustc_allocator - librustc_borrowck - librustc_codegen_ssa - librustc_codegen_utils - librustc_driver - librustc_errors - librustc_incremental - librustc_metadata - librustc_passes - librustc_privacy - librustc_resolve - librustc_save_analysis - librustc_target - librustc_traits - libsyntax - libsyntax_ext - libsyntax_pos
2019-04-02Rollup merge of #59166 - seanmonstar:trait-alias-import, r=alexregMazdak Farrokhzad-19/+42
resolve: collect trait aliases along with traits It seems trait aliases weren't being collected as `TraitCandidates` in resolve, this should change that. (I can't compile the full compiler locally, so relying on CI...) Fixes https://github.com/rust-lang/rust/issues/56485 r? @alexreg
2019-04-01resolve all in scope trait aliases, then elaborate their boundsSean McArthur-26/+38
2019-03-30Handle glob import in redundancy checkFabian Drinck-1/+4
2019-03-30Replace REDUNDANT_IMPORT with UNUSED_IMPORTSFabian Drinck-2/+2
2019-03-30Distinguish between imported and defined itemsFabian Drinck-1/+2
2019-03-30Improve warningFabian Drinck-10/+5
2019-03-30Edit commentsFabian Drinck-1/+3
2019-03-30Remove redundant importsFabian Drinck-1/+0
2019-03-30Add lint for redundant importsFabian Drinck-1/+92
Co-authored-by: Stephan Schauerte <stephan.schauerte@gmail.com>
2019-03-30Rollup merge of #59376 - davidtwco:finally-rfc-2008-variants, ↵Mazdak Farrokhzad-1/+9
r=petrochenkov,QuietMisdreavus RFC 2008: Enum Variants Part of #44109. See [Zulip topic](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132663140) for previous discussion. r? @petrochenkov cc @nikomatsakis
2019-03-29Fix error in Rust 2018 + no_core environmentTaiki Endo-1/+6
2019-03-28Implement `#[non_exhaustive]` on variants.David Wood-1/+9
This commit removes the check that disallows the `#[non_exhaustive]` attribute from being placed on enum variants and removes the associated tests. Further, this commit lowers the visibility of enum variant constructors when the variant is marked as non-exhaustive.
2019-03-26Rollup merge of #59267 - estebank:assoc-const-as-field, r=davidtwcoMazdak Farrokhzad-54/+41
Provide suggestion when using field access instead of path When trying to access an associated constant as if it were a field of an instance, provide a suggestion for the correct syntax. Fix #57316.
2019-03-26Rollup merge of #59150 - estebank:type-ascription, r=varkorMazdak Farrokhzad-7/+57
Expand suggestions for type ascription parse errors Fix #51222. CC #48016, #47666, #54516, #34255.
2019-03-25Auto merge of #59258 - euclio:suggestions-filter-crate, r=oli-obkbors-6/+20
filter suggestions from extern prelude Fixes #59027. Modifies the candidate gathering code to call `filter_fn` on extern crates, which causes them to be filtered out when looking for a type.
2019-03-24Deduplicate code for path suggestionEsteban Küber-62/+41
2019-03-24Provide suggestion when using field access instead of pathEsteban Küber-0/+8
When trying to access an associated constant as if it were a field of an instance, provide a suggestion for the correct syntax.
2019-03-24Auto merge of #59382 - davidtwco:rfc-2008-refactoring, r=petrochenkovbors-29/+23
Separate `DefId`s for variants and their constructors Part of #44109. Split off from #59376. See [Zulip topic](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132663140) for previous discussion. r? @petrochenkov
2019-03-24Re-order fields in `Def::Ctor`.David Wood-7/+7
This commit moves the `DefId` field of `Def::Ctor` to be the first field.
2019-03-24Move `CtorOf` into `hir::def`.David Wood-6/+6
This commit moves the definition of `CtorOf` from `rustc::hir` to `rustc::hir::def` and adds imports wherever it is used.
2019-03-24Remove `CtorOf` from `Node::Ctor`.David Wood-2/+1
This commit removes `CtorOf` from `Node::Ctor` as the parent of the constructor can be determined by looking at the node's parent in the few places where knowing this is necessary.
2019-03-24Revert changes to creation of fictive constructors for struct variantsVadim Petrochenkov-45/+13
2019-03-24Slightly more uniform treatment of struct and variant constructorsVadim Petrochenkov-2/+2
2019-03-24Rollup merge of #59355 - varkor:const-param-struct-ice, r=petrochenkovkennytm-9/+16
Fix ICE with const generic param in struct Fixes https://github.com/rust-lang/rust/issues/59340. r? @petrochenkov
2019-03-24Rollup merge of #59296 - petrochenkov:stdup, r=estebankkennytm-4/+6
Do not encode gensymed imports in metadata (Unless they are underscore `_` imports which are re-gensymed on crate loading, see https://github.com/rust-lang/rust/pull/56392.) We cannot encode gensymed imports properly in metadata and if we encode them improperly, we can get erroneous name conflicts downstream. Gensymed imports are produced by the compiler, so we control their set, and can be sure that none of them needs being encoded for use from other crates. A workaround that fixes https://github.com/rust-lang/rust/issues/59243.
2019-03-24Separate variant id and variant constructor id.David Wood-33/+60
This commit makes two changes - separating the `NodeId` that identifies an enum variant from the `NodeId` that identifies the variant's constructor; and no longer creating a `NodeId` for `Struct`-style enum variants and structs. Separation of the variant id and variant constructor id will allow the rest of RFC 2008 to be implemented by lowering the visibility of the variant's constructor without lowering the visbility of the variant itself. No longer creating a `NodeId` for `Struct`-style enum variants and structs mostly simplifies logic as previously this `NodeId` wasn't used. There were various cases where the `NodeId` wouldn't be used unless there was an unit or tuple struct or enum variant but not all uses of this `NodeId` had that condition, by removing this `NodeId`, this must be explicitly dealt with. This change mostly applied cleanly, but there were one or two cases in name resolution and one case in type check where the existing logic required a id for `Struct`-style enum variants and structs.
2019-03-23Mark duplicate import removal suggestion tool onlyEsteban Küber-1/+1
2019-03-23Hide obvious suggestion from cli outputEsteban Küber-1/+1
2019-03-23Tweak unnecessary import suggestionEsteban Küber-1/+1
2019-03-23Use `if let` instead of `match`varkor-13/+10
2019-03-22Only suggest let assignment for type ascription if we find an equals signEsteban Küber-7/+21
2019-03-22Tweak labelsEsteban Küber-2/+7
2019-03-22Expand suggestions for type ascription parse errorsEsteban Küber-5/+36
2019-03-23resolve: collect trait aliases along with traitsSean McArthur-2/+13
2019-03-22Rollup merge of #59323 - euclio:enum-instead-of-variant, r=varkorMazdak Farrokhzad-7/+14
use suggestions for "enum instead of variant" error
2019-03-22Fix ICE with const generic param in structvarkor-17/+27
2019-03-21use suggestions for "enum instead of variant" errorAndy Russell-7/+14
2019-03-19Do not encode gensymed imports in metadataVadim Petrochenkov-4/+6
2019-03-18filter suggestions from extern preludeAndy Russell-6/+20
2019-03-17Auto merge of #59047 - petrochenkov:modnodefid, r=Centrilbors-11/+7
resolve: Account for new importable entities Fixes the ICE encountered in https://github.com/rust-lang/rust/pull/58837 r? @Centril
2019-03-16Refactor away `NestedMetaItemKind`Vadim Petrochenkov-2/+2
Remove methods `Attribute::span` and `MetaItem::span` duplicating public fields