Make the Nodes vector generic on node type (#6328)

This commit is contained in:
Charlie Marsh 2023-08-03 23:57:15 -04:00 committed by GitHub
parent 6da527170f
commit 8a5bc93fdd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 35 additions and 27 deletions

View file

@ -31,7 +31,7 @@ pub struct SemanticModel<'a> {
module_path: Option<&'a [String]>,
/// Stack of all visited statements.
pub stmts: Nodes<'a>,
pub stmts: Nodes<'a, Stmt>,
/// The identifier of the current statement.
stmt_id: Option<NodeId>,
@ -129,7 +129,7 @@ impl<'a> SemanticModel<'a> {
Self {
typing_modules,
module_path: module.path(),
stmts: Nodes::default(),
stmts: Nodes::<Stmt>::default(),
stmt_id: None,
exprs: Vec::default(),
scopes: Scopes::default(),