about summary refs log tree commit diff
path: root/src/librustc_resolve
AgeCommit message (Collapse)AuthorLines
2018-09-13introduce SelfCtorF001-102/+71
2018-09-13implement feature tuple_struct_self_ctorF001-13/+65
2018-09-13resolve: Future proof derive helper attributesVadim Petrochenkov-38/+36
2018-09-13resolve: Put different parent scopes into a single structureVadim Petrochenkov-66/+102
2018-09-12Auto merge of #53793 - toidiu:ak-stabalize, r=nikomatsakisbors-1/+0
stabilize outlives requirements https://github.com/rust-lang/rust/issues/44493 r? @nikomatsakis
2018-09-11stabalize infer outlives requirements (RFC 2093).toidiu-1/+0
Co-authored-by: nikomatsakis
2018-09-11Split `CrateNum` into an enum instead of having magic constantsOliver Schneider-7/+7
2018-09-11resolve: Reserve a few very special names in macro namespaceVadim Petrochenkov-0/+14
2018-09-11resolve: Skip bang macros when resolving potentially built-in attributesVadim Petrochenkov-32/+29
2018-09-11resolve: Future proof resolutions for potentially built-in attributesVadim Petrochenkov-0/+32
2018-09-11resolve: Support resolving identifier macros without their own IDVadim Petrochenkov-42/+44
Invocation/expansion ID (aka `Mark`) is not really necessary for resolving a macro path. What is really necessary is its parent module, parent expansion and parent legacy scope. This is required for validation resolutions of built-in attributes, which don't get their own `Mark`s
2018-09-10Auto merge of #54011 - eddyb:anchored-in-the-future, r=petrochenkovbors-47/+57
rustc_resolve: inject `uniform_paths` canaries regardless of the feature-gate, on Rust 2018. This PR is an attempt at future-proofing "anchored paths" by emitting the same ambiguity errors that `#![feature(uniform_paths)]` would, with slightly changed phrasing (see added UI tests). Also, on top of #54005, this PR allows this as well: ```rust use crate_name; use crate_name::foo; ``` In that any ambiguity between an extern crate and an import *of that same crate* is ignored. r? @petrochenkov cc @aturon @Centril @joshtriplett
2018-09-10rustc_resolve: ignore uniform_paths canaries that resolve to an import of ↵Eduard-Mihai Burtescu-43/+39
the same crate.
2018-09-10rustc_resolve: inject `uniform_paths` canaries regardless of the ↵Eduard-Mihai Burtescu-6/+20
feature-gate, on Rust 2018.
2018-09-10Auto merge of #53565 - PramodBisht:issue/53359_b, r=estebankbors-19/+44
#53359: putting multiple unresolved import on single line r? @estebank Here is WIP implementation of #53359 this PR have clubbed multiple unresolved imports into a single line. I think still two things need to improve like giving specific `label message` for each span of multi_span(how we can do this?) and second we are getting a warning while compiling, stating something like `E0432` have been passed before.
2018-09-10resolve: Remove `unshadowable_attrs`Vadim Petrochenkov-29/+24
2018-09-10resolve: Split macro prelude into built-in and user-defined partsVadim Petrochenkov-33/+48
2018-09-09Auto merge of #53778 - petrochenkov:shadrelax2, r=nikomatsakisbors-203/+246
resolve: Relax shadowing restrictions on macro-expanded macros Previously any macro-expanded macros weren't allowed to shadow macros from outer scopes. Now only "more macro-expanded" macros cannot shadow "less macro-expanded" macros. See comments to `fn may_appear_after` and added tests for more details and examples. The functional changes are a21f6f588fc28c97533130ae44a6957b579ab58c and 46dd365ce9ca0a6b8653849b80267763c542842a, other commits are refactorings.
2018-09-09Auto merge of #53902 - dtolnay:group, r=petrochenkovbors-2/+3
proc_macro::Group::span_open and span_close Before this addition, every delimited group like `(`...`)` `[`...`]` `{`...`}` has only a single Span that covers the full source location from opening delimiter to closing delimiter. This makes it impossible for a procedural macro to trigger an error pointing to just the opening or closing delimiter. The Rust compiler does not seem to have the same limitation: ```rust mod m { type T = } ``` ```console error: expected type, found `}` --> src/main.rs:3:1 | 3 | } | ^ ``` On that same input, a procedural macro would be forced to trigger the error on the last token inside the block, on the entire block, or on the next token after the block, none of which is really what you want for an error like above. This commit adds `group.span_open()` and `group.span_close()` which access the Span associated with just the opening delimiter and just the closing delimiter of the group. Relevant to Syn as we implement real error messages for when parsing fails in a procedural macro: https://github.com/dtolnay/syn/issues/476. ```diff impl Group { fn span(&self) -> Span; + fn span_open(&self) -> Span; + fn span_close(&self) -> Span; } ``` Fixes #48187 r? @alexcrichton
2018-09-09Auto merge of #53988 - eddyb:issue-53770, r=petrochenkovbors-41/+37
rustc_resolve: only prepend CrateRoot to a non-keyword segment. Fixes #53770 by treating `use` paths as absolute in a finer-grained manner, specifically: ```rust use {a, crate::b, self::c, super::d}; ``` Used to be interpreted as if it were (when `uniform_paths` is not enabled): ```rust use ::{a, crate::b, self::c, super::d}; ``` With this PR, the `CrateRoot` pseudo-keyword indicating an absolute path is only inserted when the first path segment is found (if it's not a keyword), i.e. the example behaves like: ```rust use {::a, crate::b, self::c, super::d}; ``` This should (finally) make `use {path};` fully equivalent to `use path;`. r? @petrochenkov cc @cramertj @joshtriplett @nikomatsakis
2018-09-09Auto merge of #53960 - estebank:issue-51303, r=nagisabors-5/+18
Fix incorrect outer function type parameter message Fix #51303.
2018-09-08Track distinct spans for open and close delimiterDavid Tolnay-2/+3
2018-09-08Fixed 53359: E0432 unresolved import on the same line is now emiting one ↵Pramod Bisht-19/+44
diagnostic Addressed estebank's comments for 53359
2018-09-08resolve: More precise spans for ambiguous resolution errorsVadim Petrochenkov-28/+22
Add labels to ambiguous resolution errors
2018-09-08Add checks for expected macro output in restricted shadowing testsVadim Petrochenkov-0/+2
2018-09-08resolve: Further simplify legacy scopes, add commentsVadim Petrochenkov-40/+45
2018-09-08resolve: Rename some fields related to legacy macro scopesVadim Petrochenkov-51/+60
2018-09-08resolve: Relax shadowing restriction on macro-expanded macrosVadim Petrochenkov-3/+12
... for both legacy and modern macros. Fix previously introduced regressions, add tests.
2018-09-08resolve: Introduce "may appear after" abstraction for macro path resolutionsVadim Petrochenkov-21/+49
2018-09-08resolve: Cleanup two main macro resolution functions, tweak some commentsVadim Petrochenkov-64/+50
2018-09-08resolve: Model shadowing restriction for macro_rules after modern macrosVadim Petrochenkov-23/+16
This is a regression for legacy macros that will be fixed in the next commit
2018-09-08resolve: Model `resolve_legacy_scope` after `resolve_lexical_macro_path_segment`Vadim Petrochenkov-51/+91
2018-09-08resolve: Partially unify bindings from macro_rules and from other itemsVadim Petrochenkov-55/+32
2018-09-08Rollup merge of #53993 - eddyb:issue-53691, r=petrochenkovkennytm-1/+9
rustc_resolve: don't record uniform_paths canaries as reexports. Fixes #53691, fixes #53484.
2018-09-07rustc_resolve: only prepend CrateRoot to a non-keyword segment.Eduard-Mihai Burtescu-41/+37
2018-09-06rustc_resolve: allow `use crate_name;` under `uniform_paths`.Eduard-Mihai Burtescu-17/+26
2018-09-06rustc_resolve: don't record uniform_paths canaries as reexports.Eduard-Mihai Burtescu-1/+9
2018-09-05reword label as per reviewEsteban Küber-1/+1
2018-09-05slight rewording of labelsEsteban Küber-13/+19
2018-09-05Fix incorrect outer function type parameter messageEsteban Küber-1/+8
2018-09-04Move #[test_case] to a syntax extensionJohn Renner-1/+1
2018-09-04Fix #[test] shadowing in macro_preludeJohn Renner-2/+23
2018-09-04Introduce Custom Test FrameworksJohn Renner-0/+4
2018-09-01Auto merge of #53815 - F001:if-let-guard, r=petrochenkovbors-1/+4
refactor match guard This is the first step to implement RFC 2294: if-let-guard. Tracking issue: https://github.com/rust-lang/rust/issues/51114 The second step should be introducing another variant `IfLet` in the Guard enum. I separated them into 2 PRs for the convenience of reviewers. r? @petrochenkov
2018-08-30Rollup merge of #53655 - jcpst:with_applicability, r=estebankPietro Albini-21/+41
set applicability Update a few more calls as described in #50723 r? @estebank
2018-08-30introduce Guard enumF001-1/+4
2018-08-27Auto merge of #51456 - qmx:crate-in-path, r=nikomatsakisbors-22/+66
resolve suggestions should use `crate::` when enabled I couldn't find a way to add a specific assertion for the ui test, so the expected output is living under the `crates-in-path.stderr` ui test. - is this the right place for the test? fixes #51212
2018-08-27Auto merge of #53441 - toidiu:ak-fix53419, r=nikomatsakisbors-0/+1
fix for late-bound regions Fix for https://github.com/rust-lang/rust/issues/53419 r? @nikomatsakis
2018-08-27no need to special case stdDouglas Campos-8/+4
2018-08-25call span_suggestion with applicabilityJoseph Post-21/+41