From be90eb9ba7a016569ffa20d83c83097d9568b888 Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Tue, 9 Aug 2022 07:11:03 +0000 Subject: [PATCH] Dont ICE when encountering indeterminate paths in rustdoc --- compiler/rustc_resolve/src/lib.rs | 5 +++-- src/test/rustdoc/issue-100241.rs | 13 +++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 src/test/rustdoc/issue-100241.rs diff --git a/compiler/rustc_resolve/src/lib.rs b/compiler/rustc_resolve/src/lib.rs index ef3c3da89c572..325e835fbd879 100644 --- a/compiler/rustc_resolve/src/lib.rs +++ b/compiler/rustc_resolve/src/lib.rs @@ -1916,8 +1916,9 @@ impl<'a> Resolver<'a> { } PathResult::Module(ModuleOrUniformRoot::ExternPrelude) | PathResult::NonModule(..) - | PathResult::Failed { .. } => None, - PathResult::Module(..) | PathResult::Indeterminate => unreachable!(), + | PathResult::Failed { .. } + | PathResult::Indeterminate => None, + PathResult::Module(..) => unreachable!(), } } diff --git a/src/test/rustdoc/issue-100241.rs b/src/test/rustdoc/issue-100241.rs new file mode 100644 index 0000000000000..b15522e4bff7a --- /dev/null +++ b/src/test/rustdoc/issue-100241.rs @@ -0,0 +1,13 @@ +//! See [`S`]. + +// Check that this isn't an ICE +// should-fail + +mod foo { + pub use inner::S; + //~^ ERROR unresolved imports `inner`, `foo::S` +} + +pub use foo::*; + +use foo::S;