mirror of
https://github.com/erg-lang/erg.git
synced 2025-09-30 12:51:10 +00:00
Fix #261
This commit is contained in:
parent
1f368e1a8d
commit
56de07ee14
2 changed files with 4 additions and 2 deletions
|
@ -51,7 +51,7 @@ impl Runnable for HIRBuilder {
|
||||||
|
|
||||||
fn clear(&mut self) {
|
fn clear(&mut self) {
|
||||||
self.lowerer.clear();
|
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> {
|
fn exec(&mut self) -> Result<i32, Self::Errs> {
|
||||||
|
|
|
@ -3,11 +3,11 @@ use std::mem;
|
||||||
use erg_common::config::ErgConfig;
|
use erg_common::config::ErgConfig;
|
||||||
use erg_common::dict::Dict;
|
use erg_common::dict::Dict;
|
||||||
use erg_common::error::Location;
|
use erg_common::error::Location;
|
||||||
use erg_common::log;
|
|
||||||
use erg_common::set::Set;
|
use erg_common::set::Set;
|
||||||
use erg_common::traits::{Locational, Stream};
|
use erg_common::traits::{Locational, Stream};
|
||||||
use erg_common::vis::Visibility;
|
use erg_common::vis::Visibility;
|
||||||
use erg_common::Str;
|
use erg_common::Str;
|
||||||
|
use erg_common::{impl_display_from_debug, log};
|
||||||
use erg_parser::ast::{ParamPattern, VarName};
|
use erg_parser::ast::{ParamPattern, VarName};
|
||||||
use Visibility::*;
|
use Visibility::*;
|
||||||
|
|
||||||
|
@ -29,6 +29,8 @@ struct LocalVars {
|
||||||
dropped_vars: Dict<Str, Location>,
|
dropped_vars: Dict<Str, Location>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl_display_from_debug!(LocalVars);
|
||||||
|
|
||||||
/// Check code ownership.
|
/// Check code ownership.
|
||||||
/// for example:
|
/// for example:
|
||||||
/// * Check if moved variables are not used again.
|
/// * Check if moved variables are not used again.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue