about summary refs log tree commit diff
path: root/compiler/rustc_privacy/src
AgeCommit message (Collapse)AuthorLines
2023-12-20resolve: Eagerly feed closure visibilitiesVadim Petrochenkov-9/+0
Also factor out all tcx-dependent operations performed for every created definition into `TyCtxt::create_def`
2023-12-18resolve: Replace visibility table in resolver outputs with query feedingVadim Petrochenkov-53/+10
Also feed missing visibilities for import stems and trait impl items, which were previously evaluated lazily.
2023-12-12Move some methods from `tcx.hir()` to `tcx`zetanumbers-2/+2
Renamings: - find -> opt_hir_node - get -> hir_node - find_by_def_id -> opt_hir_node_by_def_id - get_by_def_id -> hir_node_by_def_id Fix rebase changes using removed methods Use `tcx.hir_node_by_def_id()` whenever possible in compiler Fix clippy errors Fix compiler Apply suggestions from code review Co-authored-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com> Add FIXME for `tcx.hir()` returned type about its removal Simplify with with `tcx.hir_node_by_def_id`
2023-12-08privacy: visit trait def id of projectionsDavid Wood-6/+7
A refactoring in #117076 changed the `DefIdVisitorSkeleton` to avoid calling `visit_projection_ty` for `ty::Projection` aliases, and instead just iterate over the args - this makes sense, as `visit_projection_ty` will indirectly visit all of the same args, but in doing so, will also create a `TraitRef` containing the trait's `DefId`, which also gets visited. The trait's `DefId` isn't visited when we only visit the arguments without separating them into `TraitRef` and own args first. Signed-off-by: David Wood <david@davidtw.co>
2023-12-06privacy: Simplify `update_macro_reachable`Vadim Petrochenkov-32/+9
Address a FIXME in code.
2023-12-02Auto merge of #118470 - nnethercote:cleanup-error-handlers, r=compiler-errorsbors-2/+2
Cleanup error handlers Mostly by making function naming more consistent. More to do after this, but this is enough for one PR. r? compiler-errors
2023-12-02Rename `HandlerInner::delay_span_bug` as `HandlerInner::span_delayed_bug`.Nicholas Nethercote-2/+2
Because the corresponding `Level` is `DelayedBug` and `span_delayed_bug` follows the pattern used everywhere else: `span_err`, `span_warning`, etc.
2023-12-01vis note for no pub reexports glob importbohan-20/+5
2023-11-26Rollup merge of #118311 - bvanjoi:merge_coroutinue_into_closure, r=petrochenkovGuillaume Gomez-2/+1
merge `DefKind::Coroutine` into `Defkind::Closure` Related to #118188 We no longer need to be concerned about the precise type whether it's `DefKind::Closure` or `DefKind::Coroutine`. Furthermore, thanks for the great work done by `@petrochenkov` on investigating https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Why.20does.20it.20hang.20when.20querying.20.EF.BB.BF.60opt_def_kind.60.3F r? `@petrochenkov`
2023-11-26merge `DefKind::Coroutine` into `DefKind::Closure`bohan-2/+1
2023-11-26rustc: `hir().local_def_id_to_hir_id()` -> `tcx.local_def_id_to_hir_id()` ↵Vadim Petrochenkov-6/+6
cleanup
2023-11-26Auto merge of #118250 - petrochenkov:optdefkind, r=compiler-errorsbors-1/+1
rustc: Make `def_kind` mandatory for all `DefId`s Prerequisite for https://github.com/rust-lang/rust/pull/118188.
2023-11-26Use `rustc_fluent_macro::fluent_messages!` directly.Nicholas Nethercote-2/+1
Currently we always do this: ``` use rustc_fluent_macro::fluent_messages; ... fluent_messages! { "./example.ftl" } ``` But there is no need, we can just do this everywhere: ``` rustc_fluent_macro::fluent_messages! { "./example.ftl" } ``` which is shorter.
2023-11-26Avoid need for `{D,Subd}iagnosticMessage` imports.Nicholas Nethercote-1/+0
The `fluent_messages!` macro produces uses of `crate::{D,Subd}iagnosticMessage`, which means that every crate using the macro must have this import: ``` use rustc_errors::{DiagnosticMessage, SubdiagnosticMessage}; ``` This commit changes the macro to instead use `rustc_errors::{D,Subd}iagnosticMessage`, which avoids the need for the imports.
2023-11-25rustc: Make `def_kind` mandatory for all `DefId`sVadim Petrochenkov-1/+1
2023-11-21Fix `clippy::needless_borrow` in the compilerNilstrieb-4/+4
`x clippy compiler -Aclippy::all -Wclippy::needless_borrow --fix`. Then I had to remove a few unnecessary parens and muts that were exposed now.
2023-11-15Bump cfg(bootstrap)sMark Rousskov-3/+3
2023-11-14Fix some typoscui fliter-1/+1
Signed-off-by: cui fliter <imcusg@gmail.com>
2023-10-23Merge associated types with the other alias typesOli Scherer-18/+7
2023-10-23Sync the logic for inherent and weak type aliasesOli Scherer-5/+6
2023-10-20s/Generator/Coroutine/Oli Scherer-3/+3
2023-10-13Format all the let chains in compilerMichael Goulet-2/+4
2023-10-08rustdoc: remove rust logo from non-Rust cratesMichael Howell-0/+3
2023-09-26Don't store lazyness in DefKindMichael Goulet-3/+3
2023-09-23Remove GeneratorWitness and rename GeneratorWitnessMIR.Camille GILLOT-2/+1
2023-09-11Rollup merge of #115727 - fee1-dead-contrib:effect-fallback, r=oli-obkMatthias Krüger-1/+1
Implement fallback for effect param r? `@oli-obk` or `@lcnr` tracking issue for this ongoing work: https://github.com/rust-lang/rust/issues/110395
2023-09-11add `is_host_effect` to `GenericParamDefKind::Const` and address reviewDeadbeef-1/+1
2023-09-07Lint node for PRIVATE_BOUNDS is the item which has the boundsMichael Goulet-3/+4
2023-09-01Auto merge of #113126 - Bryanskiy:delete_old, r=petrochenkovbors-429/+15
Replace old private-in-public diagnostic with type privacy lints Next part of RFC https://github.com/rust-lang/rust/issues/48054. r? `@petrochenkov`
2023-08-14Use `{Local}ModDefId` in many queriesNilstrieb-21/+37
2023-08-13Add typed `{Local}DefId` for modulesNilstrieb-1/+1
This allows for better type safety in the compiler and also improves the documentation for many things, making it clear that they expect modules.
2023-08-07Store the laziness of type aliases in the DefKindLeón Orell Valerian Liehr-3/+3
2023-08-02Remove constness from `TraitPredicate`Deadbeef-1/+1
2023-08-02Replace old private-in-public diagnostic with type privacy lintsBryanskiy-429/+15
2023-07-30Weaken unnameable_types lintBryanskiy-5/+1
2023-07-14refactor(rustc_middle): Substs -> GenericArgMahdi Dibaiee-28/+30
2023-07-08Replace RPITIT current impl with new strategy that lowers as a GATSantiago Pastorino-14/+1
2023-07-03remove TypeWellFormedFromEnvMichael Goulet-1/+0
2023-06-30Fix associated items effective visibility calculation for type privacy lintsBryanskiy-4/+7
2023-06-29Fix type privacy lints error messageBryanskiy-2/+3
2023-06-29Rollup merge of #112670 - petrochenkov:typriv, r=eholkMatthias Krüger-96/+77
privacy: Type privacy lints fixes and cleanups See individual commits. Follow up to https://github.com/rust-lang/rust/pull/111801.
2023-06-26TypeWellFormedInEnvMichael Goulet-0/+1
2023-06-26Migrate predicates_of and caller_bounds to ClauseMichael Goulet-17/+4
2023-06-22Migrate item_bounds to ty::ClauseMichael Goulet-39/+29
2023-06-19Fully fledged Clause typeMichael Goulet-2/+2
2023-06-19s/Clause/ClauseKindMichael Goulet-9/+11
2023-06-18Rollup merge of #112734 - dswij:bounds-predicates-clause, r=compiler-errorsMatthias Krüger-3/+3
Make `Bound::predicates` use `Clause` Part of #107250 `Bound::predicates` returns an iterator over `Binder<_, Clause>` instead of `Predicate`. I tried updating `explicit_predicates_of` as well, but it seems that it needs a lot more change than I thought. Will do it in a separate PR instead.
2023-06-17Move ConstEvaluatable to ClauseMichael Goulet-1/+1
2023-06-17Move WF goal to clauseMichael Goulet-1/+1
2023-06-17`Bound::predicates` to return `Clause`dswij-3/+3