1
Fork 0

Auto merge of #101947 - aliemjay:astconv-normalize, r=lcnr

Don't normalize in AstConv

See individual commits.

Fixes #101350
Fixes #54940
This commit is contained in:
bors 2023-01-09 15:29:59 +00:00
commit af58fc8699
43 changed files with 1182 additions and 503 deletions

View file

@ -15,22 +15,19 @@ use rustc_span::source_map::Span;
pub mod type_op {
use crate::ty::fold::TypeFoldable;
use crate::ty::subst::UserSubsts;
use crate::ty::{Predicate, Ty};
use rustc_hir::def_id::DefId;
use crate::ty::{Predicate, Ty, UserType};
use std::fmt;
#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq, HashStable, Lift)]
#[derive(TypeFoldable, TypeVisitable)]
pub struct AscribeUserType<'tcx> {
pub mir_ty: Ty<'tcx>,
pub def_id: DefId,
pub user_substs: UserSubsts<'tcx>,
pub user_ty: UserType<'tcx>,
}
impl<'tcx> AscribeUserType<'tcx> {
pub fn new(mir_ty: Ty<'tcx>, def_id: DefId, user_substs: UserSubsts<'tcx>) -> Self {
Self { mir_ty, def_id, user_substs }
pub fn new(mir_ty: Ty<'tcx>, user_ty: UserType<'tcx>) -> Self {
Self { mir_ty, user_ty }
}
}

View file

@ -679,7 +679,7 @@ impl<'tcx> CanonicalUserType<'tcx> {
/// from constants that are named via paths, like `Foo::<A>::new` and
/// so forth.
#[derive(Copy, Clone, Debug, PartialEq, TyEncodable, TyDecodable)]
#[derive(HashStable, TypeFoldable, TypeVisitable, Lift)]
#[derive(Eq, Hash, HashStable, TypeFoldable, TypeVisitable, Lift)]
pub enum UserType<'tcx> {
Ty(Ty<'tcx>),