We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 97842f5 commit 1b5d2f2Copy full SHA for 1b5d2f2
src/librustc_resolve/lib.rs
@@ -1047,6 +1047,7 @@ impl<'a> NameBinding<'a> {
1047
1048
fn def_and_lp(&self) -> (Def, LastPrivate) {
1049
let def = self.def().unwrap();
1050
+ if let Def::Err = def { return (def, LastMod(AllPublic)) }
1051
(def, LastMod(if self.is_public() { AllPublic } else { DependsOn(def.def_id()) }))
1052
}
1053
src/test/compile-fail/import.rs
@@ -15,5 +15,10 @@ use zed::baz;
15
16
mod zed {
17
pub fn bar() { println!("bar"); }
18
+ use foo; //~ ERROR unresolved import
19
+}
20
+
21
+fn main() {
22
+ zed::foo(); // Check that this does not panic. Ideally, it would be a privacy error.
23
+ bar();
24
-fn main() { bar(); }
0 commit comments