Don't compute LastPrivate data for Def::Err.
This commit is contained in:
parent
97842f54c9
commit
1b5d2f21d6
@ -1047,6 +1047,7 @@ impl<'a> NameBinding<'a> {
|
||||
|
||||
fn def_and_lp(&self) -> (Def, LastPrivate) {
|
||||
let def = self.def().unwrap();
|
||||
if let Def::Err = def { return (def, LastMod(AllPublic)) }
|
||||
(def, LastMod(if self.is_public() { AllPublic } else { DependsOn(def.def_id()) }))
|
||||
}
|
||||
|
||||
|
@ -15,5 +15,10 @@ use zed::baz;
|
||||
|
||||
mod zed {
|
||||
pub fn bar() { println!("bar"); }
|
||||
use foo; //~ ERROR unresolved import
|
||||
}
|
||||
|
||||
fn main() {
|
||||
zed::foo(); // Check that this does not panic. Ideally, it would be a privacy error.
|
||||
bar();
|
||||
}
|
||||
fn main() { bar(); }
|
||||
|
Loading…
x
Reference in New Issue
Block a user