about summary refs log tree commit diff
path: root/src/librustc_privacy
AgeCommit message (Collapse)AuthorLines
2020-04-27Accept `LocalDefId` as key for `check_mod_privacy` querymarmeladema-9/+9
2020-04-24Remove `Option` from the return type of `def_kind`.Eduard-Mihai Burtescu-5/+4
2020-04-24Split out the `Generator` case from `DefKind::Closure`.Eduard-Mihai Burtescu-3/+4
2020-04-24add a few more DefKindsmark-3/+13
make Map::def_kind take LocalDefId Co-Authored-By: Vadim Petrochenkov <vadim.petrochenkov@gmail.com> crates are DefKind::Mod
2020-04-23Address comments from reviewmarmeladema-10/+6
2020-04-23Modify `as_local_hir_id` to return a bare `HirId`marmeladema-11/+10
2020-04-23Modify `as_local_hir_id` to accept a `LocalDefId` instead of a `DefId`marmeladema-15/+26
2020-04-23librustc_middle: return LocalDefId instead of DefId in local_def_idmarmeladema-9/+12
2020-04-14Do not use `DUMMY_HIR_ID` as placeholder value in node_id_to_hir_id tablemarmeladema-1/+6
Some helpers functions have been introduced to deal with (buggy) cases where either a `NodeId` or a `DefId` do not have a corresponding `HirId`. Those cases are tracked in issue #71104.
2020-04-14Auto merge of #70643 - Rustin-Liu:rustin-patch-rename, r=eddybbors-2/+2
Rename AssocKind::Method to AssocKind::Fn Part of https://github.com/rust-lang/rust/issues/60163. https://github.com/rust-lang/rust/issues/60163#issuecomment-607284413
2020-04-14Rename AssocKind::Method to AssocKind::FnRustin-Liu-2/+2
Rename fn_has_self_argument to fn_has_self_parameter Rename AssocItemKind::Method to AssocItemKind::Fn Refine has_no_input_arg Refine has_no_input_arg Revert has_no_input_arg Refine suggestion_descr Move as_def_kind into AssocKind Signed-off-by: Rustin-Liu <rustin.liu@gmail.com> Fix tidy check issue Signed-off-by: Rustin-Liu <rustin.liu@gmail.com>
2020-04-13Remove usage of `DUMMY_HIR_ID` in some visitorsmarmeladema-4/+4
2020-04-10librustc_middle: return LocalDefId instead of DefId in get_parent_didmarmeladema-3/+4
2020-04-07fix another ICEmark-1/+1
2020-04-07fix abuses of tykind::errmark-1/+7
2020-03-30Use if let instead of match when only matching a single variant ↵Matthias Krüger-37/+31
(clippy::single_match) Makes code more compact and reduces nestig.
2020-03-30rustc -> rustc_middle part 3 (rustfmt)Mazdak Farrokhzad-7/+7
2020-03-30rustc -> rustc_middle part 2Mazdak Farrokhzad-7/+7
2020-03-30rustc -> rustc_middle part 1Mazdak Farrokhzad-1/+1
2020-03-27Rollup merge of #70344 - Centril:hir-pretty, r=eddybDylan DPC-6/+10
Decouple `rustc_hir::print` into `rustc_hir_pretty` High level summary: - The HIR pretty printer, `rustc_hir::print` is moved into a new crate `rustc_hir_pretty`. - `rustc_ast_pretty` and `rustc_errors` are dropped as `rustc_hir` dependencies. - The dependence on HIR pretty is generally reduced, leaving `rustc_save_analysis`, `rustdoc`, `rustc_metadata`, and `rustc_driver` as the remaining clients. The main goal here is to reduce `rustc_hir`'s dependencies and its size such that it can start and finish earlier, thereby working towards https://github.com/rust-lang/rust/issues/65031. r? @Zoxc
2020-03-24fmtJeremy Stucki-1/+1
2020-03-24decouple rustc_hir::print from crateMazdak Farrokhzad-6/+10
2020-03-23Increase verbosity when using update syntaxJeremy Stucki-4/+11
2020-03-22Normalize wording of privacy access labelsEsteban Küber-4/+12
2020-03-20remove redundant returns (clippy::needless_return)Matthias Krüger-2/+2
2020-03-19rustc: use LocalDefId instead of DefIndex in HirId.Eduard-Mihai Burtescu-1/+1
2020-03-18Rollup merge of #69920 - Centril:hir-cleanup, r=ZoxcMazdak Farrokhzad-2/+3
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-16Rollup merge of #69989 - petrochenkov:nolegacy, r=eddyb,matthewjasperDylan DPC-1/+1
resolve/hygiene: `macro_rules` are not "legacy" The "modern" vs "legacy" naming was introduced by jseyfried during initial implementation of macros 2.0. At this point it's clear that `macro_rules` are not going anywhere and won't be deprecated in the near future. So this PR changes the naming "legacy" (when it implies "macro_rules") to "macro_rules". This should also help people reading this code because it's wasn't obvious that "legacy" actually meant "macro_rules" in these contexts. The most contentious renaming here is probably ``` fn modern -> fn normalize_to_macros_2_0 fn modern_and_legacy -> fn normalize_to_macro_rules ``` Other alternatives that I could think of are `normalize_to_opaque`/`normalize_to_semitransparent`, or `strip_non_opaque`/`strip_transparent`, but they seemed less intuitive. The documentation to these functions can be found in `symbol.rs`. r? @matthewjasper
2020-03-16use direct imports for `rustc::{lint, session}`.Mazdak Farrokhzad-1/+2
2020-03-16remove unnecessary hir::map importsMazdak Farrokhzad-1/+1
2020-03-15More Method->Fn renamingMark Mansi-3/+2
2020-03-16ast/hir: `MacroDef::legacy` -> `MacroDef::macro_rules`Vadim Petrochenkov-1/+1
2020-03-15Auto merge of #68944 - Zoxc:hir-map, r=eddybbors-13/+13
Use queries for the HIR map r? @eddyb cc @michaelwoerister
2020-03-14Index HIR after creating TyCtxtJohn Kåre Alsaker-13/+13
2020-03-14rustc_metadata: Remove `rmeta::MacroDef`Vadim Petrochenkov-1/+1
Use `ast::MacroDef` instead. Also remove `Session::imported_macro_spans`, external macros have spans now.
2020-03-03DefKind::Method -> DefKind::AssocFnMark Mansi-2/+2
2020-03-01Auto merge of #69380 - Zoxc:parent-module, r=michaelwoeristerbors-1/+1
Use a query to get parent modules Split out from https://github.com/rust-lang/rust/pull/69015 / https://github.com/rust-lang/rust/pull/68944. r? @michaelwoerister
2020-03-01Auto merge of #69592 - petrochenkov:nosyntax, r=Centrilbors-2/+2
Rename `libsyntax` to `librustc_ast` This was the last rustc crate that wasn't following the `rustc_*` naming convention. Follow-up to https://github.com/rust-lang/rust/pull/67763.
2020-02-29Rename `syntax` to `rustc_ast` in source codeVadim Petrochenkov-2/+2
2020-02-29Make it build againVadim Petrochenkov-1/+1
2020-02-29Add a `parent_module_from_def_id` queryJohn Kåre Alsaker-1/+1
2020-02-29remove unneeded .as_ref() calls.Matthias Krüger-1/+1
2020-02-11Move more into decorate functions.jumbatm-4/+4
2020-02-11Run RustFmtjumbatm-11/+13
2020-02-11Invert control in struct_lint_level.jumbatm-14/+15
Caller now passes in a `decorate` function, which is only run if the lint is allowed.
2020-02-01Move builtin attribute logic to new rustc_attr crate.Mazdak Farrokhzad-1/+2
For now, this is all the crate contains, but more attribute logic & types will be moved there over time.
2020-01-21Rollup merge of #68140 - ecstatic-morse:const-trait-bound-opt-out, r=oli-obkMazdak Farrokhzad-2/+2
Implement `?const` opt-out for trait bounds For now, such bounds are treated exactly the same as unprefixed ones in all contexts. [RFC 2632](https://github.com/rust-lang/rfcs/pull/2632) does not specify whether such bounds are forbidden outside of `const` contexts, so they are allowed at the moment. Prior to this PR, the constness of a trait bound/impl was stored in `TraitRef`. Now, the constness of an `impl` is stored in `ast::ItemKind::Impl` and the constness of a bound in `ast::TraitBoundModifer`. Additionally, constness of trait bounds is now stored in an additional field of `ty::Predicate::Trait`, and the combination of the constness of the item along with any `TraitBoundModifier` determines the constness of the bound in accordance with the RFC. Encoding the constness of impls at the `ty` level is left for a later PR. After a discussion in \#wg-grammar on Discord, it was decided that the grammar should not encode the mutual exclusivity of trait bound modifiers. The grammar for trait bound modifiers remains `[?const] [?]`. To encode this, I add a dummy variant to `ast::TraitBoundModifier` that is used when the syntax `?const ?` appears. This variant causes an error in AST validation and disappears during HIR lowering. cc #67794 r? @oli-obk
2020-01-20Track constness while lowering boundsDylan MacKenzie-1/+1
2020-01-20Add `constness` field to `ty::Predicate::Trait`Dylan MacKenzie-1/+1
2020-01-18remove rustc_error_codes deps except in rustc_driverMazdak Farrokhzad-3/+0