Skip to content

Commit 9334d85

Browse files
committed
remove type_op constructors
1 parent 401f9b4 commit 9334d85

3 files changed

Lines changed: 6 additions & 30 deletions

File tree

‎compiler/rustc_borrowck/src/type_check/canonical.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
137137
let _:Result<_,ErrorGuaranteed> = self.fully_perform_op(
138138
locations,
139139
category,
140-
param_env.and(type_op::prove_predicate::ProvePredicate::new(predicate)),
140+
param_env.and(type_op::prove_predicate::ProvePredicate{predicate}),
141141
);
142142
}
143143

@@ -162,7 +162,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
162162
let result:Result<_,ErrorGuaranteed> = self.fully_perform_op(
163163
location.to_locations(),
164164
category,
165-
param_env.and(type_op::normalize::Normalize::new(value)),
165+
param_env.and(type_op::normalize::Normalize{value}),
166166
);
167167
result.unwrap_or(value)
168168
}
@@ -223,7 +223,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
223223
let _:Result<_,ErrorGuaranteed> = self.fully_perform_op(
224224
Locations::All(span),
225225
ConstraintCategory::Boring,
226-
self.param_env.and(type_op::ascribe_user_type::AscribeUserType::new(mir_ty, user_ty)),
226+
self.param_env.and(type_op::ascribe_user_type::AscribeUserType{mir_ty, user_ty}),
227227
);
228228
}
229229

‎compiler/rustc_borrowck/src/type_check/free_region_relations.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ impl<'tcx> UniversalRegionRelationsBuilder<'_, 'tcx> {
280280
}
281281
letTypeOpOutput{output: norm_ty,constraints: constraints_normalize, .. } = self
282282
.param_env
283-
.and(type_op::normalize::Normalize::new(ty))
283+
.and(type_op::normalize::Normalize{value: ty })
284284
.fully_perform(self.infcx, span)
285285
.unwrap_or_else(|guar| TypeOpOutput{
286286
output:Ty::new_error(self.infcx.tcx, guar),
@@ -318,7 +318,7 @@ impl<'tcx> UniversalRegionRelationsBuilder<'_, 'tcx> {
318318
for&(ty, _)in tcx.assumed_wf_types(tcx.local_parent(defining_ty_def_id)){
319319
let result:Result<_,ErrorGuaranteed> = self
320320
.param_env
321-
.and(type_op::normalize::Normalize::new(ty))
321+
.and(type_op::normalize::Normalize{value: ty })
322322
.fully_perform(self.infcx, span);
323323
letOk(TypeOpOutput{output: norm_ty,constraints: c, .. }) = result else{
324324
continue;

‎compiler/rustc_middle/src/traits/query.rs‎

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,16 @@ use crate::infer::canonical::{Canonical, QueryResponse};
1515
usecrate::ty::{self,GenericArg,Ty,TyCtxt};
1616

1717
pubmod type_op {
18-
use std::fmt;
19-
2018
use rustc_macros::{HashStable,TypeFoldable,TypeVisitable};
2119

22-
usecrate::ty::fold::TypeFoldable;
23-
usecrate::ty::{Predicate,Ty,TyCtxt,UserType};
20+
usecrate::ty::{Predicate,Ty,UserType};
2421

2522
#[derive(Copy,Clone,Debug,Hash,PartialEq,Eq,HashStable,TypeFoldable,TypeVisitable)]
2623
pubstructAscribeUserType<'tcx>{
2724
pubmir_ty:Ty<'tcx>,
2825
pubuser_ty:UserType<'tcx>,
2926
}
3027

31-
impl<'tcx>AscribeUserType<'tcx>{
32-
pubfnnew(mir_ty:Ty<'tcx>,user_ty:UserType<'tcx>) -> Self{
33-
Self{ mir_ty, user_ty }
34-
}
35-
}
36-
3728
#[derive(Copy,Clone,Debug,Hash,PartialEq,Eq,HashStable,TypeFoldable,TypeVisitable)]
3829
pubstructEq<'tcx>{
3930
puba:Ty<'tcx>,
@@ -51,26 +42,11 @@ pub mod type_op {
5142
pubpredicate:Predicate<'tcx>,
5243
}
5344

54-
impl<'tcx>ProvePredicate<'tcx>{
55-
pubfnnew(predicate:Predicate<'tcx>) -> Self{
56-
ProvePredicate{ predicate }
57-
}
58-
}
59-
6045
#[derive(Copy,Clone,Debug,Hash,PartialEq,Eq,HashStable,TypeFoldable,TypeVisitable)]
6146
pubstructNormalize<T>{
6247
pubvalue:T,
6348
}
6449

65-
impl<'tcx,T>Normalize<T>
66-
where
67-
T: fmt::Debug + TypeFoldable<TyCtxt<'tcx>>,
68-
{
69-
pubfnnew(value:T) -> Self{
70-
Self{ value }
71-
}
72-
}
73-
7450
#[derive(Copy,Clone,Debug,Hash,PartialEq,Eq,HashStable,TypeFoldable,TypeVisitable)]
7551
pubstructImpliedOutlivesBounds<'tcx>{
7652
pubty:Ty<'tcx>,

0 commit comments

Comments
 (0)