Skip to content

Module ns 2 #3751

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/fuzzer/fuzzer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ pure fn safe_to_use_expr(e: ast::expr, tm: test_mode) -> bool {
}
}

fn safe_to_steal_ty(t: @ast::ty, tm: test_mode) -> bool {
fn safe_to_steal_ty(t: @ast::Ty, tm: test_mode) -> bool {
// Restrictions happen to be the same.
safe_to_replace_ty(t.node, tm)
}
Expand All @@ -119,16 +119,16 @@ fn stash_expr_if(c: fn@(@ast::expr, test_mode)->bool,
} else {/* now my indices are wrong :( */ }
}

fn stash_ty_if(c: fn@(@ast::ty, test_mode)->bool,
es: @mut ~[ast::ty],
e: @ast::ty,
fn stash_ty_if(c: fn@(@ast::Ty, test_mode)->bool,
es: @mut ~[ast::Ty],
e: @ast::Ty,
tm: test_mode) {
if c(e, tm) {
es.push(*e);
} else {/* now my indices are wrong :( */ }
}

type stolen_stuff = {exprs: ~[ast::expr], tys: ~[ast::ty]};
type stolen_stuff = {exprs: ~[ast::expr], tys: ~[ast::Ty]};

fn steal(crate: ast::crate, tm: test_mode) -> stolen_stuff {
let exprs = @mut ~[];
Expand Down Expand Up @@ -195,7 +195,7 @@ fn replace_expr_in_crate(crate: ast::crate, i: uint,


// Replace the |i|th ty (in fold order) of |crate| with |newty|.
fn replace_ty_in_crate(crate: ast::crate, i: uint, newty: ast::ty,
fn replace_ty_in_crate(crate: ast::crate, i: uint, newty: ast::Ty,
tm: test_mode) -> ast::crate {
let j: @mut uint = @mut 0u;
fn fold_ty_rep(j_: @mut uint, i_: uint, newty_: ast::ty_,
Expand Down Expand Up @@ -225,7 +225,7 @@ fn as_str(f: fn@(+x: io::Writer)) -> ~str {
io::with_str_writer(f)
}

fn check_variants_of_ast(crate: ast::crate, codemap: codemap::codemap,
fn check_variants_of_ast(crate: ast::crate, codemap: codemap::CodeMap,
filename: &Path, cx: context) {
let stolen = steal(crate, cx.mode);
let extra_exprs = vec::filter(common_exprs(),
Expand All @@ -239,7 +239,7 @@ fn check_variants_of_ast(crate: ast::crate, codemap: codemap::codemap,

fn check_variants_T<T: Copy>(
crate: ast::crate,
codemap: codemap::codemap,
codemap: codemap::CodeMap,
filename: &Path,
thing_label: ~str,
things: ~[T],
Expand Down Expand Up @@ -444,7 +444,7 @@ fn parse_and_print(code: @~str) -> ~str {

fn has_raw_pointers(c: ast::crate) -> bool {
let has_rp = @mut false;
fn visit_ty(flag: @mut bool, t: @ast::ty) {
fn visit_ty(flag: @mut bool, t: @ast::Ty) {
match t.node {
ast::ty_ptr(_) => { *flag = true; }
_ => { }
Expand Down
4 changes: 2 additions & 2 deletions src/libcore/cmath.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use libc::c_double;

#[link_name = "m"]
#[abi = "cdecl"]
pub extern mod c_double {
pub extern mod c_double_utils {

// Alpabetically sorted by link_name

Expand Down Expand Up @@ -87,7 +87,7 @@ pub extern mod c_double {

#[link_name = "m"]
#[abi = "cdecl"]
pub extern mod c_float {
pub extern mod c_float_utils {

// Alpabetically sorted by link_name

Expand Down
2 changes: 1 addition & 1 deletion src/libcore/f32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

//! Operations and constants for `f32`

pub use cmath::c_float::*;
pub use cmath::c_float_utils::*;
pub use cmath::c_float_targ_consts::*;

// These are not defined inside consts:: for consistency with
Expand Down
4 changes: 2 additions & 2 deletions src/libcore/f64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

//! Operations and constants for `f64`

pub use cmath::c_double::*;
pub use cmath::c_double_utils::*;
pub use cmath::c_double_targ_consts::*;

// FIXME (#1433): obtain these in a different way
Expand Down Expand Up @@ -59,7 +59,7 @@ pub pure fn ge(x: f64, y: f64) -> bool { return x >= y; }
pub pure fn gt(x: f64, y: f64) -> bool { return x > y; }

pub pure fn sqrt(x: f64) -> f64 {
cmath::c_double::sqrt(x as libc::c_double) as f64
cmath::c_double_utils::sqrt(x as libc::c_double) as f64
}

/// Returns true if `x` is a positive number, including +0.0f640 and +Infinity
Expand Down
6 changes: 3 additions & 3 deletions src/libcore/libc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ pub use funcs::extra::*;

pub use size_t;
pub use c_float, c_double, c_void, FILE, fpos_t;
pub use DIR, dirent;
pub use DIR, dirent_t;
pub use c_char, c_schar, c_uchar;
pub use c_short, c_ushort, c_int, c_uint, c_long, c_ulong;
pub use size_t, ptrdiff_t, clock_t, time_t;
Expand Down Expand Up @@ -147,7 +147,7 @@ mod types {
}
pub mod posix88 {
pub enum DIR {}
pub enum dirent {}
pub enum dirent_t {}
}
pub mod posix01 {}
pub mod posix08 {}
Expand Down Expand Up @@ -1019,7 +1019,7 @@ pub mod funcs {
pub extern mod dirent {
fn opendir(dirname: *c_char) -> *DIR;
fn closedir(dirp: *DIR) -> c_int;
fn readdir(dirp: *DIR) -> *dirent;
fn readdir(dirp: *DIR) -> *dirent_t;
fn rewinddir(dirp: *DIR);
fn seekdir(dirp: *DIR, loc: c_long);
fn telldir(dirp: *DIR) -> c_long;
Expand Down
50 changes: 25 additions & 25 deletions src/libsyntax/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ type path = {span: span,
global: bool,
idents: ~[ident],
rp: Option<@region>,
types: ~[@ty]};
types: ~[@Ty]};

type crate_num = int;

Expand All @@ -107,7 +107,7 @@ enum ty_param_bound {
bound_send,
bound_const,
bound_owned,
bound_trait(@ty),
bound_trait(@Ty),
}

#[auto_serialize]
Expand Down Expand Up @@ -650,7 +650,7 @@ type initializer = {op: init_op, expr: @expr};
// a refinement on pat.
#[auto_serialize]
#[auto_deserialize]
type local_ = {is_mutbl: bool, ty: @ty, pat: @pat,
type local_ = {is_mutbl: bool, ty: @Ty, pat: @pat,
init: Option<initializer>, id: node_id};

type local = spanned<local_>;
Expand Down Expand Up @@ -712,7 +712,7 @@ enum expr_ {
expr_binary(binop, @expr, @expr),
expr_unary(unop, @expr),
expr_lit(@lit),
expr_cast(@expr, @ty),
expr_cast(@expr, @Ty),
expr_if(@expr, blk, Option<@expr>),
expr_while(@expr, blk),
/* Conditionless loop (can be exited with break, cont, ret, or fail)
Expand All @@ -736,7 +736,7 @@ enum expr_ {
expr_assign(@expr, @expr),
expr_swap(@expr, @expr),
expr_assign_op(binop, @expr, @expr),
expr_field(@expr, ident, ~[@ty]),
expr_field(@expr, ident, ~[@Ty]),
expr_index(@expr, @expr),
expr_path(@path),
expr_addr_of(mutability, @expr),
Expand Down Expand Up @@ -791,10 +791,10 @@ type capture_clause = @~[capture_item];
#[auto_deserialize]
#[doc="For macro invocations; parsing is delegated to the macro"]
enum token_tree {
tt_tok(span, token::token),
tt_tok(span, token::Token),
tt_delim(~[token_tree]),
// These only make sense for right-hand-sides of MBE macros
tt_seq(span, ~[token_tree], Option<token::token>, bool),
tt_seq(span, ~[token_tree], Option<token::Token>, bool),
tt_nonterminal(span, ident)
}

Expand Down Expand Up @@ -856,10 +856,10 @@ type matcher = spanned<matcher_>;
#[auto_deserialize]
enum matcher_ {
// match one token
match_tok(token::token),
match_tok(token::Token),
// match repetitions of a sequence: body, separator, zero ok?,
// lo, hi position-in-match-array used:
match_seq(~[matcher], Option<token::token>, bool, uint, uint),
match_seq(~[matcher], Option<token::Token>, bool, uint, uint),
// parse a Rust NT: name to bind, name of NT, position in match array:
match_nonterminal(ident, ident, uint)
}
Expand Down Expand Up @@ -932,7 +932,7 @@ impl ast::lit_: cmp::Eq {
// type structure in middle/ty.rs as well.
#[auto_serialize]
#[auto_deserialize]
type mt = {ty: @ty, mutbl: mutability};
type mt = {ty: @Ty, mutbl: mutability};

#[auto_serialize]
#[auto_deserialize]
Expand Down Expand Up @@ -1035,7 +1035,7 @@ impl float_ty : cmp::Eq {

#[auto_serialize]
#[auto_deserialize]
type ty = {id: node_id, node: ty_, span: span};
type Ty = {id: node_id, node: ty_, span: span};

// Not represented directly in the AST, referred to by name through a ty_path.
#[auto_serialize]
Expand Down Expand Up @@ -1111,9 +1111,9 @@ enum ty_ {
ty_rptr(@region, mt),
ty_rec(~[ty_field]),
ty_fn(proto, purity, @~[ty_param_bound], fn_decl),
ty_tup(~[@ty]),
ty_tup(~[@Ty]),
ty_path(@path, node_id),
ty_fixed_length(@ty, Option<uint>),
ty_fixed_length(@Ty, Option<uint>),
ty_mac(mac),
// ty_infer means the type should be inferred instead of it having been
// specified. This should only appear at the "top level" of a type and not
Expand All @@ -1123,16 +1123,16 @@ enum ty_ {

// Equality and byte-iter (hashing) can be quite approximate for AST types.
// since we only care about this for normalizing them to "real" types.
impl ty : cmp::Eq {
pure fn eq(other: &ty) -> bool {
impl Ty : cmp::Eq {
pure fn eq(other: &Ty) -> bool {
ptr::addr_of(&self) == ptr::addr_of(&(*other))
}
pure fn ne(other: &ty) -> bool {
pure fn ne(other: &Ty) -> bool {
ptr::addr_of(&self) != ptr::addr_of(&(*other))
}
}

impl ty : to_bytes::IterBytes {
impl Ty : to_bytes::IterBytes {
pure fn iter_bytes(+lsb0: bool, f: to_bytes::Cb) {
to_bytes::iter_bytes_2(&self.span.lo, &self.span.hi, lsb0, f);
}
Expand All @@ -1141,13 +1141,13 @@ impl ty : to_bytes::IterBytes {

#[auto_serialize]
#[auto_deserialize]
type arg = {mode: mode, ty: @ty, ident: ident, id: node_id};
type arg = {mode: mode, ty: @Ty, ident: ident, id: node_id};

#[auto_serialize]
#[auto_deserialize]
type fn_decl =
{inputs: ~[arg],
output: @ty,
output: @Ty,
cf: ret_style};

#[auto_serialize]
Expand Down Expand Up @@ -1310,7 +1310,7 @@ type foreign_mod =

#[auto_serialize]
#[auto_deserialize]
type variant_arg = {ty: @ty, id: node_id};
type variant_arg = {ty: @Ty, id: node_id};

#[auto_serialize]
#[auto_deserialize]
Expand Down Expand Up @@ -1443,7 +1443,7 @@ impl visibility : cmp::Eq {
type struct_field_ = {
kind: struct_field_kind,
id: node_id,
ty: @ty
ty: @Ty
};

type struct_field = spanned<struct_field_>;
Expand Down Expand Up @@ -1481,17 +1481,17 @@ type item = {ident: ident, attrs: ~[attribute],
#[auto_serialize]
#[auto_deserialize]
enum item_ {
item_const(@ty, @expr),
item_const(@Ty, @expr),
item_fn(fn_decl, purity, ~[ty_param], blk),
item_mod(_mod),
item_foreign_mod(foreign_mod),
item_ty(@ty, ~[ty_param]),
item_ty(@Ty, ~[ty_param]),
item_enum(enum_def, ~[ty_param]),
item_class(@struct_def, ~[ty_param]),
item_trait(~[ty_param], ~[@trait_ref], ~[trait_method]),
item_impl(~[ty_param],
Option<@trait_ref>, /* (optional) trait this impl implements */
@ty, /* self */
@Ty, /* self */
~[@method]),
item_mac(mac),
}
Expand Down Expand Up @@ -1551,7 +1551,7 @@ type foreign_item =
#[auto_deserialize]
enum foreign_item_ {
foreign_item_fn(fn_decl, purity, ~[ty_param]),
foreign_item_const(@ty)
foreign_item_const(@Ty)
}

// The data we save and restore about an inlined item or method. This is not
Expand Down
2 changes: 1 addition & 1 deletion src/libsyntax/ast_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ fn id_visitor(vfn: fn@(node_id)) -> visit::vt<()> {
visit_expr_post: fn@(_e: @expr) {
},

visit_ty: fn@(t: @ty) {
visit_ty: fn@(t: @Ty) {
match t.node {
ty_path(_, id) => vfn(id),
_ => { /* fall through */ }
Expand Down
Loading