This commit is contained in:
Shunsuke Shibayama 2022-11-28 22:23:46 +09:00
parent 1f368e1a8d
commit 56de07ee14
2 changed files with 4 additions and 2 deletions

View file

@ -51,7 +51,7 @@ impl Runnable for HIRBuilder {
fn clear(&mut self) {
self.lowerer.clear();
self.ownership_checker = OwnershipChecker::new(self.cfg().copy());
// don't initialize the ownership checker
}
fn exec(&mut self) -> Result<i32, Self::Errs> {

View file

@ -3,11 +3,11 @@ use std::mem;
use erg_common::config::ErgConfig;
use erg_common::dict::Dict;
use erg_common::error::Location;
use erg_common::log;
use erg_common::set::Set;
use erg_common::traits::{Locational, Stream};
use erg_common::vis::Visibility;
use erg_common::Str;
use erg_common::{impl_display_from_debug, log};
use erg_parser::ast::{ParamPattern, VarName};
use Visibility::*;
@ -29,6 +29,8 @@ struct LocalVars {
dropped_vars: Dict<Str, Location>,
}
impl_display_from_debug!(LocalVars);
/// Check code ownership.
/// for example:
/// * Check if moved variables are not used again.