Skip to content

Commit 0cc5e6c

Browse files
committed
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
1 parent 4d9b95f commit 0cc5e6c

File tree

1 file changed

+0
-28
lines changed

1 file changed

+0
-28
lines changed

src/librustc/middle/resolve.rs

-28
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ use syntax::ast::*;
2525
use syntax::ast;
2626
use syntax::ast_util::{def_id_of_def, local_def, mtwt_resolve};
2727
use syntax::ast_util::{path_to_ident, walk_pat, trait_method_to_ty_method};
28-
use syntax::attr;
2928
use syntax::parse::token;
3029
use syntax::parse::token::{ident_interner, interner_get};
3130
use syntax::parse::token::special_idents;
@@ -254,19 +253,6 @@ enum MethodSort {
254253
Provided(NodeId)
255254
}
256255

257-
// The X-ray flag indicates that a context has the X-ray privilege, which
258-
// allows it to reference private names. Currently, this is used for the test
259-
// runner.
260-
//
261-
// FIXME #4947: The X-ray flag is kind of questionable in the first
262-
// place. It might be better to introduce an expr_xray_path instead.
263-
264-
#[deriving(Eq)]
265-
enum XrayFlag {
266-
NoXray, //< Private items cannot be accessed.
267-
Xray //< Private items can be accessed.
268-
}
269-
270256
enum UseLexicalScopeFlag {
271257
DontUseLexicalScope,
272258
UseLexicalScope
@@ -831,7 +817,6 @@ fn Resolver(session: Session,
831817
type_ribs: @mut ~[],
832818
label_ribs: @mut ~[],
833819

834-
xray_context: NoXray,
835820
current_trait_refs: None,
836821

837822
self_ident: special_idents::self_,
@@ -883,10 +868,6 @@ struct Resolver {
883868
// The current set of local scopes, for labels.
884869
label_ribs: @mut ~[@Rib],
885870

886-
// Whether the current context is an X-ray context. An X-ray context is
887-
// allowed to access private names of any module.
888-
xray_context: XrayFlag,
889-
890871
// The trait that the current context can refer to.
891872
current_trait_refs: Option<~[DefId]>,
892873

@@ -3545,13 +3526,6 @@ impl Resolver {
35453526
debug!("(resolving item) resolving {}",
35463527
self.session.str_of(item.ident));
35473528

3548-
// Items with the !resolve_unexported attribute are X-ray contexts.
3549-
// This is used to allow the test runner to run unexported tests.
3550-
let orig_xray_flag = self.xray_context;
3551-
if attr::contains_name(item.attrs, "!resolve_unexported") {
3552-
self.xray_context = Xray;
3553-
}
3554-
35553529
match item.node {
35563530

35573531
// enum item: resolve all the variants' discrs,
@@ -3715,8 +3689,6 @@ impl Resolver {
37153689
fail!("item macros unimplemented")
37163690
}
37173691
}
3718-
3719-
self.xray_context = orig_xray_flag;
37203692
}
37213693

37223694
fn with_type_parameter_rib(&mut self,

0 commit comments

Comments
 (0)