mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
Allow non-path default type parameters
This commit is contained in:
parent
4340d9b0e4
commit
0e771915fa
6 changed files with 38 additions and 19 deletions
|
@ -3625,8 +3625,11 @@ impl AstNode for TypeParam {
|
|||
impl ast::NameOwner for TypeParam {}
|
||||
impl ast::AttrsOwner for TypeParam {}
|
||||
impl ast::TypeBoundsOwner for TypeParam {}
|
||||
impl ast::DefaultTypeParamOwner for TypeParam {}
|
||||
impl TypeParam {}
|
||||
impl TypeParam {
|
||||
pub fn default_type(&self) -> Option<TypeRef> {
|
||||
AstChildren::new(&self.syntax).next()
|
||||
}
|
||||
}
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||
pub struct TypeParamList {
|
||||
pub(crate) syntax: SyntaxNode,
|
||||
|
|
|
@ -163,9 +163,3 @@ impl Iterator for CommentIter {
|
|||
self.iter.by_ref().find_map(|el| el.into_token().and_then(ast::Comment::cast))
|
||||
}
|
||||
}
|
||||
|
||||
pub trait DefaultTypeParamOwner: AstNode {
|
||||
fn default_type(&self) -> Option<ast::PathType> {
|
||||
child_opt(self)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue