Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 18b4fe0

Browse files
committedDec 11, 2015
Make name resolution errors non-fatal
1 parent 672a3d9 commit 18b4fe0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+308
-213
lines changed
 

‎src/librustc/middle/check_static_recursion.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,9 @@ pub fn check_crate<'ast>(sess: &Session,
9999
ast_map: ast_map,
100100
discriminant_map: RefCell::new(NodeMap()),
101101
};
102-
krate.visit_all_items(&mut visitor);
103-
sess.abort_if_errors();
102+
sess.abort_if_new_errors(|| {
103+
krate.visit_all_items(&mut visitor);
104+
});
104105
}
105106

106107
struct CheckItemRecursionVisitor<'a, 'ast: 'a> {

‎src/librustc/middle/def.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ pub enum Def {
5252
DefStruct(DefId),
5353
DefLabel(ast::NodeId),
5454
DefMethod(DefId),
55+
DefErr,
5556
}
5657

5758
/// The result of resolving a path.
@@ -124,7 +125,7 @@ impl Def {
124125
DefVariant(..) | DefTy(..) | DefAssociatedTy(..) |
125126
DefTyParam(..) | DefUse(..) | DefStruct(..) | DefTrait(..) |
126127
DefMethod(..) | DefConst(..) | DefAssociatedConst(..) |
127-
DefPrimTy(..) | DefLabel(..) | DefSelfTy(..) => {
128+
DefPrimTy(..) | DefLabel(..) | DefSelfTy(..) | DefErr => {
128129
panic!("attempted .def_id() on invalid {:?}", self)
129130
}
130131
}
@@ -142,7 +143,8 @@ impl Def {
142143

143144
DefLabel(..) |
144145
DefPrimTy(..) |
145-
DefSelfTy(..) => {
146+
DefSelfTy(..) |
147+
DefErr => {
146148
panic!("attempted .def_id() on invalid def: {:?}", self)
147149
}
148150
}

0 commit comments

Comments
 (0)
Please sign in to comment.