mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 14:21:44 +00:00
Node-ify lifetimes
This commit is contained in:
parent
d34611633b
commit
dd496223f5
63 changed files with 420 additions and 274 deletions
|
@ -260,9 +260,8 @@ impl GenericParams {
|
|||
self.fill_bounds(&lower_ctx, &type_param, Either::Left(type_ref));
|
||||
}
|
||||
for lifetime_param in params.lifetime_params() {
|
||||
let name = lifetime_param
|
||||
.lifetime_token()
|
||||
.map_or_else(Name::missing, |tok| Name::new_lifetime(&tok));
|
||||
let name =
|
||||
lifetime_param.lifetime().map_or_else(Name::missing, |lt| Name::new_lifetime(<));
|
||||
let param = LifetimeParamData { name: name.clone() };
|
||||
let param_id = self.lifetimes.alloc(param);
|
||||
sm.lifetime_params.insert(param_id, lifetime_param.clone());
|
||||
|
@ -275,8 +274,8 @@ impl GenericParams {
|
|||
for pred in where_clause.predicates() {
|
||||
let target = if let Some(type_ref) = pred.ty() {
|
||||
Either::Left(TypeRef::from_ast(lower_ctx, type_ref))
|
||||
} else if let Some(lifetime_tok) = pred.lifetime_token() {
|
||||
Either::Right(LifetimeRef::from_token(lifetime_tok))
|
||||
} else if let Some(lifetime) = pred.lifetime() {
|
||||
Either::Right(LifetimeRef::new(&lifetime))
|
||||
} else {
|
||||
continue;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue