@no_type_check support (#15122)

Co-authored-by: Carl Meyer <carl@astral.sh>
This commit is contained in:
Micha Reiser 2024-12-30 10:42:18 +01:00 committed by GitHub
parent d4ee6abf4a
commit 0caab81d3d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 253 additions and 47 deletions

View file

@ -43,7 +43,7 @@ impl<T> AstNodeRef<T> {
}
/// Returns a reference to the wrapped node.
pub fn node(&self) -> &T {
pub const fn node(&self) -> &T {
// SAFETY: Holding on to `parsed` ensures that the AST to which `node` belongs is still
// alive and not moved.
unsafe { self.node.as_ref() }