// This compiler pass detects constants that refer to themselves
// recursively.
-use rustc::dep_graph::DepNode;
use rustc::hir::map as hir_map;
-use rustc::session::{CompileResult, Session};
+use rustc::session::Session;
use rustc::hir::def::{Def, CtorKind};
+use rustc::util::common::ErrorReported;
use rustc::util::nodemap::{NodeMap, NodeSet};
use syntax::ast;
}
}
-pub fn check_crate<'hir>(sess: &Session, hir_map: &hir_map::Map<'hir>) -> CompileResult {
- let _task = hir_map.dep_graph.in_task(DepNode::CheckStaticRecursion);
-
+pub fn check_crate<'hir>(sess: &Session, hir_map: &hir_map::Map<'hir>)
+ -> Result<(), ErrorReported>
+{
let mut visitor = CheckCrateVisitor {
sess: sess,
hir_map: hir_map,
});
if !any_static {
struct_span_err!(self.sess, span, E0265, "recursive constant")
- .span_label(span, &format!("recursion not allowed in constant"))
+ .span_label(span, "recursion not allowed in constant")
.emit();
}
return;