From b83739af4e4687469638f760bba60c9ad362ec34 Mon Sep 17 00:00:00 2001
From: Jeffrey Seyfried <jeffrey.seyfried@gmail.com>
Date: Thu, 17 Mar 2016 01:16:33 +0000
Subject: [PATCH] Add a field `target_module: Cell<Option<Module>>` to
 `ImportDirective`

---
 src/librustc_resolve/resolve_imports.rs | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/librustc_resolve/resolve_imports.rs b/src/librustc_resolve/resolve_imports.rs
index b446fa6430e..1e0048d12b5 100644
--- a/src/librustc_resolve/resolve_imports.rs
+++ b/src/librustc_resolve/resolve_imports.rs
@@ -59,6 +59,7 @@ impl ImportDirectiveSubclass {
 #[derive(Debug,Clone)]
 pub struct ImportDirective<'a> {
     module_path: Vec<Name>,
+    target_module: Cell<Option<Module<'a>>>, // the resolution of `module_path`
     subclass: ImportDirectiveSubclass,
     span: Span,
     id: NodeId,
@@ -76,6 +77,7 @@ impl<'a> ImportDirective<'a> {
                -> Self {
         ImportDirective {
             module_path: module_path,
+            target_module: Cell::new(None),
             subclass: subclass,
             span: span,
             id: id,
@@ -435,6 +437,7 @@ impl<'a, 'b:'a, 'tcx:'b> ImportResolver<'a, 'b, 'tcx> {
             Indeterminate => return Indeterminate,
             Failed(err) => return Failed(err),
         };
+        directive.target_module.set(Some(target_module));
 
         let (source, target, value_determined, type_determined) = match directive.subclass {
             SingleImport { source, target, ref value_determined, ref type_determined } =>