about summary refs log tree commit diff
path: root/compiler/rustc_privacy
AgeCommit message (Collapse)AuthorLines
2023-03-31Auto merge of #109762 - scottmcm:variantdef-indexvec, r=WaffleLapkinbors-1/+1
Update `ty::VariantDef` to use `IndexVec<FieldIdx, FieldDef>` And while doing the updates for that, also uses `FieldIdx` in `ProjectionKind::Field` and `TypeckResults::field_indices`. There's more places that could use it (like `rustc_const_eval` and `LayoutS`), but I tried to keep this PR from exploding to *even more* places. Part 2/? of https://github.com/rust-lang/compiler-team/issues/606
2023-03-30Update `ty::VariantDef` to use `IndexVec<FieldIdx, FieldDef>`Scott McMurray-1/+1
And while doing the updates for that, also uses `FieldIdx` in `ProjectionKind::Field` and `TypeckResults::field_indices`. There's more places that could use it (like `rustc_const_eval` and `LayoutS`), but I tried to keep this PR from exploding to *even more* places. Part 2/? of https://github.com/rust-lang/compiler-team/issues/606
2023-03-28privacy: Support `#![rustc_effective_visibility]` on the crate rootVadim Petrochenkov-0/+1
2023-03-23Rename AliasEq -> AliasRelateMichael Goulet-1/+1
2023-03-23Include relation direction in AliasEq predicateMichael Goulet-1/+1
2023-03-21Use local key in providersMichael Goulet-3/+3
2023-03-15Rename impl_trait_in_trait_parent to impl_trait_in_trait_parent_fnSantiago Pastorino-1/+1
2023-03-11Simplify message pathsest31-1/+1
This makes it easier to open the messages file while developing on features. The commit was the result of automatted changes: for p in compiler/rustc_*; do mv $p/locales/en-US.ftl $p/messages.ftl; rmdir $p/locales; done for p in compiler/rustc_*; do sed -i "s#\.\./locales/en-US.ftl#../messages.ftl#" $p/src/lib.rs; done
2023-03-02rustc_middle: Remove trait `DefIdTree`Vadim Petrochenkov-1/+1
This trait was a way to generalize over both `TyCtxt` and `Resolver`, but now `Resolver` has access to `TyCtxt`, so this trait is no longer necessary.
2023-02-23Auto merge of #108324 - notriddle:notriddle/assoc-fn-method, ↵bors-1/+1
r=compiler-errors,davidtwco,estebank,oli-obk diagnostics: if AssocFn has self argument, describe as method Discussed in https://rust-lang.zulipchat.com/#narrow/stream/147480-t-compiler.2Fwg-diagnostics/topic/.22associated.20function.22.20vs.20.22method.22/near/329265515 This commit also changes the tooltips on rustdoc intra-doc links targeting methods. For anyone not sure why this is being done, see the Reference definitions of these terms in <https://doc.rust-lang.org/1.67.1/reference/items/associated-items.html#methods> > Associated functions whose first parameter is named `self` are called methods and may be invoked using the [method call operator](https://doc.rust-lang.org/1.67.1/reference/expressions/method-call-expr.html), for example, `x.foo()`, as well as the usual function call notation. In particular, while this means it's technically correct for rustc to refer to a method as an associated function (and there are a few cases where it'll still do so), rustc *must never* use the term "method" to refer to an associated function that does not have a `self` parameter.
2023-02-22Auto merge of #108340 - eggyal:remove_traversal_trait_aliases, r=oli-obkbors-2/+5
Remove type-traversal trait aliases #107924 moved the type traversal (folding and visiting) traits into the type library, but created trait aliases in `rustc_middle` to minimise both the API churn for trait consumers and the arising boilerplate. As mentioned in that PR, an alternative approach of defining subtraits with blanket implementations of the respective supertraits was also considered at that time but was ruled out as not adding much value. Unfortunately, it has since emerged that rust-analyzer has difficulty with these trait aliases at present, resulting in a degraded contributor experience (see the recent [r-a has become useless](https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/r-a.20has.20become.20useless) topic on the #t-compiler/help Zulip stream). This PR removes the trait aliases, and accordingly the underlying type library traits are now used directly; they are parameterised by `TyCtxt<'tcx>` rather than just the `'tcx` lifetime, and imports have been updated to reflect the fact that the trait aliases' explicitly named traits are no longer automatically brought into scope. These changes also roll-back the (no-longer required) workarounds to #107747 that were made in b409329c624b9e3bbd7d8e07697e2e9f861a45b6. Since this PR is just a find+replace together with the changes necessary for compilation & tidy to pass, it's currently just one mega-commit. Let me know if you'd like it broken up. r? `@oli-obk`
2023-02-22Remove type-traversal trait aliasesAlan Egerton-2/+5
2023-02-22diagnostics: if AssocFn has self argument, describe as methodMichael Howell-1/+1
Discussed in https://rust-lang.zulipchat.com/#narrow/stream/147480-t-compiler.2Fwg-diagnostics/topic/.22associated.20function.22.20vs.20.22method.22/near/329265515 This commit also changes the tooltips on rustdoc intra-doc links targeting methods.
2023-02-22errors: generate typed identifiers in each crateDavid Wood-2/+29
Instead of loading the Fluent resources for every crate in `rustc_error_messages`, each crate generates typed identifiers for its own diagnostics and creates a static which are pulled together in the `rustc_driver` crate and provided to the diagnostic emitter. Signed-off-by: David Wood <david.wood@huawei.com>
2023-02-17add predicate evaluation logicBoxy-1/+13
2023-02-17Auto merge of #107753 - kylematsuda:type-of, r=BoxyUwUbors-9/+9
Switch to `EarlyBinder` for `type_of` query Part of the work to finish #105779 and implement https://github.com/rust-lang/types-team/issues/78. Several queries `X` have a `bound_X` variant that wraps the output in `EarlyBinder`. This adds `EarlyBinder` to the return type of the `type_of` query and removes `bound_type_of`. r? `@lcnr`
2023-02-16remove bound_type_of query; make type_of return EarlyBinder; change type_of ↵Kyle Matsuda-9/+9
in metadata
2023-02-16change usages of type_of to bound_type_ofKyle Matsuda-9/+9
2023-02-16Deny some late-bound ty/ct in some positions, add testsMichael Goulet-1/+2
2023-02-14Add `of_trait` to DefKind::Impl.Camille GILLOT-2/+2
2023-02-13Make visiting traits generic over the InternerAlan Egerton-1/+1
2023-02-13Alias folding/visiting traits instead of re-exportAlan Egerton-1/+1
2023-02-06remove unused importsklensy-1/+0
2023-01-28Remove `HirId -> LocalDefId` map from HIR.Camille GILLOT-12/+6
2023-01-27Introduce GeneratorWitnessMIR.Camille GILLOT-1/+2
2023-01-26fix up subst_identity vs skip_binder; add some FIXMEs as identified in reviewKyle Matsuda-0/+1
2023-01-26change fn_sig query to use EarlyBinder; remove bound_fn_sig query; add ↵Kyle Matsuda-1/+1
EarlyBinder to fn_sig in metadata
2023-01-26replace usages of fn_sig query with bound_fn_sigKyle Matsuda-1/+1
2023-01-18Also remove `#![feature(control_flow_enum)]` where possibleScott McMurray-1/+0
2023-01-17Stop using `BREAK` & `CONTINUE` in compilerScott McMurray-12/+16
Switching them to `Break(())` and `Continue(())` instead. libs-api would like to remove these constants, so stop using them in compiler to make the removal PR later smaller.
2023-01-14change impl_trait_ref query to return EarlyBinder; remove ↵Kyle Matsuda-2/+2
bound_impl_trait_ref query; add EarlyBinder to impl_trait_ref in metadata
2023-01-14change usages of impl_trait_ref to bound_impl_trait_refKyle Matsuda-4/+4
2023-01-14change const_param_default query to return EarlyBinder; remove ↵Kyle Matsuda-3/+1
bound_const_param_default query; add EarlyBinder to const_param_default in metadata
2023-01-14change usages of const_param_default query to bound_const_param_defaultKyle Matsuda-1/+3
2023-01-11Change `src/test` to `tests` in source files, fix tidy and testsAlbert Larsan-1/+1
2023-01-08Auto merge of #106235 - compiler-errors:rework-bounds-collection, r=davidtwcobors-13/+16
Rework `Bounds` collection I think it's weird for the `Bounds` struct in astconv to store its predicates *almost* converted into real predicates... so we do this eagerly, instead of lazily.
2023-01-05Fix `uninlined_format_args` for some compiler cratesnils-1/+1
Convert all the crates that have had their diagnostic migration completed (except save_analysis because that will be deleted soon and apfloat because of the licensing problem).
2023-01-04rename get_parent_node to parent_idMichael Goulet-1/+1
2022-12-28Rework hir Bounds collectionMichael Goulet-13/+16
2022-12-14Prevent the creation of `TraitRef` without dedicated methodsOli Scherer-14/+13
2022-12-14Ensure no one constructs `AliasTy`s themselvesOli Scherer-1/+1
2022-12-14Auto merge of #104986 - compiler-errors:opaques, r=oli-obkbors-12/+6
Combine `ty::Projection` and `ty::Opaque` into `ty::Alias` Implements https://github.com/rust-lang/types-team/issues/79. This PR consolidates `ty::Projection` and `ty::Opaque` into a single `ty::Alias`, with an `AliasKind` and `AliasTy` type (renamed from `ty::ProjectionTy`, which is the inner data of `ty::Projection`) defined as so: ``` enum AliasKind { Projection, Opaque, } struct AliasTy<'tcx> { def_id: DefId, substs: SubstsRef<'tcx>, } ``` Since we don't have access to `TyCtxt` in type flags computation, and because repeatedly calling `DefKind` on the def-id is expensive, these two types are distinguished with `ty::AliasKind`, conveniently glob-imported into `ty::{Projection, Opaque}`. For example: ```diff match ty.kind() { - ty::Opaque(..) => + ty::Alias(ty::Opaque, ..) => {} _ => {} } ``` This PR also consolidates match arms that treated `ty::Opaque` and `ty::Projection` identically. r? `@ghost`
2022-12-13Combine projection and opaque into aliasMichael Goulet-2/+2
2022-12-13squash OpaqueTy and ProjectionTy into AliasTyMichael Goulet-9/+3
2022-12-13ProjectionTy.item_def_id -> ProjectionTy.def_idMichael Goulet-2/+2
2022-12-13Use ty::OpaqueTy everywhereMichael Goulet-1/+1
2022-12-13Make some diagnostics not depend on the source of what they reference being ↵Oli Scherer-5/+5
available
2022-12-04drive-by: move field_index to typeck resultsMichael Goulet-5/+5
2022-11-25Auto merge of #99798 - JulianKnodt:ac1, r=BoxyUwUbors-13/+2
Add `ConstKind::Expr` Starting to implement `ty::ConstKind::Abstract`, most of the match cases are stubbed out, some I was unsure what to add, others I didn't want to add until a more complete implementation was ready. r? `@lcnr`
2022-11-25Make `expand_abstract_consts` infallibleBoxy-7/+1