summary refs log tree commit diff
path: root/src/librustc_resolve/lib.rs
AgeCommit message (Collapse)AuthorLines
2020-05-30Use `LocalDefId` instead of `NodeId` in `resolve_str_path_error`marmeladema-5/+2
2020-05-29Remove remaining calls to `as_local_node_id`marmeladema-15/+25
2020-05-27Store `LocalDefId` directly in `rustc_resolve::Resolver` where possiblemarmeladema-47/+16
This commit also include the following changes: * Remove unused `hir::Map::as_local_node_id` method * Remove outdated comment about `hir::Map::local_def_id` method * Remove confusing `GlobMap` type alias * Use `LocalDefId` instead of `DefId` in `extern_crate_map` * Use `LocalDefId` instead of `DefId` in `maybe_unused_extern_crates` * Modify `extern_mod_stmt_cnum` query to accept a `LocalDefId` instead of a `DefId`
2020-05-24Rollup merge of #72402 - marmeladema:resolver-outputs-def-id, r=ecstatic-morseRalf Jung-13/+101
Remove all uses of `NodeId` in `ResolverOutputs` cc #50928 r? @ecstatic-morse
2020-05-22Remove `macro_defs` mapAaron Hill-8/+3
We store store the `DefId` directly in `ExpnData`. This will allow us to serialize `ExpnData` in PR #72121 without needing to manage a side table.
2020-05-21Replace unecessary calls to `.clone()` by argument binding pattern for ↵marmeladema-11/+11
`Copy` types
2020-05-21Use `collect()` instead of manually inserting elements into mapsmarmeladema-46/+42
2020-05-21Use `DefId` in `ResolverOutputs::extern_crate_map` instead of `NodeId`marmeladema-2/+15
2020-05-21Use `DefId` in `ResolverOutputs::glob_map` instead of `NodeId`marmeladema-2/+11
2020-05-21Use `DefId` in `ResolverOutputs::maybe_unused_extern_crates` instead of `NodeId`marmeladema-2/+11
2020-05-21Use `LocalDefId` in `ResolverOutputs::maybe_unused_trait_imports` instead of ↵marmeladema-2/+11
`NodeId`
2020-05-21Use `HirId` in `ResolverOutputs::export_map` instead of `NodeId`marmeladema-2/+25
2020-05-21Use `HirId` in value of `ResolverOutputs::trait_map` instead of `NodeId`marmeladema-3/+17
2020-05-21Use `HirId` as key for `ResolverOutputs::trait_map` instead of `NodeId`marmeladema-2/+17
2020-05-19Suggest fixes for `use foo::self`mibac138-1/+1
2020-05-08Remove ast::{Ident, Name} reexports.Camille GILLOT-26/+26
2020-05-02fix rustdoc warningsTshepang Lekhonkhobe-1/+1
2020-04-27Rollup merge of #71419 - contrun:wrong-namespace-rustc-resolve, r=petrochenkovDylan DPC-45/+83
add message for resolution failure because wrong namespace closes https://github.com/rust-lang/rust/issues/71406
2020-04-26use defkind.descr in wrong namespace resolve failureYI-18/+21
2020-04-26Rollup merge of #70043 - mark-i-m:def-kind-more, r=eddybDylan DPC-3/+1
Add all remaining `DefKind`s. r? @eddyb or @Centril ~~I'm not sure if this is what you were thinking of. There are also a few places where I'm not sure what the correct choice is because I don't fully understand the meaning of some variants.~~ ~~In general, it feels a bit odd to add some of these as `DefKind`s (e.g. `Arm`) because they don't feel like definitions. Are there things that it makes sense not to add?~~
2020-04-24Avoid unused Option::map resultsJosh Stone-1/+3
These are changes that would be needed if we add `#[must_use]` to `Option::map`, per #71484.
2020-04-24add a few more DefKindsmark-3/+1
make Map::def_kind take LocalDefId Co-Authored-By: Vadim Petrochenkov <vadim.petrochenkov@gmail.com> crates are DefKind::Mod
2020-04-22add message for resolution failure because wrong namespaceYI-45/+80
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