diff options
| author | Matthias Krüger <476013+matthiaskrgr@users.noreply.github.com> | 2025-04-30 10:18:26 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-30 10:18:26 +0200 |
| commit | b1a1c671e83300a0e865a7ce498e34d1dcebaa87 (patch) | |
| tree | 34d0e93f31df08d6de2641cc9fd38390bb71131c /compiler/rustc_middle/src | |
| parent | 56e01fe1a47541451408b2546d49b4bc4a3d6778 (diff) | |
| parent | 7275462ab9924360eaec49cfb2a02324551a250f (diff) | |
| download | rust-b1a1c671e83300a0e865a7ce498e34d1dcebaa87.tar.gz rust-b1a1c671e83300a0e865a7ce498e34d1dcebaa87.zip | |
Rollup merge of #140404 - lcnr:canonical-no-type-foldable, r=compiler-errors
rm `TypeVistable` impls for `Canonical` similar to `EarlyBinder`, you generally do not want to fold a canonical value directly without first instantiating it. In places where you do want to look into the `Canonical`, it's likely better to do so manually. r? ```@compiler-errors```
Diffstat (limited to 'compiler/rustc_middle/src')
| -rw-r--r-- | compiler/rustc_middle/src/ty/structural_impls.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/ty/typeck_results.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_middle/src/ty/structural_impls.rs b/compiler/rustc_middle/src/ty/structural_impls.rs index 2fcb2a1572a..58f7bc75054 100644 --- a/compiler/rustc_middle/src/ty/structural_impls.rs +++ b/compiler/rustc_middle/src/ty/structural_impls.rs @@ -13,7 +13,6 @@ use rustc_type_ir::{ConstKind, TypeFolder, VisitorResult, try_visit}; use super::print::PrettyPrinter; use super::{GenericArg, GenericArgKind, Pattern, Region}; -use crate::infer::canonical::CanonicalVarInfos; use crate::mir::PlaceElem; use crate::ty::print::{FmtPrinter, Printer, with_no_trimmed_paths}; use crate::ty::{ @@ -780,5 +779,4 @@ list_fold! { &'tcx ty::List<ty::PolyExistentialPredicate<'tcx>> : mk_poly_existential_predicates, &'tcx ty::List<PlaceElem<'tcx>> : mk_place_elems, &'tcx ty::List<ty::Pattern<'tcx>> : mk_patterns, - CanonicalVarInfos<'tcx> : mk_canonical_var_infos, } diff --git a/compiler/rustc_middle/src/ty/typeck_results.rs b/compiler/rustc_middle/src/ty/typeck_results.rs index 8c5827d36df..c6a45f84686 100644 --- a/compiler/rustc_middle/src/ty/typeck_results.rs +++ b/compiler/rustc_middle/src/ty/typeck_results.rs @@ -716,6 +716,8 @@ pub type CanonicalUserTypeAnnotations<'tcx> = #[derive(Clone, Debug, TyEncodable, TyDecodable, HashStable, TypeFoldable, TypeVisitable)] pub struct CanonicalUserTypeAnnotation<'tcx> { + #[type_foldable(identity)] + #[type_visitable(ignore)] pub user_ty: Box<CanonicalUserType<'tcx>>, pub span: Span, pub inferred_ty: Ty<'tcx>, |
