From 04c05c7b01170a7ce3be58a6a2b4a437daf57dd6 Mon Sep 17 00:00:00 2001 From: "Felix S. Klock II" Date: Fri, 18 Dec 2015 17:42:46 +0100 Subject: [PATCH] Added doc comments for new UnresolvedNameContext enum. --- src/librustc_resolve/lib.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs index b4e2d6beb8b8..3aeb08aa110c 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, }