Skip to content

Commit 593373f

Browse files
committed
Fix some minor mistakes in comments.
1 parent b4e54c6 commit 593373f

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

compiler/rustc_type_ir/src/fold.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//! modification. These are the ones containing the most important type-related
1212
//! information, such as `Ty`, `Predicate`, `Region`, and `Const`.
1313
//!
14-
//! There are three groups of traits involved in each traversal.
14+
//! There are three traits involved in each traversal.
1515
//! - `TypeFoldable`. This is implemented once for many types, including:
1616
//! - Types of interest, for which the methods delegate to the folder.
1717
//! - All other types, including generic containers like `Vec` and `Option`.
@@ -58,7 +58,7 @@ pub trait TypeFoldable<I: Interner>: TypeVisitable<I> {
5858
/// For most types, this just traverses the value, calling `try_fold_with`
5959
/// on each field/element.
6060
///
61-
/// For types of interest (such as `Ty`), the implementation of method
61+
/// For types of interest (such as `Ty`), the implementation of this method
6262
/// calls a folder method specifically for that type (such as
6363
/// `F::try_fold_ty`). This is where control transfers from `TypeFoldable`
6464
/// to `TypeFolder`.
@@ -121,7 +121,7 @@ pub trait TypeFolder<I: Interner>: FallibleTypeFolder<I, Error = !> {
121121
}
122122

123123
// The default region folder is a no-op because `Region` is non-recursive
124-
// and has no `super_visit_with` method to call. That also explains the
124+
// and has no `super_fold_with` method to call. That also explains the
125125
// lack of `I::Region: TypeSuperFoldable<I>` bound on this method.
126126
fn fold_region(&mut self, r: I::Region) -> I::Region {
127127
r
@@ -170,7 +170,7 @@ pub trait FallibleTypeFolder<I: Interner>: Sized {
170170
}
171171

172172
// The default region folder is a no-op because `Region` is non-recursive
173-
// and has no `super_visit_with` method to call. That also explains the
173+
// and has no `super_fold_with` method to call. That also explains the
174174
// lack of `I::Region: TypeSuperFoldable<I>` bound on this method.
175175
fn try_fold_region(&mut self, r: I::Region) -> Result<I::Region, Self::Error> {
176176
Ok(r)

compiler/rustc_type_ir/src/visit.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//! visitation. These are the ones containing the most important type-related
99
//! information, such as `Ty`, `Predicate`, `Region`, and `Const`.
1010
//!
11-
//! There are three groups of traits involved in each traversal.
11+
//! There are three traits involved in each traversal.
1212
//! - `TypeVisitable`. This is implemented once for many types, including:
1313
//! - Types of interest, for which the methods delegate to the visitor.
1414
//! - All other types, including generic containers like `Vec` and `Option`.
@@ -17,7 +17,6 @@
1717
//! interest, and defines the visiting "skeleton" for these types. (This
1818
//! excludes `Region` because it is non-recursive, i.e. it never contains
1919
//! other types of interest.)
20-
//!
2120
//! - `TypeVisitor`. This is implemented for each visitor. This defines how
2221
//! types of interest are visited.
2322
//!
@@ -60,7 +59,7 @@ pub trait TypeVisitable<I: Interner>: fmt::Debug + Clone {
6059
///
6160
/// For types of interest (such as `Ty`), the implementation of this method
6261
/// that calls a visitor method specifically for that type (such as
63-
/// `V::visit_ty`). This is where control transfers from `TypeFoldable` to
62+
/// `V::visit_ty`). This is where control transfers from `TypeVisitable` to
6463
/// `TypeVisitor`.
6564
fn visit_with<V: TypeVisitor<I>>(&self, visitor: &mut V) -> ControlFlow<V::BreakTy>;
6665
}

0 commit comments

Comments
 (0)