about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFelix S. Klock II <pnkfelix@pnkfx.org>2015-12-18 17:42:46 +0100
committerFelix S. Klock II <pnkfelix@pnkfx.org>2015-12-18 17:42:46 +0100
commit04c05c7b01170a7ce3be58a6a2b4a437daf57dd6 (patch)
tree9ebb8d11efcc037fb5b239acd70a8d1d452aa77a
parent694699503a346822ae8453e93c9f327d01fe6f55 (diff)
downloadrust-04c05c7b01170a7ce3be58a6a2b4a437daf57dd6.tar.gz
rust-04c05c7b01170a7ce3be58a6a2b4a437daf57dd6.zip
Added doc comments for new UnresolvedNameContext enum.
-rw-r--r--src/librustc_resolve/lib.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs
index b4e2d6beb8b..3aeb08aa110 100644
--- a/src/librustc_resolve/lib.rs
+++ b/src/librustc_resolve/lib.rs
@@ -202,9 +202,18 @@ pub enum ResolutionError<'a> {
     AttemptToUseNonConstantValueInConstant,
 }
 
+/// Context of where `ResolutionError::UnresolvedName` arose.
 #[derive(Clone, PartialEq, Eq, Debug)]
 pub enum UnresolvedNameContext {
+    /// `PathIsMod(id)` indicates that a given path, used in
+    /// expression context, actually resolved to a module rather than
+    /// a value. The `id` attached to the variant is the node id of
+    /// the erroneous path expression.
     PathIsMod(ast::NodeId),
+
+    /// `Other` means we have no extra information about the context
+    /// of the unresolved name error. (Maybe we could eliminate all
+    /// such cases; but for now, this is an information-free default.)
     Other,
 }