未验证 提交 15433676 编写于 作者: O Oliver Schneider 提交者: Oliver Schneider

The `const_eval` module is no more

上级 57f9e0e4
......@@ -37,7 +37,6 @@
use rustc_plugin::registry::Registry;
use rustc_plugin as plugin;
use rustc_passes::{self, ast_validation, loops, consts, hir_stats};
use rustc_mir::const_eval::check_match;
use super::Compilation;
use serialize::json;
......@@ -1049,7 +1048,7 @@ pub fn phase_3_run_analysis_passes<'tcx, F, R>(trans: &TransCrate,
time(time_passes,
"match checking",
|| check_match::check_crate(tcx));
|| mir::pattern::check_crate(tcx));
// this must run before MIR dump, because
// "not all control paths return a value" is reported here.
......@@ -1092,7 +1091,7 @@ pub fn phase_3_run_analysis_passes<'tcx, F, R>(trans: &TransCrate,
time(time_passes,
"MIR linting",
|| for def_id in tcx.body_owners() {
mir::const_eval::check::check(tcx, def_id)
mir::check_const_err::check(tcx, def_id)
});
time(time_passes, "lint checking", || lint::check_crate(tcx));
......
......@@ -21,7 +21,7 @@
use rustc::ty::subst::Substs;
use rustc::util::nodemap::NodeMap;
use rustc_back::PanicStrategy;
use const_eval::pattern::{BindingMode, PatternKind};
use pattern::pattern::{BindingMode, PatternKind};
use rustc_data_structures::indexed_vec::{IndexVec, Idx};
use shim;
use std::mem;
......
......@@ -26,7 +26,7 @@
pub mod cx;
pub use const_eval::pattern::{BindingMode, Pattern, PatternKind, FieldPattern};
pub use pattern::pattern::{BindingMode, Pattern, PatternKind, FieldPattern};
#[derive(Copy, Clone, Debug)]
pub enum LintLevel {
......
......@@ -71,7 +71,8 @@
pub mod util;
pub mod interpret;
pub mod monomorphize;
pub mod const_eval;
pub mod pattern;
pub mod check_const_err;
use rustc::ty::maps::Providers;
......@@ -80,7 +81,7 @@ pub fn provide(providers: &mut Providers) {
shim::provide(providers);
transform::provide(providers);
providers.const_eval = interpret::const_eval_provider;
providers.check_match = const_eval::check_match::check_match;
providers.check_match = pattern::check_match::check_match;
}
__build_diagnostic_array! { librustc_mir, DIAGNOSTICS }
......@@ -17,8 +17,8 @@
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::indexed_vec::Idx;
use const_eval::pattern::{FieldPattern, Pattern, PatternKind};
use const_eval::pattern::{PatternFoldable, PatternFolder, compare_const_vals};
use super::pattern::{FieldPattern, Pattern, PatternKind};
use super::pattern::{PatternFoldable, PatternFolder, compare_const_vals};
use rustc::hir::def_id::DefId;
use rustc::hir::RangeEnd;
......
......@@ -8,11 +8,11 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use const_eval::_match::{MatchCheckCtxt, Matrix, expand_pattern, is_useful};
use const_eval::_match::Usefulness::*;
use const_eval::_match::WitnessPreference::*;
use super::_match::{MatchCheckCtxt, Matrix, expand_pattern, is_useful};
use super::_match::Usefulness::*;
use super::_match::WitnessPreference::*;
use const_eval::pattern::{Pattern, PatternContext, PatternError, PatternKind};
use super::pattern::{Pattern, PatternContext, PatternError, PatternKind};
use rustc::middle::expr_use_visitor::{ConsumeMode, Delegate, ExprUseVisitor};
use rustc::middle::expr_use_visitor::{LoanCause, MutateMode};
......
......@@ -11,6 +11,7 @@
//! constant evaluation on the HIR and code to validate patterns/matches
mod _match;
pub mod check_match;
pub mod pattern;
pub mod check;
pub(crate) mod check_match;
pub(crate) mod pattern;
pub use self::check_match::check_crate;
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册