about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2013-11-11 11:16:42 -0800
committerAlex Crichton <alex@alexcrichton.com>2013-11-11 11:26:31 -0800
commit0cc5e6c83f9d0f64ecd69cdca06511527f4f1554 (patch)
tree944d86241594d719927f3564f69a8763f0d528c9
parent4d9b95fada7c97ac1c63099bab1d45ba120958ec (diff)
downloadrust-0cc5e6c83f9d0f64ecd69cdca06511527f4f1554.tar.gz
rust-0cc5e6c83f9d0f64ecd69cdca06511527f4f1554.zip
Remove resolve's xray infrastructure
Since the removal of privacy from resolve, this flag is no longer necessary to
get the test runner working. All of the privacy checks are bypassed by a special
item attribute in the privacy visitor.

Closes #4947
-rw-r--r--src/librustc/middle/resolve.rs28
1 files changed, 0 insertions, 28 deletions
diff --git a/src/librustc/middle/resolve.rs b/src/librustc/middle/resolve.rs
index 23fef5e3516..4861fa19f7e 100644
--- a/src/librustc/middle/resolve.rs
+++ b/src/librustc/middle/resolve.rs
@@ -25,7 +25,6 @@ use syntax::ast::*;
 use syntax::ast;
 use syntax::ast_util::{def_id_of_def, local_def, mtwt_resolve};
 use syntax::ast_util::{path_to_ident, walk_pat, trait_method_to_ty_method};
-use syntax::attr;
 use syntax::parse::token;
 use syntax::parse::token::{ident_interner, interner_get};
 use syntax::parse::token::special_idents;
@@ -254,19 +253,6 @@ enum MethodSort {
     Provided(NodeId)
 }
 
-// The X-ray flag indicates that a context has the X-ray privilege, which
-// allows it to reference private names. Currently, this is used for the test
-// runner.
-//
-// FIXME #4947: The X-ray flag is kind of questionable in the first
-// place. It might be better to introduce an expr_xray_path instead.
-
-#[deriving(Eq)]
-enum XrayFlag {
-    NoXray,     //< Private items cannot be accessed.
-    Xray        //< Private items can be accessed.
-}
-
 enum UseLexicalScopeFlag {
     DontUseLexicalScope,
     UseLexicalScope
@@ -831,7 +817,6 @@ fn Resolver(session: Session,
         type_ribs: @mut ~[],
         label_ribs: @mut ~[],
 
-        xray_context: NoXray,
         current_trait_refs: None,
 
         self_ident: special_idents::self_,
@@ -883,10 +868,6 @@ struct Resolver {
     // The current set of local scopes, for labels.
     label_ribs: @mut ~[@Rib],
 
-    // Whether the current context is an X-ray context. An X-ray context is
-    // allowed to access private names of any module.
-    xray_context: XrayFlag,
-
     // The trait that the current context can refer to.
     current_trait_refs: Option<~[DefId]>,
 
@@ -3545,13 +3526,6 @@ impl Resolver {
         debug!("(resolving item) resolving {}",
                self.session.str_of(item.ident));
 
-        // Items with the !resolve_unexported attribute are X-ray contexts.
-        // This is used to allow the test runner to run unexported tests.
-        let orig_xray_flag = self.xray_context;
-        if attr::contains_name(item.attrs, "!resolve_unexported") {
-            self.xray_context = Xray;
-        }
-
         match item.node {
 
             // enum item: resolve all the variants' discrs,
@@ -3715,8 +3689,6 @@ impl Resolver {
             fail!("item macros unimplemented")
           }
         }
-
-        self.xray_context = orig_xray_flag;
     }
 
     fn with_type_parameter_rib(&mut self,