Skip to content

Commit ae33a00

Browse files
committed
Rename SuperVisit to TypeSuperVisitable
1 parent 5f5370f commit ae33a00

File tree

7 files changed

+20
-20
lines changed

7 files changed

+20
-20
lines changed

chalk-derive/src/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ enum DeriveKind {
119119

120120
decl_derive!([HasInterner, attributes(has_interner)] => derive_has_interner);
121121
decl_derive!([TypeVisitable, attributes(has_interner)] => derive_type_visitable);
122-
decl_derive!([SuperVisit, attributes(has_interner)] => derive_super_visit);
122+
decl_derive!([TypeSuperVisitable, attributes(has_interner)] => derive_type_super_visitable);
123123
decl_derive!([TypeFoldable, attributes(has_interner)] => derive_type_foldable);
124124
decl_derive!([Zip, attributes(has_interner)] => derive_zip);
125125

@@ -148,11 +148,11 @@ fn derive_type_visitable(s: synstructure::Structure) -> TokenStream {
148148
)
149149
}
150150

151-
/// Same as TypeVisitable, but derives SuperVisit instead
152-
fn derive_super_visit(s: synstructure::Structure) -> TokenStream {
151+
/// Same as TypeVisitable, but derives TypeSuperVisitable instead
152+
fn derive_type_super_visitable(s: synstructure::Structure) -> TokenStream {
153153
derive_any_type_visitable(
154154
s,
155-
parse_quote! { SuperVisit },
155+
parse_quote! { TypeSuperVisitable },
156156
parse_quote! { super_visit_with },
157157
)
158158
}

chalk-ir/src/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ extern crate self as chalk_ir;
99
use crate::cast::{Cast, CastTo, Caster};
1010
use crate::fold::shift::Shift;
1111
use crate::fold::{Folder, Subst, TypeFoldable, TypeSuperFoldable};
12-
use crate::visit::{SuperVisit, TypeVisitable, VisitExt, Visitor};
13-
use chalk_derive::{HasInterner, SuperVisit, TypeFoldable, TypeVisitable, Zip};
12+
use crate::visit::{TypeSuperVisitable, TypeVisitable, VisitExt, Visitor};
13+
use chalk_derive::{HasInterner, TypeFoldable, TypeSuperVisitable, TypeVisitable, Zip};
1414
use std::marker::PhantomData;
1515
use std::ops::ControlFlow;
1616

@@ -1733,7 +1733,7 @@ where
17331733
}
17341734

17351735
/// Where clauses that can be written by a Rust programmer.
1736-
#[derive(Clone, PartialEq, Eq, Hash, TypeFoldable, SuperVisit, HasInterner, Zip)]
1736+
#[derive(Clone, PartialEq, Eq, Hash, TypeFoldable, TypeSuperVisitable, HasInterner, Zip)]
17371737
pub enum WhereClause<I: Interner> {
17381738
/// Type implements a trait.
17391739
Implemented(TraitRef<I>),
@@ -1831,7 +1831,7 @@ where
18311831
/// A "domain goal" is a goal that is directly about Rust, rather than a pure
18321832
/// logical statement. As much as possible, the Chalk solver should avoid
18331833
/// decomposing this enum, and instead treat its values opaquely.
1834-
#[derive(Clone, PartialEq, Eq, Hash, TypeFoldable, SuperVisit, HasInterner, Zip)]
1834+
#[derive(Clone, PartialEq, Eq, Hash, TypeFoldable, TypeSuperVisitable, HasInterner, Zip)]
18351835
pub enum DomainGoal<I: Interner> {
18361836
/// Simple goal that is true if the where clause is true.
18371837
Holds(WhereClause<I>),

chalk-ir/src/visit.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,9 @@ pub trait TypeVisitable<I: Interner>: Debug {
202202
}
203203

204204
/// For types where "visit" invokes a callback on the `visitor`, the
205-
/// `SuperVisit` trait captures the recursive behavior that visits all
205+
/// `TypeSuperVisitable` trait captures the recursive behavior that visits all
206206
/// the contents of the type.
207-
pub trait SuperVisit<I: Interner>: TypeVisitable<I> {
207+
pub trait TypeSuperVisitable<I: Interner>: TypeVisitable<I> {
208208
/// Recursively visits the type contents.
209209
fn super_visit_with<B>(
210210
&self,
@@ -227,7 +227,7 @@ impl<I: Interner> TypeVisitable<I> for Ty<I> {
227227
}
228228

229229
/// "Super visit" for a type invokes the more detailed callbacks on the type
230-
impl<I> SuperVisit<I> for Ty<I>
230+
impl<I> TypeSuperVisitable<I> for Ty<I>
231231
where
232232
I: Interner,
233233
{
@@ -311,7 +311,7 @@ impl<I: Interner> TypeVisitable<I> for Lifetime<I> {
311311
}
312312
}
313313

314-
impl<I: Interner> SuperVisit<I> for Lifetime<I> {
314+
impl<I: Interner> TypeSuperVisitable<I> for Lifetime<I> {
315315
fn super_visit_with<B>(
316316
&self,
317317
visitor: &mut dyn Visitor<I, BreakTy = B>,
@@ -348,7 +348,7 @@ impl<I: Interner> TypeVisitable<I> for Const<I> {
348348
}
349349
}
350350

351-
impl<I: Interner> SuperVisit<I> for Const<I> {
351+
impl<I: Interner> TypeSuperVisitable<I> for Const<I> {
352352
fn super_visit_with<B>(
353353
&self,
354354
visitor: &mut dyn Visitor<I, BreakTy = B>,
@@ -382,7 +382,7 @@ impl<I: Interner> TypeVisitable<I> for Goal<I> {
382382
}
383383
}
384384

385-
impl<I: Interner> SuperVisit<I> for Goal<I> {
385+
impl<I: Interner> TypeSuperVisitable<I> for Goal<I> {
386386
fn super_visit_with<B>(
387387
&self,
388388
visitor: &mut dyn Visitor<I, BreakTy = B>,

chalk-ir/src/visit/boring_impls.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ use crate::{
88
try_break, AdtId, AssocTypeId, ClausePriority, ClosureId, Constraints, ControlFlow,
99
DebruijnIndex, FloatTy, FnDefId, ForeignDefId, GeneratorId, GenericArg, Goals, ImplId, IntTy,
1010
Interner, Mutability, OpaqueTyId, PlaceholderIndex, ProgramClause, ProgramClauses,
11-
QuantifiedWhereClauses, QuantifierKind, Safety, Scalar, Substitution, SuperVisit, TraitId,
12-
TypeVisitable, UintTy, UniverseIndex, Visitor,
11+
QuantifiedWhereClauses, QuantifierKind, Safety, Scalar, Substitution, TraitId,
12+
TypeSuperVisitable, TypeVisitable, UintTy, UniverseIndex, Visitor,
1313
};
1414
use std::{marker::PhantomData, sync::Arc};
1515

@@ -202,7 +202,7 @@ id_visit!(ClosureId);
202202
id_visit!(GeneratorId);
203203
id_visit!(ForeignDefId);
204204

205-
impl<I: Interner> SuperVisit<I> for ProgramClause<I> {
205+
impl<I: Interner> TypeSuperVisitable<I> for ProgramClause<I> {
206206
fn super_visit_with<B>(
207207
&self,
208208
visitor: &mut dyn Visitor<I, BreakTy = B>,

chalk-solve/src/clauses/builtin_traits/unsize.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use crate::{Interner, RustIrDatabase, TraitRef, WellKnownTrait};
88
use chalk_ir::{
99
cast::Cast,
1010
interner::HasInterner,
11-
visit::{SuperVisit, TypeVisitable, Visitor},
11+
visit::{TypeSuperVisitable, TypeVisitable, Visitor},
1212
Binders, Const, ConstValue, DebruijnIndex, DomainGoal, DynTy, EqGoal, Goal, LifetimeOutlives,
1313
QuantifiedWhereClauses, Substitution, TraitId, Ty, TyKind, TypeOutlives, WhereClause,
1414
};

chalk-solve/src/logging_db/id_collector.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use crate::RustIrDatabase;
33
use chalk_ir::{
44
interner::Interner,
55
visit::Visitor,
6-
visit::{SuperVisit, TypeVisitable},
6+
visit::{TypeSuperVisitable, TypeVisitable},
77
AliasTy, DebruijnIndex, TyKind, WhereClause,
88
};
99
use std::ops::ControlFlow;

chalk-solve/src/solve/truncate.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
use crate::infer::InferenceTable;
44
use chalk_ir::interner::Interner;
5-
use chalk_ir::visit::{SuperVisit, TypeVisitable, Visitor};
5+
use chalk_ir::visit::{TypeSuperVisitable, TypeVisitable, Visitor};
66
use chalk_ir::*;
77
use std::cmp::max;
88
use std::ops::ControlFlow;

0 commit comments

Comments
 (0)