about summary refs log tree commit diff
path: root/src/librustc_resolve
AgeCommit message (Collapse)AuthorLines
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
2019-03-16syntax: Do not accidentally treat multi-segment meta-items as single-segmentVadim Petrochenkov-12/+11
2019-03-16resolve: Account for new importable entitiesVadim Petrochenkov-11/+7
2019-03-12resolve: Simplify import resolution for mixed 2015/2018 edition modeVadim Petrochenkov-54/+4
2019-03-09use structured suggestions for E0432Andy Russell-104/+214
2019-02-27Rollup merge of #58678 - doctorn:refuse-async-fn-2015-edition, r=varkorMazdak Farrokhzad-2/+2
Deny `async fn` in 2015 edition This commit prevents code using `async fn` from being compiled in Rust 2015 edition. Compiling code of the form: ```rust async fn foo() {} ``` Will now result in the error: ``` error[E0670]: `async fn` is not permitted in the 2015 edition --> async.rs:1:1 | 1 | async fn foo() {} | ^^^^^ error: aborting due to error For more information about an error, try `rustc --explain E0670`. ``` This resolves #58652 and also resolves #53714. r? @varkor
2019-02-27rename Substs to InternalSubstscsmoe-1/+1
Change-Id: I3fa00e999a2ee4eb72db1fdf53a8633b49176a18
2019-02-24Deny `async fn` in 2015 editionNathan Corbyn-2/+2
Fix style issues and update diagnostic messages Update src/librustc_passes/diagnostics.rs Co-Authored-By: doctorn <me@nathancorbyn.com> Deny nested `async fn` in Rust 2015 edition Deny nested `async fn` in Rust 2015 edition Deny nested `async fn` in Rust 2015 edition
2019-02-23Rollup merge of #58476 - nnethercote:rm-LazyTokenStream, r=petrochenkovMazdak Farrokhzad-1/+1
Remove `LazyTokenStream`. `LazyTokenStream` was added in #40939. Perhaps it was an effective optimization then, but no longer. This PR removes it, making the code both simpler and faster. r? @alexcrichton