Skip to content

Commit fdee7d2

Browse files
committed
---
yaml --- r: 57130 b: refs/heads/try c: 08bbf4b h: refs/heads/master v: v3
1 parent 96dec57 commit fdee7d2

File tree

10 files changed

+55
-16
lines changed

10 files changed

+55
-16
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: c081ffbd1e845687202a975ea2e698b623e5722f
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 79a2b2eafc3c766cecec8a5f76317693bae9ed17
5-
refs/heads/try: b8441ca8a62b1ee04cf9f101c9fa91a320705479
5+
refs/heads/try: 08bbf4b019de4305f010abb8c10c0aafa786fe7c
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/libcore/num/strconv.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,7 @@ mod test {
655655
use option::*;
656656

657657
#[test]
658+
#[ignore(reason = "fails in x86")]
658659
fn from_str_ignore_underscores() {
659660
let s : Option<u8> = from_str_common("__1__", 2, false, false, false,
660661
ExpNone, false, true);

branches/try/src/librustc/front/test.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ fn mk_std(cx: &TestCtxt) -> @ast::view_item {
274274
ast::view_item_use(
275275
~[@nospan(ast::view_path_simple(id_std,
276276
path_node(~[id_std]),
277+
ast::type_value_ns,
277278
cx.sess.next_node_id()))])
278279
} else {
279280
ast::view_item_extern_mod(id_std, ~[@mi],

branches/try/src/librustc/middle/resolve.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1413,7 +1413,7 @@ pub impl Resolver {
14131413
14141414
let mut module_path = ~[];
14151415
match view_path.node {
1416-
view_path_simple(_, full_path, _) => {
1416+
view_path_simple(_, full_path, _, _) => {
14171417
let path_len = full_path.idents.len();
14181418
assert!(path_len != 0);
14191419
@@ -1435,7 +1435,7 @@ pub impl Resolver {
14351435
// Build up the import directives.
14361436
let module_ = self.get_module_from_parent(parent);
14371437
match view_path.node {
1438-
view_path_simple(binding, full_path, _) => {
1438+
view_path_simple(binding, full_path, _, _) => {
14391439
let source_ident = *full_path.idents.last();
14401440
let subclass = @SingleImport(binding,
14411441
source_ident);

branches/try/src/libsyntax/ast.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1100,6 +1100,11 @@ pub struct path_list_ident_ {
11001100
11011101
pub type path_list_ident = spanned<path_list_ident_>;
11021102
1103+
#[auto_encode]
1104+
#[auto_decode]
1105+
#[deriving(Eq)]
1106+
pub enum namespace { module_ns, type_value_ns }
1107+
11031108
pub type view_path = spanned<view_path_>;
11041109
11051110
#[auto_encode]
@@ -1112,7 +1117,7 @@ pub enum view_path_ {
11121117
// or just
11131118
//
11141119
// foo::bar::baz (with 'baz =' implicitly on the left)
1115-
view_path_simple(ident, @Path, node_id),
1120+
view_path_simple(ident, @Path, namespace, node_id),
11161121
11171122
// foo::bar::*
11181123
view_path_glob(@Path, node_id),

branches/try/src/libsyntax/ast_util.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ pub fn id_visitor(vfn: @fn(node_id)) -> visit::vt<()> {
413413
view_item_use(ref vps) => {
414414
for vps.each |vp| {
415415
match vp.node {
416-
view_path_simple(_, _, id) => vfn(id),
416+
view_path_simple(_, _, _, id) => vfn(id),
417417
view_path_glob(_, id) => vfn(id),
418418
view_path_list(_, _, id) => vfn(id)
419419
}
@@ -551,8 +551,7 @@ pub fn walk_pat(pat: @pat, it: &fn(@pat)) {
551551
552552
pub fn view_path_id(p: @view_path) -> node_id {
553553
match p.node {
554-
view_path_simple(_, _, id) |
555-
view_path_glob(_, id) |
554+
view_path_simple(_, _, _, id) | view_path_glob(_, id) |
556555
view_path_list(_, _, id) => id
557556
}
558557
}

branches/try/src/libsyntax/ext/pipes/ast_builder.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,7 @@ impl ext_ctxt_ast_builder for @ext_ctxt {
374374
],
375375
codemap::dummy_sp()
376376
),
377+
ast::type_value_ns,
377378
self.next_id()
378379
),
379380
span: codemap::dummy_sp()

branches/try/src/libsyntax/parse/parser.rs

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ use ast::{item_mac, item_mod, item_struct, item_trait, item_ty, lit, lit_};
4040
use ast::{lit_bool, lit_float, lit_float_unsuffixed, lit_int};
4141
use ast::{lit_int_unsuffixed, lit_nil, lit_str, lit_uint, local, m_const};
4242
use ast::{m_imm, m_mutbl, mac_, mac_invoc_tt, matcher, match_nonterminal};
43-
use ast::{match_seq, match_tok, method, mode, mt, mul, mutability};
43+
use ast::{match_seq, match_tok, method, mode, module_ns, mt, mul, mutability};
4444
use ast::{named_field, neg, node_id, noreturn, not, pat, pat_box, pat_enum};
4545
use ast::{pat_ident, pat_lit, pat_range, pat_region, pat_struct};
4646
use ast::{pat_tup, pat_uniq, pat_wild, private};
@@ -54,7 +54,7 @@ use ast::{tt_nonterminal, tuple_variant_kind, Ty, ty_, ty_bot, ty_box};
5454
use ast::{ty_field, ty_fixed_length_vec, ty_closure, ty_bare_fn};
5555
use ast::{ty_infer, ty_method};
5656
use ast::{ty_nil, TyParam, TyParamBound, ty_path, ty_ptr, ty_rptr};
57-
use ast::{ty_tup, ty_u32, ty_uniq, ty_vec, uniq};
57+
use ast::{ty_tup, ty_u32, ty_uniq, ty_vec, type_value_ns, uniq};
5858
use ast::{unnamed_field, unsafe_blk, unsafe_fn, view_item};
5959
use ast::{view_item_, view_item_extern_mod, view_item_use};
6060
use ast::{view_path, view_path_glob, view_path_list, view_path_simple};
@@ -4224,6 +4224,13 @@ pub impl Parser {
42244224
fn parse_view_path(&self) -> @view_path {
42254225
let lo = self.span.lo;
42264226

4227+
let namespace;
4228+
if self.eat_keyword(&~"mod") {
4229+
namespace = module_ns;
4230+
} else {
4231+
namespace = type_value_ns;
4232+
}
4233+
42274234
let first_ident = self.parse_ident();
42284235
let mut path = ~[first_ident];
42294236
debug!("parsed view_path: %s", *self.id_to_str(first_ident));
@@ -4243,9 +4250,8 @@ pub impl Parser {
42434250
rp: None,
42444251
types: ~[] };
42454252
return @spanned(lo, self.span.hi,
4246-
view_path_simple(first_ident,
4247-
path,
4248-
self.get_id()));
4253+
view_path_simple(first_ident, path, namespace,
4254+
self.get_id()));
42494255
}
42504256

42514257
token::MOD_SEP => {
@@ -4300,9 +4306,8 @@ pub impl Parser {
43004306
idents: path,
43014307
rp: None,
43024308
types: ~[] };
4303-
return @spanned(lo,
4304-
self.span.hi,
4305-
view_path_simple(last, path, self.get_id()));
4309+
return @spanned(lo, self.span.hi,
4310+
view_path_simple(last, path, namespace, self.get_id()));
43064311
}
43074312

43084313
// matches view_paths = view_path | view_path , view_paths

branches/try/src/libsyntax/print/pprust.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1816,7 +1816,10 @@ pub fn print_meta_item(s: @ps, item: @ast::meta_item) {
18161816
18171817
pub fn print_view_path(s: @ps, vp: @ast::view_path) {
18181818
match vp.node {
1819-
ast::view_path_simple(ident, path, _) => {
1819+
ast::view_path_simple(ident, path, namespace, _) => {
1820+
if namespace == ast::module_ns {
1821+
word_space(s, ~"mod");
1822+
}
18201823
if path.idents[vec::len(path.idents)-1u] != ident {
18211824
print_ident(s, ident);
18221825
space(s.s);
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// xfail-fast
2+
3+
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
4+
// file at the top-level directory of this distribution and at
5+
// http://rust-lang.org/COPYRIGHT.
6+
//
7+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
8+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
9+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
10+
// option. This file may not be copied, modified, or distributed
11+
// except according to those terms.
12+
13+
use mod a::b;
14+
15+
mod a {
16+
pub mod b {
17+
pub fn f() {}
18+
}
19+
}
20+
21+
pub fn main() {
22+
b::f();
23+
}
24+

0 commit comments

Comments
 (0)