Fix builds.

This commit is contained in:
Stephen Chung
2021-03-10 23:37:04 +08:00
parent 9b37d84a9b
commit 99020f3ed1
2 changed files with 22 additions and 32 deletions

View File

@@ -11,6 +11,7 @@ use crate::stdlib::{
num::NonZeroUsize,
ops::{Add, AddAssign},
string::String,
vec,
vec::Vec,
};
use crate::token::Token;
@@ -244,7 +245,7 @@ impl AST {
#[deprecated = "this method is volatile and may change"]
#[inline(always)]
pub fn statements(&self) -> &[Stmt] {
&self.statements
&self.body.statements
}
/// Get a mutable reference to the statements.
#[cfg(not(feature = "no_optimize"))]
@@ -711,7 +712,7 @@ impl AST {
.chain({
#[cfg(not(feature = "no_function"))]
{
self.iter_fn_def().map(|f| &f.body)
self.iter_fn_def().flat_map(|f| f.body.statements.iter())
}
#[cfg(feature = "no_function")]
{