mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-25 13:24:22 +00:00
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>
This commit is contained in:
parent
ce7c48fa15
commit
842fa0ce3e
@ -890,6 +890,7 @@ impl<'tcx> Generics {
|
||||
false
|
||||
}
|
||||
|
||||
/// Returns the `GenericParamDef` with the given index.
|
||||
pub fn param_at(&'tcx self, param_index: usize, tcx: TyCtxt<'tcx>) -> &'tcx GenericParamDef {
|
||||
if let Some(index) = param_index.checked_sub(self.parent_count) {
|
||||
&self.params[index]
|
||||
@ -899,6 +900,7 @@ impl<'tcx> Generics {
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns the `GenericParamDef` associated with this `EarlyBoundRegion`.
|
||||
pub fn region_param(
|
||||
&'tcx self,
|
||||
param: &EarlyBoundRegion,
|
||||
@ -920,7 +922,7 @@ impl<'tcx> Generics {
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns the `ConstParameterDef` associated with this `ParamConst`.
|
||||
/// Returns the `GenericParamDef` associated with this `ParamConst`.
|
||||
pub fn const_param(&'tcx self, param: &ParamConst, tcx: TyCtxt<'tcx>) -> &GenericParamDef {
|
||||
let param = self.param_at(param.index as usize, tcx);
|
||||
match param.kind {
|
||||
|
Loading…
Reference in New Issue
Block a user