summary refs log tree commit diff
path: root/src/librustc_resolve/lib.rs
AgeCommit message (Collapse)AuthorLines
2020-04-19Dogfood more or_patterns in the compilerJosh Stone-8/+9
2020-04-09Auto merge of #70909 - marmeladema:issue70853/librustc_hir-local-def-id, r=eddybbors-3/+3
librustc_hir: return LocalDefId instead of DefId in local_def_id Its a first try to remove a few calls to `expect_local` and use `LocalDefId` instead of `DefId` where possible for #70853 This adds some calls to `.to_def_id()` to get a `DefId` back when needed. I don't know if I should push `LocalDefId` even further and change, for example, `Res::Def` to accept a `LocalDefId` instead of a `DefId` as second argument. cc @ecstatic-morse
2020-04-07Do not suggest adding type param when `use` is already suggestedEsteban Küber-2/+1
Fix #70365, cc #70572.
2020-04-08librustc_hir: return LocalDefId instead of DefId in local_def_idmarmeladema-3/+3
2020-04-01Rollup merge of #70081 - lcnr:issue68387, r=varkorDylan DPC-1/+1
add `unused_braces` lint Add the lint `unused_braces` which is warn by default. `unused_parens` is also extended and now checks anon consts. closes #68387 r? @varkor
2020-03-31fix internal lint falloutBastian Kauschke-1/+1
2020-03-30try_resolve_as_non_binding: span_bug -> delay_span_bugMazdak Farrokhzad-0/+1
2020-03-30rustc -> rustc_middle part 3 (rustfmt)Mazdak Farrokhzad-5/+5
2020-03-30rustc -> rustc_middle part 2Mazdak Farrokhzad-5/+5
2020-03-25Rename `def_span` to `guess_head_span`Esteban Küber-2/+3
2020-03-24normalize some imports, prefer direct ones.Mazdak Farrokhzad-1/+1
2020-03-22don't create variable bindings just to return the bound value immediately ↵Matthias Krüger-3/+2
(clippy::let_and_return)
2020-03-19rustc: use LocalDefId instead of DefIndex in hir::map::definitions.Eduard-Mihai Burtescu-5/+9
2020-03-18Rollup merge of #69920 - Centril:hir-cleanup, r=ZoxcMazdak Farrokhzad-1/+1
Remove some imports to the rustc crate - When we have `NestedVisitorMap::None`, we use `type Map = dyn intravisit::Map<'v>;` instead of the actual map. This doesn't actually result in dynamic dispatch (in the future we may want to use an associated type default to simplify the code). - Use `rustc_session::` imports instead of `rustc::{session, lint}`. r? @Zoxc
2020-03-17Rollup merge of #70000 - petrochenkov:rawkeypars, r=davidtwcoMazdak Farrokhzad-4/+1
resolve: Fix regression in resolution of raw keywords in paths Fixes https://github.com/rust-lang/rust/issues/63882.
2020-03-16use direct imports for `rustc::{lint, session}`.Mazdak Farrokhzad-1/+1
2020-03-16hygiene: `modern` -> `normalize_to_macros_2_0`Vadim Petrochenkov-23/+23
`modern_and_legacy` -> `normalize_to_macro_rules`
2020-03-16Other `legacy` -> `macro_rules`Vadim Petrochenkov-13/+15
2020-03-16resolve: `Legacy(Scope,Binding)` -> `MacroRules(Scope,Binding)`Vadim Petrochenkov-17/+27
2020-03-15resolve: Prevent fresh bindings from shadowing ambiguity itemsVadim Petrochenkov-7/+0
Correctly treat const generic parameters in fresh binding disambiguation
2020-03-14resolve: Fix regression in resolution of raw keywords in pathsVadim Petrochenkov-4/+1
2020-03-14Rollup merge of #69802 - matthiaskrgr:cl1ppy, r=Dylan-DPCYuki Okushi-5/+1
fix more clippy findings * reduce references on match patterns (clippy::match_ref_pats) * Use writeln!(fmt, "word") instead of write!(fmt, "word\n") (clippy::write_with_newline) * libtest: remove redundant argument to writeln!() (clippy::writeln_empty_string) * remove unneeded mutable references (cippy::unnecessary_mut_passed) * libtest: declare variables as floats instead of casting them (clippy::unnecessary_cast) * rustdoc: remove redundant static lifetimes (clippy::redundant_static_lifetimes) * call .as_deref() instead of .as_ref().map(Deref::deref) (clippy::option_as_ref_deref) * iterate over a maps values directly. (clippy::for_kv_map) * rustdoc: simplify boolean condition (clippy::nonminimal_bool) * Use ?-operator in more places (clippy::question_mark, had some false negatives fixed recently) * rustdoc: Use .any(p) instead of find(p).is_some(). (clippy::search_is_some) * rustdoc: don't call into_iter() on iterator. (clippy::identity_conversion)
2020-03-12Rollup merge of #69674 - mark-i-m:assoc-fn, r=matthewjasperMazdak Farrokhzad-1/+1
Rename DefKind::Method and TraitItemKind::Method r? @eddyb, @Centril, or @matthewjasper cc #69498 #60163
2020-03-07Use ?-operator in more places (clippy::question_mark, had some false ↵Matthias Krüger-5/+1
negatives fixed recently)
2020-03-07resolve: `directive` -> `import`Vadim Petrochenkov-39/+38
2020-03-07resolve: `ImportDirective` -> `Import`Vadim Petrochenkov-22/+18
`ImportDirectiveSubclass` -> `ImportKind` `ImportKind::SingleImport` -> `ImportKind::Single` `ImportKind::GlobImport` -> `ImportKind::Glob`
2020-03-03DefKind::Method -> DefKind::AssocFnMark Mansi-1/+1
2020-02-29Rename `syntax` to `rustc_ast` in source codeVadim Petrochenkov-7/+7
2020-02-27use char instead of &str for single char patternsMatthias Krüger-1/+1
2020-02-24resolve: `lifetimes.rs` -> `late/lifetime.rs`Vadim Petrochenkov-2/+1
2020-02-13Make TraitCandidate generic.Camille GILLOT-3/+3
2020-02-13Use HirId in TraitCandidate.Camille GILLOT-2/+2
2020-02-07Remove unused feature gate from librustc_resolvebjorn3-1/+0
2020-02-04Auto merge of #68708 - Mark-Simulacrum:stage0-step, r=pietroalbinibors-1/+0
Step stage0 to bootstrap from 1.42 This also includes a commit which fixes the rustfmt downloading logic to redownload when the rustfmt channel changes, and bumps rustfmt to a more recent version.
2020-02-01syntax::print -> new crate rustc_ast_prettyMazdak Farrokhzad-1/+1
2020-02-011. move node_id to syntaxMazdak Farrokhzad-1/+1
2. invert rustc_session & syntax deps 3. drop rustc_session dep in rustc_hir
2020-01-31Drop cfg(bootstrap) codeMark Rousskov-1/+0
2020-01-26Suggest defining type parameter when appropriateEsteban Küber-1/+8
``` 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-0/+1
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-19Deal with stabilization of `feature(slice_patterns)`Esteban Küber-1/+1
2020-01-19When encountering an undefined named lifetime, point to where it can beEsteban Küber-0/+1
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-2/+0
2020-01-16resolve: Move privacy error reporting into a separate methodVadim Petrochenkov-152/+10
Give named fields to `struct PrivacyError` Move `fn report_ambiguity_error` to `diagnostics.rs`
2020-01-12Diagnostics should not end with a full stopvarkor-1/+1
2020-01-11buffered lint infra -> rustc_sessionMazdak Farrokhzad-12/+14
2020-01-10nix syntax::errors & prefer rustc_errors over errorsMazdak Farrokhzad-1/+1
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-08- remove syntax::{span_warn!, span_err!, span_fatal!. struct_err!}Mazdak Farrokhzad-2/+2
- 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