about summary refs log tree commit diff
path: root/src/librustc_resolve
AgeCommit message (Collapse)AuthorLines
2019-09-15Auto merge of #64483 - petrochenkov:expectattr2, r=Centrilbors-4/+3
resolve: Tweak some "cannot find" wording for macros
2019-09-15resolve: Remove `!` from "cannot find" diagnostics for macrosVadim Petrochenkov-2/+1
2019-09-15resolve: Tweak "cannot find" wording for attributesVadim Petrochenkov-3/+3
2019-09-15Auto merge of #64469 - matthewjasper:increase-hygiene-use, r=petrochenkovbors-22/+22
Cleanup handling of hygiene for built-in macros This makes most identifiers generated by built-in macros use def-site hygiene, not only the ones that previously used gensyms. * `ExtCtxt::ident_of` now takes a `Span` and is preferred to `Ident::{from_str, from_str_and_span}` * Remove `Span::with_legacy_ctxt` * `assert` now uses call-site hygiene because it needs to resolve `panic` unhygienically. * `concat_idents` now uses call-site hygiene because it wouldn't be very useful with def-site hygiene. * everything else is moved to def-site hygiene r? @petrochenkov
2019-09-15Prefer `Symbol` to `Ident` when there's no sensible `Span`Matthew Jasper-22/+22
2019-09-14resolve: Tweak some expected/found wordingVadim Petrochenkov-2/+3
2019-09-09Rollup merge of #64054 - estebank:unused-import-is-to-eager, r=petrochenkovMazdak Farrokhzad-34/+55
Always emit unresolved import errors and hide unused import lint Fix https://github.com/rust-lang/rust/issues/63724. r? @petrochenkov
2019-09-09Resolve attributes in several placesCaio-46/+120
Arm, Field, FieldPat, GenericParam, Param, StructField and Variant
2019-09-08Always emit unresolved import errors and hide unused import lintEsteban Küber-34/+55
2019-09-08Rollup merge of #64265 - petrochenkov:useerr, r=estebankMazdak Farrokhzad-0/+8
resolve: Mark more erroneous imports as used Fixes https://github.com/rust-lang/rust/issues/63724 r? @estebank
2019-09-08Rollup merge of #64177 - petrochenkov:curmod, r=matthewjasperMazdak Farrokhzad-9/+10
resolve: Do not afraid to set current module to enums and traits After https://github.com/rust-lang/rust/pull/63535/commits/cfbb60bf6d83fbcfcca1f2919131aa39fb997b53 it's ok. This is likely required for https://github.com/rust-lang/rust/pull/63468 to work correctly, because that PR starts resolving attributes on enum variants. r? @matthewjasper @c410-f3r
2019-09-08Rollup merge of #64066 - petrochenkov:softstab, r=matthewjasperMazdak Farrokhzad-2/+2
Support "soft" feature-gating using a lint Use it for feature-gating `#[bench]`. Closes https://github.com/rust-lang/rust/issues/63798.
2019-09-07Support "soft" feature-gating using a lintVadim Petrochenkov-2/+2
Use it for feature-gating `#[bench]`
2019-09-07resolve: Mark more erroneous imports as usedVadim Petrochenkov-0/+8
2019-09-07Rollup merge of #64139 - Mark-Simulacrum:strip-legacy-proc-macro, r=petrochenkovMazdak Farrokhzad-27/+17
Migrate internal diagnostic registration to macro_rules Review is best done commit-by-commit. Fixes #64132.
2019-09-07resolve: Adjust `hygienic_lexical_parent` to account for enum and trait modulesVadim Petrochenkov-1/+1
2019-09-07resolve: Do not afraid to set current module to enums and traitsVadim Petrochenkov-8/+9
2019-09-07Rollup merge of #63919 - matthewjasper:remove-gensymmed, r=petrochenkovMazdak Farrokhzad-17/+70
Use hygiene for AST passes AST passes are now able to have resolve consider their expansions as if they were opaque macros defined either in some module in the current crate, or a fake empty module with `#[no_implicit_prelude]`. * Add an ExpnKind for AST passes. * Remove gensyms in AST passes. * Remove gensyms in`#[test]`, `#[bench]` and `#[test_case]`. * Allow opaque macros to define tests. * Move tests for unit tests to their own directory. * Remove `Ident::{gensym, is_gensymed}` - `Ident::gensym_if_underscore` still exists. cc #60869, #61019 r? @petrochenkov
2019-09-05Simplify std lib injectionMatthew Jasper-5/+15
2019-09-05Remove rustc_diagnostic_macros featureMark Rousskov-1/+0
2019-09-05Replace diagnostic plugins with macro_rulesMark Rousskov-26/+17
2019-09-05Add `with_{def_site,call_site,legacy}_ctxt,` methods to `Span`Vadim Petrochenkov-15/+12
Use these to create call-site spans for AST passes when needed.
2019-09-05Remove `Ident::{gensym, is_gensymed}`Matthew Jasper-6/+2
`gensym_if_underscore` still exists. The symbol interner can still create arbitray gensyms, this is just not exposed publicly.
2019-09-05Make use of hygiene in AST passesMatthew Jasper-10/+0
2019-09-05Allow ast passes to create hygienic spansMatthew Jasper-2/+62
2019-09-05resolve: bool -> enum PatBoundCtxMazdak Farrokhzad-18/+29
2019-09-05or-patterns: address review comments.Mazdak Farrokhzad-4/+23
2019-09-05resolve: merge `resolve_pats` and `resolve_pattern_top`.Mazdak Farrokhzad-19/+6
2019-09-05resolve: account for general or-patterns in consistency checking.Mazdak Farrokhzad-45/+82
2019-09-05resolve: revamp already-bound check -- fix some bugs.Mazdak Farrokhzad-59/+79
2019-09-05resolve: already-bound-check: account for or-patterns.Mazdak Farrokhzad-47/+73
Also document `ast::Pat::walk`.
2019-09-05resolve: move `resolve_block` to a better place.Mazdak Farrokhzad-43/+43
2019-09-05resolve: move `fresh_binding`.Mazdak Farrokhzad-55/+52
2019-09-05resolve: add `type IdentMap<T>` alias.Mazdak Farrokhzad-5/+7
2019-09-05resolve: extract `try_resolve_as_non_binding`.Mazdak Farrokhzad-57/+69
2019-09-05resolve: simplify `resolve_arm`.Mazdak Farrokhzad-3/+1
2019-09-05resolve: cleanup using `with_rib`, etc.Mazdak Farrokhzad-145/+118
2019-09-05resolve: extract `resolve_params`.Mazdak Farrokhzad-20/+15
2019-08-29Rollup merge of #63867 - petrochenkov:dhelpers, r=matthewjasperMazdak Farrokhzad-21/+20
resolve: Block expansion of a derive container until all its derives are resolved So, it turns out there's one more reason to block expansion of a `#[derive]` container until all the derives inside it are resolved, beside `Copy` (https://github.com/rust-lang/rust/pull/63248). The set of derive helper attributes registered by derives in the container also has to be known before the derives themselves are expanded, otherwise it may be too late (see https://github.com/rust-lang/rust/pull/63468#issuecomment-524550872 and the `#[stable_hasher]`-related test failures in https://github.com/rust-lang/rust/pull/63468). So, we stop our attempts to unblock the container earlier, as soon as the `Copy` status is known, and just block until all its derives are resolved. After all the derives are resolved we immediately go and process their helper attributes in the item, without delaying it until expansion of the individual derives. Unblocks https://github.com/rust-lang/rust/pull/63468 r? @matthewjasper (as a reviewer of https://github.com/rust-lang/rust/pull/63248) cc @c410-f3r
2019-08-27metadata: Eliminate `FullProcMacro`Vadim Petrochenkov-8/+8
Fix caching of loaded proc macros
2019-08-27resolve: Block expansion of a derive container until all its derives are ↵Vadim Petrochenkov-21/+20
resolved Also mark derive helpers as known as a part of the derive container's expansion instead of expansion of the derives themselves which may happen too late.
2019-08-23resolve: Do not rely on default transparency when detecting proc macro derivesVadim Petrochenkov-5/+9
2019-08-21resolve/expand: Rename some things for clarity and add commentsVadim Petrochenkov-14/+22
2019-08-21expand: Keep the correct current expansion ID for eager expansionsVadim Petrochenkov-1/+3
Solve the problem of `ParentScope` entries for eager expansions not exising in the resolver map by creating them on demand.
2019-08-17resolve/expand: Rename some things for clarityVadim Petrochenkov-22/+22
2019-08-17resolve: Properly integrate derives and `macro_rules` scopesVadim Petrochenkov-13/+21
2019-08-17Move type parameter shadowing errors to resolveMatthew Jasper-10/+53
For some reason type checking did this. Further it didn't consider hygiene.
2019-08-16Fix rebaseVadim Petrochenkov-9/+12
Move some code into `build_reduced_graph.rs` to keep `BuildReducedGraphVisitor` it private Also move the def collector call to `build_reduced_graph.rs`, it belongs there.
2019-08-16resolve: Move some code aroundVadim Petrochenkov-74/+73
2019-08-16resolve: Populate external traits lazily as wellVadim Petrochenkov-22/+9