summary refs log tree commit diff
path: root/compiler/rustc_privacy/src
AgeCommit message (Collapse)AuthorLines
2022-08-30Auto merge of #99893 - compiler-errors:issue-99387, r=davidtwcobors-16/+14
Delay formatting trimmed path until lint/error is emitted Fixes #99387 r? `@davidtwco`
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
2022-04-23Drop vis in ImplItem.Camille GILLOT-5/+4
2022-04-23Drop vis in FieldDef.Camille GILLOT-2/+6
2022-04-23Stop visiting visibility.Camille GILLOT-27/+6
2022-03-31Rollup merge of #95497 - nyurik:compiler-spell-comments, r=compiler-errorsDylan DPC-4/+4
Spellchecking compiler comments This PR cleans up the rest of the spelling mistakes in the compiler comments. This PR does not change any literal or code spelling issues.
2022-03-30Spellchecking compiler commentsYuri Astrakhan-4/+4
This PR cleans up the rest of the spelling mistakes in the compiler comments. This PR does not change any literal or code spelling issues.
2022-03-29Remember mutability in `DefKind::Static`.Camille GILLOT-3/+3
This allows to compute the `BodyOwnerKind` from `DefKind` only, and removes a direct dependency of some MIR queries onto HIR. As a side effect, it also simplifies metadata, since we don't need 4 flavours of `EntryKind::*Static` any more.
2022-03-16rustc_error: make ErrorReported impossible to constructmark-2/+4
There are a few places were we have to construct it, though, and a few places that are more invasive to change. To do this, we create a constructor with a long obvious name.
2022-03-11Improve `AdtDef` interning.Nicholas Nethercote-4/+5
This commit makes `AdtDef` use `Interned`. Much the commit is tedious changes to introduce getter functions. The interesting changes are in `compiler/rustc_middle/src/ty/adt.rs`.
2022-03-07remove unnecessary `..` patternsTakayuki Maeda-1/+1
2022-02-25Switch bootstrap cfgsMark Rousskov-1/+1
2022-02-24resolve: Fix incorrect results of `opt_def_kind` query for some built-in macrosVadim Petrochenkov-2/+2
Previously it always returned `MacroKind::Bang` while some of those macros are actually attributes and derives
2022-02-15Overhaul `Const`.Nicholas Nethercote-2/+2
Specifically, rename the `Const` struct as `ConstS` and re-introduce `Const` as this: ``` pub struct Const<'tcx>(&'tcx Interned<ConstS>); ``` This now matches `Ty` and `Predicate` more closely, including using pointer-based `eq` and `hash`. Notable changes: - `mk_const` now takes a `ConstS`. - `Const` was copy, despite being 48 bytes. Now `ConstS` is not, so need a we need separate arena for it, because we can't use the `Dropless` one any more. - Many `&'tcx Const<'tcx>`/`&Const<'tcx>` to `Const<'tcx>` changes - Many `ct.ty` to `ct.ty()` and `ct.val` to `ct.val()` changes. - Lots of tedious sigil fiddling.
2022-02-12change to a struct variantEllen-1/+1
2022-02-01add a rustc::query_stability lintlcnr-0/+1
2022-01-21Remove a span from hir::ExprKind::MethodCallCameron Steffen-2/+2
2022-01-20Rollup merge of #92582 - lcnr:generic-arg-infer, r=BoxyUwUMatthias Krüger-11/+3
improve `_` constants in item signature handling removing the "type" from the error messages does slightly worsen the error messages for types, but figuring out whether the placeholder is for a type or a constant and correctly dealing with that seemed fairly difficult to me so I took the easy way out :sparkles: Imo the error message is still clear enough. r? `@BoxyUwU` cc `@estebank`
2022-01-18privacy: update `visit_infer`lcnr-11/+3
2022-01-18Auto merge of #87648 - JulianKnodt:const_eq_constrain, r=oli-obkbors-6/+6
allow eq constraints on associated constants Updates #70256 (cc `@varkor,` `@Centril)`