about summary refs log tree commit diff
path: root/src/librustc_resolve
AgeCommit message (Collapse)AuthorLines
2020-02-01Move builtin attribute logic to new rustc_attr crate.Mazdak Farrokhzad-2/+3
For now, this is all the crate contains, but more attribute logic & types will be moved there over time.
2020-01-31Drop cfg(bootstrap) codeMark Rousskov-1/+0
2020-01-30Use `P` for `NtTraitItem`, `NtImplItem`, and `NtForeignItem`.Nicholas Nethercote-2/+2
This commit reduces the size of `Nonterminal` from a whopping 240 bytes to 72 bytes (on x86-64), which gets it below the `memcpy` threshold. It also removes some impedance mismatches with `Annotatable`, which already uses `P` for these variants.
2020-01-26Suggest defining type parameter when appropriateEsteban Küber-53/+122
``` error[E0412]: cannot find type `T` in this scope --> file.rs:3:12 | 3 | impl Trait<T> for Struct {} | - ^ not found in this scope | | | help: you might be missing a type parameter: `<T>` ``` Fix #64298.
2020-01-21Auto merge of #68267 - estebank:lt-sugg, r=petrochenkovbors-39/+115
Tweak lifetime definition errors Taking inspiration from the narrative in @fasterthanlime's https://fasterthanli.me/blog/2019/declarative-memory-management/, add suggestions to some lifetime definition errors.
2020-01-19review commentsEsteban Küber-76/+81
2020-01-19Deal with stabilization of `feature(slice_patterns)`Esteban Küber-1/+1
2020-01-19review comments: use closuresEsteban Küber-52/+31
2020-01-19review commentsEsteban Küber-3/+3
2020-01-19When encountering an expected named lifetime and none are present, suggest ↵Esteban Küber-10/+72
adding one
2020-01-19When encountering an undefined named lifetime, point to where it can beEsteban Küber-6/+36
This doesn't mention that using an existing lifetime is possible, but that would hopefully be clear as always being an option. The intention of this is to teach newcomers what the lifetime syntax is.
2020-01-18remove rustc_error_codes deps except in rustc_driverMazdak Farrokhzad-13/+0
2020-01-17Use named fields for `hir::ItemKind::Impl`Dylan MacKenzie-5/+5
2020-01-17Use named fields for `ast::ItemKind::Impl`Dylan MacKenzie-10/+10
2020-01-16resolve: Say "import" when reporting private importsVadim Petrochenkov-0/+3
2020-01-16resolve: Point at the private item definitions in privacy errorsVadim Petrochenkov-9/+15
2020-01-16resolve: Move privacy error reporting into a separate methodVadim Petrochenkov-155/+166
Give named fields to `struct PrivacyError` Move `fn report_ambiguity_error` to `diagnostics.rs`
2020-01-16Rollup merge of #68096 - varkor:diagnostic-cleanup, r=CentrilDylan DPC-5/+5
Clean up some diagnostics by making them more consistent In general: - Diagnostic should start with a lowercase letter. - Diagnostics should not end with a full stop. - Ellipses contain three dots. - Backticks should encode Rust code. I also reworded a couple of messages to make them read more clearly. It might be sensible to create a style guide for diagnostics, so these informal conventions are written down somewhere, after which we could audit the existing diagnostics. r? @Centril
2020-01-15remove redundant clones, found by clippyMatthias Krüger-1/+1
2020-01-12Fix formatting ellipses at the end of some diagnosticsvarkor-1/+1
2020-01-12Add backticks in appropriate placesvarkor-3/+3
2020-01-12Diagnostics should not end with a full stopvarkor-1/+1
2020-01-11Auto merge of #65912 - estebank:variants-orig, r=petrochenkovbors-3/+9
Point at the span for the definition of crate foreign ADTs Follow up to #65421. Partially addresses #65386. Blocked on #53081.
2020-01-11appease rustfmtMazdak Farrokhzad-2/+2
2020-01-11buffered lint infra -> rustc_sessionMazdak Farrokhzad-15/+18
2020-01-11simplify feature_err importsMazdak Farrokhzad-1/+1
2020-01-10./x.py fmtEsteban Küber-4/+5
2020-01-10Use `def_span` to minimize definition span to first line when possibleEsteban Küber-1/+4
2020-01-10Point at the span for the definition of crate foreign ADTsEsteban Küber-3/+5
2020-01-10nix syntax::errors & prefer rustc_errors over errorsMazdak Farrokhzad-27/+23
2020-01-09add CStore::item_generics_num_lifetimesMazdak Farrokhzad-2/+2
2020-01-09rename a method in Resolver traitMazdak Farrokhzad-1/+1
2020-01-09lowering: remove dep on CrateStoreMazdak Farrokhzad-3/+7
2020-01-08normalize rustc::hir::intravisit importsMazdak Farrokhzad-1/+1
2020-01-08intravisit: abstract over HIR MapMazdak Farrokhzad-6/+18
2020-01-08- remove syntax::{span_warn!, span_err!, span_fatal!. struct_err!}Mazdak Farrokhzad-72/+60
- remove syntax::{help!, span_help!, span_note!} - remove unused syntax::{struct_span_fatal, struct_span_err_or_warn!, span_err_or_warn!} - lintify check_for_bindings_named_same_as_variants + conflicting_repr_hints - inline syntax::{struct_span_warn!, diagnostic_used!} - stringify_error_code! -> error_code! & use it more. - find_plugin_registrar: de-fatalize an error - de-fatalize metadata errors - move type_error_struct! to rustc_typeck - struct_span_err! -> rustc_errors
2020-01-05Remove rustc_hir reexports in rustc::hir.Mazdak Farrokhzad-28/+30
2020-01-05simplify reexports in rustc::hirMazdak Farrokhzad-3/+3
2020-01-04Auto merge of #67803 - Centril:librustc_hir, r=Zoxcbors-31/+28
Extract `rustc_hir` out of `rustc` The new crate contains: ```rust pub mod def; pub mod def_id; mod hir; pub mod hir_id; pub mod itemlikevisit; pub mod pat_util; pub mod print; mod stable_hash_impls; pub use hir::*; pub use hir_id::*; pub use stable_hash_impls::HashStableContext; ``` Remains to be done in follow-up PRs: - Move `rustc::hir::map` into `rustc_hir_map` -- this has to be a separate crate due to the `dep_graph` (blocked on https://github.com/rust-lang/rust/pull/67761). - Move references to `rustc::hir` to `rustc_hir` where possible. cc https://github.com/rust-lang/rust/issues/65031 r? @Zoxc
2020-01-04Rollup merge of #67775 - mental32:master, r=Dylan-DPCDylan DPC-5/+1
Make "use $crate" a hard error Closes #37390
2020-01-04extract Export, ExportMap from hir::defMazdak Farrokhzad-2/+5
2020-01-04{HirId,ItemLocal}{Map,Set} -> rustc::hir & nix rustc::nodemapMazdak Farrokhzad-2/+1
2020-01-04DefId{Map,Set} -> rustc::hir::def_idMazdak Farrokhzad-4/+3
2020-01-04move Node{Map,Set} -> rustc_session::node_idMazdak Farrokhzad-3/+4
2020-01-04canonicalize FxHash{Map,Set} importsMazdak Farrokhzad-25/+20
2020-01-04Rollup merge of #67786 - Centril:canon-span, r=petrochenkovMazdak Farrokhzad-12/+12
Nix reexports from `rustc_span` in `syntax` Remove reexports `syntax::{source_map, symbol, edition}` and use `rustc_span` paths directly. r? @petrochenkov
2020-01-04Rollup merge of #66913 - VirrageS:help-self, r=varkor,CentrilMazdak Farrokhzad-1/+56
Suggest calling method when first argument is `self` Closes: #66782 I've explored different approaches for this MR but I think the most straightforward is the best one. I've tried to find out if the methods for given type exist (to maybe have a better suggestion), but we don't collect them anywhere and collecting them is quite problematic. Moreover, collecting all the methods would require rewriting big part of the code and also could potentially include performance degradation, which I don't think is necessary for this simple case.
2020-01-02Normalize `syntax::edition` imports.Mazdak Farrokhzad-1/+1
2020-01-02Normalize `syntax::symbol` imports.Mazdak Farrokhzad-8/+8
2020-01-02Normalize `syntax::source_map` imports.Mazdak Farrokhzad-3/+3