about summary refs log tree commit diff
path: root/compiler/rustc_privacy/src
AgeCommit message (Collapse)AuthorLines
2022-09-17Rollup merge of #101713 - Bryanskiy:AccessLevels, r=petrochenkovMatthias Krüger-10/+31
change AccessLevels representation Part of RFC (https://github.com/rust-lang/rust/issues/48054). This patch implements effective visibility table with basic methods and change AccessLevels table representation according to it. r? ``@petrochenkov``
2022-09-15Only enable the let_else feature on bootstrapest31-1/+1
On later stages, the feature is already stable. Result of running: rg -l "feature.let_else" compiler/ src/librustdoc/ library/ | xargs sed -s -i "s#\\[feature.let_else#\\[cfg_attr\\(bootstrap, feature\\(let_else\\)#"
2022-09-14change AccessLevels representationBryanskiy-10/+31
2022-09-14Auto merge of #101709 - nnethercote:simplify-visitors-more, r=cjgillotbors-1/+1
Simplify visitors more A successor to #100392. r? `@cjgillot`
2022-09-12Remove `path_span` argument to the `visit_path_segment` methods.Nicholas Nethercote-1/+1
The `visit_path_segment` method of both the AST and HIR visitors has a `path_span` argument that isn't necessary. This commit removes it. There are two very small and inconsequential functional changes. - One call to `NodeCollector::insert` now is passed a path segment identifier span instead of a full path span. This span is only used in a panic message printed in the case of an internal compiler bug. - Likewise, one call to `LifetimeCollectVisitor::record_elided_anchor` now uses a path segment identifier span instead of a full path span. This span is used to make some `'_` lifetimes.
2022-09-10rustc_error, rustc_private, rustc_ast: Switch to stable hash containersNiklas Jonsson-1/+0
2022-09-09Handle generic parameters.Camille GILLOT-8/+3
2022-09-09Implement projection for ImplTraitPlaceholderMichael Goulet-1/+3
2022-09-09RPITIT placeholder itemsMichael Goulet-0/+5
2022-09-07rustc: Parameterize `ty::Visibility` over used IDVadim Petrochenkov-39/+37
It allows using `LocalDefId` instead of `DefId` when possible, and also encode cheaper `Visibility<DefIndex>` into metadata.
2022-09-02Rollup merge of #100147 - Bryanskiy:private-in-public, r=petrochenkovGuillaume Gomez-2/+68
optimization of access level table construction Refactoring which was mentioned in #87487
2022-09-01Always import all tracing macros for the entire crate instead of piecemeal ↵Oli Scherer-1/+4
by module
2022-08-31add TestReachabilityVisitorBryanskiy-2/+68
2022-08-27rustc_middle: Remove `Visibility::Invisible`Vadim Petrochenkov-1/+0
2022-08-21Replace #[lint/warning/error] with #[diag]Xiretza-7/+7
2022-08-12Adjust cfgsMark Rousskov-2/+2
2022-08-11Simplify `rustc_hir::intravisit::Visitor::visit_variant_data`.Nicholas Nethercote-7/+2
It has four arguments that are never used. This avoids lots of argument passing in functions that feed into `visit_variant_data`.
2022-08-05move DiagnosticArgFromDisplay into rustc_errorsMichael Goulet-29/+14
2022-08-05Delay formatting trimmed path until lint/error is emittedMichael Goulet-14/+27
2022-08-01Remove DefId from AssocItemContainer.Camille GILLOT-1/+1
2022-08-01Store associated item defaultness in impl_defaultness.Camille GILLOT-5/+3
2022-07-28Remove guess_head_span.Camille GILLOT-2/+1
2022-07-20clippy::perf fixesMatthias Krüger-1/+0
2022-07-15errors: lint on `LintDiagnosticBuilder::build`David Wood-24/+29
Apply the `#[rustc_lint_diagnostics]` attribute to `LintDiagnosticBuilder::build` so that diagnostic migration lints will trigger for it. Signed-off-by: David Wood <david.wood@huawei.com>
2022-07-15Remove some more usages of guess_head_spanMichael Goulet-2/+1
2022-07-12Move abstract const to rustc_middle::tykadmin-3/+2
2022-07-06Rollup merge of #98881 - cjgillot:q-def-kind, r=fee1-deadDylan DPC-1/+1
Only compute DefKind through the query.
2022-07-06Update TypeVisitor pathsAlan Egerton-3/+1
2022-07-05Relax constrained generics to TypeVisitableAlan Egerton-2/+4
2022-07-04Only compute DefKind through the query.Camille GILLOT-1/+1
2022-06-29Auto merge of #98542 - jackh726:coinductive-wf, r=oli-obkbors-0/+1
Make empty bounds lower to `WellFormed` and make `WellFormed` coinductive r? rust-lang/types
2022-06-28Make empty bounds lower to WellFormed and make WellFormed coinductiveJack Huey-0/+1
2022-06-27privacy: deny diagnostic migration lintsDavid Wood-1/+4
Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-27privacy: port "in public interface" diagDavid Wood-12/+56
Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-27privacy: port unnamed "item is private" diagDavid Wood-7/+12
Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-27privacy: port "item is private" diagDavid Wood-6/+16
Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-27privacy: port "field is private" diagDavid Wood-16/+43
Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-12Make `ExprKind::Closure` a struct variant.Camille GILLOT-1/+1
2022-06-08Folding revamp.Nicholas Nethercote-3/+3
This commit makes type folding more like the way chalk does it. Currently, `TypeFoldable` has `fold_with` and `super_fold_with` methods. - `fold_with` is the standard entry point, and defaults to calling `super_fold_with`. - `super_fold_with` does the actual work of traversing a type. - For a few types of interest (`Ty`, `Region`, etc.) `fold_with` instead calls into a `TypeFolder`, which can then call back into `super_fold_with`. With the new approach, `TypeFoldable` has `fold_with` and `TypeSuperFoldable` has `super_fold_with`. - `fold_with` is still the standard entry point, *and* it does the actual work of traversing a type, for all types except types of interest. - `super_fold_with` is only implemented for the types of interest. Benefits of the new model. - I find it easier to understand. The distinction between types of interest and other types is clearer, and `super_fold_with` doesn't exist for most types. - With the current model is easy to get confused and implement a `super_fold_with` method that should be left defaulted. (Some of the precursor commits fixed such cases.) - With the current model it's easy to call `super_fold_with` within `TypeFolder` impls where `fold_with` should be called. The new approach makes this mistake impossible, and this commit fixes a number of such cases. - It's potentially faster, because it avoids the `fold_with` -> `super_fold_with` call in all cases except types of interest. A lot of the time the compile would inline those away, but not necessarily always.
2022-06-03Fully stabilize NLLJack Huey-1/+0
2022-05-18Rollup merge of #97096 - tmiasko:reachable-constructor, r=petrochenkovYuki Okushi-1/+15
Types with reachable constructors are reachable Fixes #96934. r? `@petrochenkov`
2022-05-17Types with reachable constructors are reachableTomasz Miąsko-1/+15
2022-05-13remove redundant branchMiguel Guarniz-11/+0
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-05-13remove Visitor impl for PrivateItemsInPublicInterfacesCheckerMiguel Guarniz-81/+95
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-05-02rustc: Panic by default in `DefIdTree::parent`Vadim Petrochenkov-6/+4
Only crate root def-ids don't have a parent, and in majority of cases the argument of `DefIdTree::parent` cannot be a crate root. So we now panic by default in `parent` and introduce a new non-panicing function `opt_parent` for cases where the argument can be a crate root. Same applies to `local_parent`/`opt_local_parent`.
2022-04-30Store all generic bounds as where predicates.Camille GILLOT-5/+0
2022-04-30Inline WhereClause into Generics.Camille GILLOT-1/+1
2022-04-23Compute has_pub_restricted in the resolver.Camille GILLOT-12/+4
2022-04-23Fix lints.Camille GILLOT-1/+1
2022-04-23Drop vis in Item.Camille GILLOT-8/+5