We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 59bc7b4 commit 7375001Copy full SHA for 7375001
crates/syntax/src/ast.rs
@@ -42,6 +42,14 @@ pub use self::{
42
/// the same representation: a pointer to the tree root and a pointer to the
43
/// node itself.
44
pub trait AstNode {
45
+ /// This panics if the `SyntaxKind` is not statically known.
46
+ fn kind() -> SyntaxKind
47
+ where
48
+ Self: Sized,
49
+ {
50
+ panic!("dynamic `SyntaxKind` for `AstNode::kind()`")
51
+ }
52
+
53
fn can_cast(kind: SyntaxKind) -> bool
54
where
55
Self: Sized;
0 commit comments