Skip to content

Commit 842fa0c

Browse files
committed
ty: add doc comments to Generics methods
This commit adds doc comments to the `param_at`, `region_param` and `const_param` methods on the `Generics` struct. Signed-off-by: David Wood <david@davidtw.co>
1 parent ce7c48f commit 842fa0c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/librustc_middle/ty/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -890,6 +890,7 @@ impl<'tcx> Generics {
890890
false
891891
}
892892

893+
/// Returns the `GenericParamDef` with the given index.
893894
pub fn param_at(&'tcx self, param_index: usize, tcx: TyCtxt<'tcx>) -> &'tcx GenericParamDef {
894895
if let Some(index) = param_index.checked_sub(self.parent_count) {
895896
&self.params[index]
@@ -899,6 +900,7 @@ impl<'tcx> Generics {
899900
}
900901
}
901902

903+
/// Returns the `GenericParamDef` associated with this `EarlyBoundRegion`.
902904
pub fn region_param(
903905
&'tcx self,
904906
param: &EarlyBoundRegion,
@@ -920,7 +922,7 @@ impl<'tcx> Generics {
920922
}
921923
}
922924

923-
/// Returns the `ConstParameterDef` associated with this `ParamConst`.
925+
/// Returns the `GenericParamDef` associated with this `ParamConst`.
924926
pub fn const_param(&'tcx self, param: &ParamConst, tcx: TyCtxt<'tcx>) -> &GenericParamDef {
925927
let param = self.param_at(param.index as usize, tcx);
926928
match param.kind {

0 commit comments

Comments
 (0)