Fix 14142: Annotate lifetime paramaters in doctest runnables

This commit is contained in:
Jonas Marcello 2023-02-19 22:07:33 +01:00
parent c867cbf9b6
commit 9942cc425b
3 changed files with 155 additions and 6 deletions

View file

@ -459,6 +459,13 @@ impl Resolver {
})
}
pub fn generic_params(&self) -> Option<&Interned<GenericParams>> {
self.scopes().find_map(|scope| match scope {
Scope::GenericParams { params, .. } => Some(params),
_ => None,
})
}
pub fn body_owner(&self) -> Option<DefWithBodyId> {
self.scopes().find_map(|scope| match scope {
Scope::ExprScope(it) => Some(it.owner),