Skip to content

Commit d3c94b2

Browse files
committed
Don't generate Def::Err if it's not stored in def_map immediately
1 parent 9b4e2a5 commit d3c94b2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/librustc_resolve/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2309,7 +2309,7 @@ impl<'a> Resolver<'a> {
23092309
);
23102310
err_path_resolution()
23112311
}
2312-
Def::Local(..) | Def::Upvar(..) | Def::Fn(..) | Def::Err => {
2312+
Def::Local(..) | Def::Upvar(..) | Def::Fn(..) => {
23132313
// These entities are explicitly allowed
23142314
// to be shadowed by fresh bindings.
23152315
self.fresh_binding(ident, pat.id, outer_pat_id,
@@ -2331,7 +2331,7 @@ impl<'a> Resolver<'a> {
23312331
PatKind::TupleStruct(ref path, _, _) => {
23322332
self.resolve_pattern_path(pat.id, None, path, ValueNS, |def| {
23332333
match def {
2334-
Def::Struct(..) | Def::Variant(..) | Def::Err => true,
2334+
Def::Struct(..) | Def::Variant(..) => true,
23352335
_ => false,
23362336
}
23372337
}, "variant or struct");
@@ -2341,7 +2341,7 @@ impl<'a> Resolver<'a> {
23412341
self.resolve_pattern_path(pat.id, qself.as_ref(), path, ValueNS, |def| {
23422342
match def {
23432343
Def::Struct(..) | Def::Variant(..) |
2344-
Def::Const(..) | Def::AssociatedConst(..) | Def::Err => true,
2344+
Def::Const(..) | Def::AssociatedConst(..) => true,
23452345
_ => false,
23462346
}
23472347
}, "variant, struct or constant");
@@ -2351,7 +2351,7 @@ impl<'a> Resolver<'a> {
23512351
self.resolve_pattern_path(pat.id, None, path, TypeNS, |def| {
23522352
match def {
23532353
Def::Struct(..) | Def::Variant(..) |
2354-
Def::TyAlias(..) | Def::AssociatedTy(..) | Def::Err => true,
2354+
Def::TyAlias(..) | Def::AssociatedTy(..) => true,
23552355
_ => false,
23562356
}
23572357
}, "variant, struct or type alias");
@@ -2482,7 +2482,7 @@ impl<'a> Resolver<'a> {
24822482
record_used: bool)
24832483
-> Option<LocalDef> {
24842484
if identifier.name == keywords::Invalid.name() {
2485-
return Some(LocalDef::from_def(Def::Err));
2485+
return None;
24862486
}
24872487

24882488
self.resolve_ident_in_lexical_scope(identifier, namespace, record_used)

0 commit comments

Comments
 (0)