about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/ty/print
AgeCommit message (Collapse)AuthorLines
2023-05-23Rollup merge of #111486 - fmease:pp-inh-proj, r=petrochenkovMatthias Krüger-1/+21
Pretty-print inherent projections correctly Previously, we were trying to pretty-print inherent projections with `Printer::print_def_path` which is incorrect since it expects the substitutions to be of a certain format (parents substs followed by own substs) which doesn't hold for inherent projections (self type subst followed by own substs). Now we print inherent projections manually. Fixes #111390. Fixes #111397. Lacking tests! Is there a test suite / compiletest flags for the pretty-printer? In most if not all cases, inherent projections are normalized away before they get the chance to appear in diagnostics. If I were to create regression tests for linked issues, they would need to be `mir-opt` tests to exercise `-Zdump-mir=all` (right?) which doesn't feel quite adequate to me. `@rustbot` label F-inherent_associated_types
2023-05-22properly pretty-print inherent projectionsLeón Orell Valerian Liehr-1/+21
2023-05-17Rollup merge of #111625 - Zoxc:rustc_middle-query-move, r=cjgillotDylan DPC-1/+1
Move rustc_middle/src/ty/query.rs to rustc_middle/src/query/plumbing.rs This just keeps the query modules together. r? `@cjgillot`
2023-05-17Finish move of query.rsJohn Kåre Alsaker-1/+1
2023-05-16format `Const`'s less verboselyBoxy-29/+31
2023-05-15Move expansion of query macros in rustc_middle to rustc_middle::queryJohn Kåre Alsaker-2/+3
2023-05-08Rollup merge of #109410 - fmease:iat-alias-kind-inherent, r=compiler-errorsMichael Goulet-1/+1
Introduce `AliasKind::Inherent` for inherent associated types Allows us to check (possibly generic) inherent associated types for well-formedness. Type inference now also works properly. Follow-up to #105961. Supersedes #108430. Fixes #106722. Fixes #108957. Fixes #109768. Fixes #109789. Fixes #109790. ~Not to be merged before #108860 (`AliasKind::Weak`).~ CC `@jackh726` r? `@compiler-errors` `@rustbot` label T-types F-inherent_associated_types
2023-05-07Auto merge of #111161 - compiler-errors:rtn-super, r=cjgillotbors-0/+6
Support return-type bounds on associated methods from supertraits Support `T: Trait<method(): Bound>` when `method` comes from a supertrait, aligning it with the behavior of associated type bounds (both equality and trait bounds). The only wrinkle is that I have to extend `super_predicates_that_define_assoc_type` to look for *all* items, not just `AssocKind::Ty`. This will also be needed to support `feature(associated_const_equality)` as well, which is subtly broken when it comes to supertraits, though this PR does not fix those yet. There's a slight chance there's a perf regression here, in which case I guess I could split it out into a separate query.
2023-05-04IAT: Introduce AliasKind::InherentLeón Orell Valerian Liehr-1/+1
2023-05-04Auto merge of #110806 - WaffleLapkin:unmkI, r=lcnrbors-2/+5
Replace `tcx.mk_trait_ref` with `TraitRef::new` First step in implementing https://github.com/rust-lang/compiler-team/issues/616 r? `@lcnr`
2023-05-03Error message for ambiguous RTN from super boundsMichael Goulet-0/+6
2023-05-02Implement negative boundsMichael Goulet-0/+3
2023-04-26Remove unused `TypeFoldable`/`TypeVisitable` impls.Nicholas Nethercote-1/+1
2023-04-25Rollup merge of #110556 - kylematsuda:earlybinder-explicit-item-bounds, ↵Matthias Krüger-1/+1
r=compiler-errors Switch to `EarlyBinder` for `explicit_item_bounds` Part of the work to finish https://github.com/rust-lang/rust/issues/105779. This PR adds `EarlyBinder` to the return type of the `explicit_item_bounds` query and removes `bound_explicit_item_bounds`. r? `@compiler-errors` (hope it's okay to request you, since you reviewed #110299 and #110498 :smiley:)
2023-04-25Replace `tcx.mk_trait_ref` with `ty::TraitRef::new`Maybe Waffle-2/+5
2023-04-23Auto merge of #108118 - oli-obk:lazy_typeck, r=cjgillotbors-4/+15
Run various queries from other queries instead of explicitly in phases These are just legacy leftovers from when rustc didn't have a query system. While there are more cleanups of this sort that can be done here, I want to land them in smaller steps. This phased order of query invocations was already a lie, as any query that looks at types (e.g. the wf checks run before) can invoke e.g. const eval which invokes borrowck, which invokes typeck, ...
2023-04-22Print ty placeholders prettyMichael Goulet-1/+15
2023-04-21Allow `LocalDefId` as the argument to `def_path_str`Oli Scherer-4/+15
2023-04-20add EarlyBinder to output of explicit_item_bounds; replace ↵Kyle Matsuda-1/+1
bound_explicit_item_bounds usages; remove bound_explicit_item_bounds query
2023-04-20Remove WithOptconstParam.Camille GILLOT-4/+4
2023-04-16Remove `TypeSuper{Foldable,Visitable}` impls for `Region`.Nicholas Nethercote-1/+1
These traits exist so that folders/visitors can recurse into types of interest: binders, types, regions, predicates, and consts. But `Region` is non-recursive and cannot contain other types of interest, so its methods in these traits are trivial. This commit inlines and removes those trivial methods.
2023-04-10Fix typos in compilerDaniPopes-1/+1
2023-04-06Remove u32 on BoundTyKind::AnonJack Huey-4/+2
2023-04-06Use BoundTy and BoundRegion instead of kind of PlaceholderTy and ↵Jack Huey-4/+11
PlaceholderRegion
2023-03-23Rollup merge of #109506 - BoxyUwU:debugable_bound_var_printing, ↵Matthias Krüger-1/+5
r=compiler-errors make param bound vars visibly bound vars with -Zverbose I was trying to debug some type/const bound var stuff and it was shockingly tricky due to the fact that even with `-Zverbose` enabled the `T` in `for<T> T: Trait` prints as `T` making it seem like its `TyKind::Param` when it is infact `TyKind::Bound`. This PR "fixes" this when `-Zverbose` is set to allow rendering it as `^T` or `^1_T` depending on binder depth. r? ```@compiler-errors```
2023-03-23Printing alias-relate goals correctlyMichael Goulet-2/+1
2023-03-23Rename AliasEq -> AliasRelateMichael Goulet-1/+1
2023-03-23Include relation direction in AliasEq predicateMichael Goulet-1/+2
2023-03-23make param bound vars visibly bound varsBoxy-1/+5
2023-03-15ImplTraitPlaceholder -> is_impl_trait_in_traitSantiago Pastorino-1/+1
2023-03-02rustc_middle: Remove trait `DefIdTree`Vadim Petrochenkov-2/+2
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-22Remove type-traversal trait aliasesAlan Egerton-13/+13
2023-02-18Pretty placeholders using their namesMichael Goulet-1/+4
2023-02-17Add `Clause::ConstArgHasType` variantBoxy-4/+7
2023-02-16remove bound_type_of query; make type_of return EarlyBinder; change type_of ↵Kyle Matsuda-2/+2
in metadata
2023-02-16change usages of type_of to bound_type_ofKyle Matsuda-1/+1
2023-02-15Add specialized variants of `mk_region`.Nicholas Nethercote-9/+9
Much like there are specialized variants of `mk_ty`. This will enable some optimization in the next commit. Also rename the existing `re_error*` functions as `mk_re_error*`, for consistency.
2023-02-13Rename folder traits' `tcx` method to `interner`Alan Egerton-1/+1
2023-02-13Make folding traits generic over the InternerAlan Egerton-1/+1
2023-02-13Make visiting traits generic over the InternerAlan Egerton-1/+1
2023-02-13Alias folding/visiting traits instead of re-exportAlan Egerton-2/+2
2023-02-13Pre-intern some commonly used type variables.Nicholas Nethercote-2/+2
This requires some rearrangement of plumbing, such as adding `mk_fresh_{,int_,float_}ty` and removing `mk_ty_infer`.
2023-02-12Auto merge of #105671 - lukas-code:depreciate-char, r=scottmcmbors-1/+0
Use associated items of `char` instead of freestanding items in `core::char` The associated functions and constants on `char` have been stable since 1.52 and the freestanding items have soft-deprecated since 1.62 (https://github.com/rust-lang/rust/pull/95566). This PR ~~marks them as "deprecated in future", similar to the integer and floating point modules (`core::{i32, f32}` etc)~~ replaces all uses of `core::char::*` with `char::*` to prepare for future deprecation of `core::char::*`.
2023-02-11Auto merge of #107507 - BoxyUwU:deferred_projection_equality, r=lcnrbors-0/+1
Implement `deferred_projection_equality` for erica solver Somewhat of a revival of #96912. When relating projections now emit an `AliasEq` obligation instead of attempting to determine equality of projections that may not be as normalized as possible (i.e. because of lazy norm, or just containing inference variables that prevent us from resolving an impl). Only do this when the new solver is enabled
2023-02-10add `AliasEq` to `PredicateKind`Boxy-0/+1
2023-02-09Change to `ReError(ErrorGuaranteed)`Esteban Küber-2/+2
2023-02-09Introduce `ReError`Esteban Küber-1/+2
CC #69314
2023-02-03Rollup merge of #107585 - compiler-errors:fndef-sig-cycle, r=oli-obkDylan DPC-5/+18
Don't cause a cycle when formatting query description that references a FnDef When a function returns `-> _`, we use typeck to compute what the resulting type of the body _should_ be. If we call another query inside of typeck and hit a cycle error, we attempt to report the cycle error which requires us to compute all of the query descriptions for the stack. However, if one of the queries in that cycle has a query description that references this function as a FnDef type, we'll cause a *second* cycle error from within the cycle error reporting code, since rendering a FnDef requires us to compute its signature. This causes an unwrap to ICE, since during the *second* cycle reporting code, we try to look for a job that isn't in the active jobs list. We can avoid this by using `with_no_queries!` when computing these query descriptions. Fixes #107089 The only drawback is that the rendering of opaque types in cycles regresses a bit :| I'm open to alternate suggestions about how we may handle this...
2023-02-02Tweak misleading commentMichael Goulet-1/+1
2023-02-02Don't cause a cycle when formatting query description that references a FnDefMichael Goulet-5/+18