Skip to content

Commit d3d77a8

Browse files
committed
Update docs of hir::TypeBinding
1 parent 6b85f07 commit d3d77a8

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

compiler/rustc_hir/src/hir.rs

+8-14
Original file line numberDiff line numberDiff line change
@@ -2289,21 +2289,15 @@ pub enum ImplItemKind<'hir> {
22892289
Type(&'hir Ty<'hir>),
22902290
}
22912291

2292-
/// Bind a type to an associated type (i.e., `A = Foo`).
2292+
/// An associated item binding.
22932293
///
2294-
/// Bindings like `A: Debug` are represented as a special type `A =
2295-
/// $::Debug` that is understood by the HIR ty lowering code.
2294+
/// ### Examples
22962295
///
2297-
/// FIXME(alexreg): why have a separate type for the binding case,
2298-
/// wouldn't it be better to make the `ty` field an enum like the
2299-
/// following?
2300-
///
2301-
/// ```ignore (pseudo-rust)
2302-
/// enum TypeBindingKind {
2303-
/// Equals(...),
2304-
/// Binding(...),
2305-
/// }
2306-
/// ```
2296+
/// * `Trait<A = Ty, B = Ty>`
2297+
/// * `Trait<G<Ty> = Ty>`
2298+
/// * `Trait<A: Bound>`
2299+
/// * `Trait<C = { Ct }>` (under feature `associated_const_equality`)
2300+
/// * `Trait<f(): Bound>` (under feature `return_type_notation`)
23072301
#[derive(Debug, Clone, Copy, HashStable_Generic)]
23082302
pub struct TypeBinding<'hir> {
23092303
pub hir_id: HirId,
@@ -2336,7 +2330,7 @@ impl<'hir> From<AnonConst> for Term<'hir> {
23362330
pub enum TypeBindingKind<'hir> {
23372331
/// E.g., `Foo<Bar: Send>`.
23382332
Constraint { bounds: &'hir [GenericBound<'hir>] },
2339-
/// E.g., `Foo<Bar = ()>`, `Foo<Bar = ()>`
2333+
/// E.g., `Foo<Bar = ()>`.
23402334
Equality { term: Term<'hir> },
23412335
}
23422336

0 commit comments

Comments
 (0)