Skip to content

Commit 312dded

Browse files
committed
fix up doc comments
1 parent 4727f8e commit 312dded

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
lines changed

chalk-ir/src/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,10 @@ impl UniverseIndex {
144144
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
145145
pub struct StructId<I: Interner>(pub I::DefId);
146146

147+
/// The id of a trait definition; could be used to load the trait datum by
148+
/// invoking the [`trait_datum`] method.
149+
///
150+
/// [`trait_datum`]: ../chalk_solve/trait.RustIrDatabase.html#tymethod.trait_datum
147151
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
148152
pub struct TraitId<I: Interner>(pub I::DefId);
149153

@@ -153,6 +157,10 @@ pub struct ImplId<I: Interner>(pub I::DefId);
153157
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
154158
pub struct ClauseId<I: Interner>(pub I::DefId);
155159

160+
/// The id for the associated type member of a trait. The details of the type
161+
/// can be found by invoking the [`associated_ty_data`] method.
162+
///
163+
/// [`associated_ty_data`]: ../chalk_solve/trait.RustIrDatabase.html#tymethod.associated_ty_data
156164
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
157165
pub struct AssocTypeId<I: Interner>(pub I::DefId);
158166

chalk-rust-ir/src/lib.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,6 @@ pub struct StructFlags {
112112
/// [`ImplDatum`]: struct.ImplDatum.html
113113
/// [`AssociatedTyDatum`]: struct.AssociatedTyDatum.html
114114
pub struct TraitDatum<I: Interner> {
115-
/// The id of this trait; could be used to load the trait datum by invoking
116-
/// the [`trait_datum`] method.
117-
///
118-
/// [`trait_datum`]: ../chalk_solve/trait.RustIrDatabase.html#tymethod.trait_datum
119115
pub id: TraitId<I>,
120116

121117
pub binders: Binders<TraitDatumBound<I>>,
@@ -125,13 +121,10 @@ pub struct TraitDatum<I: Interner> {
125121
/// chalk we add annotations like `#[auto]`.
126122
pub flags: TraitFlags,
127123

128-
/// The ids for the associated type members of the trait. The details of
129-
/// each type can be found by invoking the [`associated_ty_data`] method.
130-
///
131-
/// [`associated_ty_data`]: ../chalk_solve/trait.RustIrDatabase.html#tymethod.associated_ty_data
132124
pub associated_ty_ids: Vec<AssocTypeId<I>>,
133125

134-
/// If this is a well-known trait, which one? If `None`, this is a regular, user-defined trait.
126+
/// If this is a well-known trait, which one? If `None`, this is a regular,
127+
/// user-defined trait.
135128
pub well_known: Option<WellKnownTrait>,
136129
}
137130

chalk-solve/src/clauses/builtin_traits.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ use super::builder::ClauseBuilder;
22
use crate::Interner;
33
use crate::{TraitRef, WellKnownTrait};
44

5+
/// For well known traits we have special hard-coded impls, either as an
6+
/// optimization or to enforce special rules for correctness.
57
pub fn add_builtin_program_clauses<I: Interner>(
68
well_known: WellKnownTrait,
79
_trait_ref: &TraitRef<I>,

chalk-solve/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub trait RustIrDatabase<I: Interner>: Debug {
2424
/// Returns the datum for the associated type with the given id.
2525
fn associated_ty_data(&self, ty: AssocTypeId<I>) -> Arc<AssociatedTyDatum<I>>;
2626

27-
/// Returns the datum for the impl with the given id.
27+
/// Returns the datum for the definition with the given id.
2828
fn trait_datum(&self, trait_id: TraitId<I>) -> Arc<TraitDatum<I>>;
2929

3030
/// Returns the datum for the impl with the given id.

0 commit comments

Comments
 (0)