Improve dummy bindings for unresolved imports
This commit is contained in:
parent
1b5d2f21d6
commit
08b9097197
2 changed files with 3 additions and 1 deletions
|
|
@ -218,6 +218,8 @@ impl<'a, 'b:'a, 'tcx:'b> ImportResolver<'a, 'b, 'tcx> {
|
|||
kind: NameBindingKind::Def(Def::Err),
|
||||
span: None,
|
||||
});
|
||||
let dummy_binding =
|
||||
self.resolver.new_name_binding(e.import_directive.import(dummy_binding));
|
||||
|
||||
let _ = e.source_module.try_define_child(target, ValueNS, dummy_binding);
|
||||
let _ = e.source_module.try_define_child(target, TypeNS, dummy_binding);
|
||||
|
|
|
|||
|
|
@ -19,6 +19,6 @@ mod zed {
|
|||
}
|
||||
|
||||
fn main() {
|
||||
zed::foo(); // Check that this does not panic. Ideally, it would be a privacy error.
|
||||
zed::foo(); //~ ERROR unresolved name
|
||||
bar();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue