Skip to content

Commit ccc5a07

Browse files
committed
---
yaml --- r: 64824 b: refs/heads/snap-stage3 c: 63c9b11 h: refs/heads/master v: v3
1 parent ee93270 commit ccc5a07

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+765
-715
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 8a329770b6d0bc526e5873c143a5db1b551d42c1
4+
refs/heads/snap-stage3: 63c9b112b52b31f511b08438fc7f812108688804
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/compiletest/runtest.rs

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ use util::logv;
2222

2323
use std::io;
2424
use std::os;
25+
use std::str;
2526
use std::uint;
2627
use std::vec;
2728

@@ -355,6 +356,30 @@ fn check_expected_errors(expected_errors: ~[errors::ExpectedError],
355356
fmt!("%s:%u:", testfile.to_str(), ee.line)
356357
}).collect::<~[~str]>();
357358

359+
fn to_lower( s : &str ) -> ~str {
360+
let i = s.iter();
361+
let c : ~[char] = i.transform( |c| {
362+
if c.is_ascii() {
363+
c.to_ascii().to_lower().to_char()
364+
} else {
365+
c
366+
}
367+
} ).collect();
368+
str::from_chars( c )
369+
}
370+
371+
#[cfg(target_os = "win32")]
372+
fn prefix_matches( line : &str, prefix : &str ) -> bool {
373+
to_lower(line).starts_with( to_lower(prefix) )
374+
}
375+
376+
#[cfg(target_os = "linux")]
377+
#[cfg(target_os = "macos")]
378+
#[cfg(target_os = "freebsd")]
379+
fn prefix_matches( line : &str, prefix : &str ) -> bool {
380+
line.starts_with( prefix )
381+
}
382+
358383
// Scan and extract our error/warning messages,
359384
// which look like:
360385
// filename:line1:col1: line2:col2: *error:* msg
@@ -367,7 +392,7 @@ fn check_expected_errors(expected_errors: ~[errors::ExpectedError],
367392
if !found_flags[i] {
368393
debug!("prefix=%s ee.kind=%s ee.msg=%s line=%s",
369394
prefixes[i], ee.kind, ee.msg, line);
370-
if (line.starts_with(prefixes[i]) &&
395+
if (prefix_matches(line, prefixes[i]) &&
371396
line.contains(ee.kind) &&
372397
line.contains(ee.msg)) {
373398
found_flags[i] = true;

branches/snap-stage3/src/librustc/driver/driver.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ pub struct CrateAnalysis {
201201
exp_map2: middle::resolve::ExportMap2,
202202
ty_cx: ty::ctxt,
203203
maps: astencode::Maps,
204-
reachable: @mut HashSet<ast::NodeId>
204+
reachable: @mut HashSet<ast::node_id>
205205
}
206206

207207
/// Run the resolution, typechecking, region checking and other

branches/snap-stage3/src/librustc/driver/session.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use metadata::filesearch;
1818
use metadata;
1919
use middle::lint;
2020

21-
use syntax::ast::NodeId;
21+
use syntax::ast::node_id;
2222
use syntax::ast::{int_ty, uint_ty, float_ty};
2323
use syntax::codemap::span;
2424
use syntax::diagnostic;
@@ -189,13 +189,13 @@ pub struct Session_ {
189189
parse_sess: @mut ParseSess,
190190
codemap: @codemap::CodeMap,
191191
// For a library crate, this is always none
192-
entry_fn: @mut Option<(NodeId, codemap::span)>,
192+
entry_fn: @mut Option<(node_id, codemap::span)>,
193193
entry_type: @mut Option<EntryFnType>,
194194
span_diagnostic: @diagnostic::span_handler,
195195
filesearch: @filesearch::FileSearch,
196196
building_library: @mut bool,
197197
working_dir: Path,
198-
lints: @mut HashMap<ast::NodeId, ~[(lint::lint, codemap::span, ~str)]>,
198+
lints: @mut HashMap<ast::node_id, ~[(lint::lint, codemap::span, ~str)]>,
199199
}
200200

201201
pub type Session = @Session_;
@@ -248,7 +248,7 @@ impl Session_ {
248248
}
249249
pub fn add_lint(@self,
250250
lint: lint::lint,
251-
id: ast::NodeId,
251+
id: ast::node_id,
252252
sp: span,
253253
msg: ~str) {
254254
match self.lints.find_mut(&id) {
@@ -257,7 +257,7 @@ impl Session_ {
257257
}
258258
self.lints.insert(id, ~[(lint, sp, msg)]);
259259
}
260-
pub fn next_node_id(@self) -> ast::NodeId {
260+
pub fn next_node_id(@self) -> ast::node_id {
261261
return syntax::parse::next_node_id(self.parse_sess);
262262
}
263263
pub fn diagnostic(@self) -> @diagnostic::span_handler {

branches/snap-stage3/src/librustc/front/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use syntax::print::pprust;
2525
use syntax::{ast, ast_util};
2626
use syntax::attr::AttrMetaMethods;
2727

28-
type node_id_gen = @fn() -> ast::NodeId;
28+
type node_id_gen = @fn() -> ast::node_id;
2929

3030
struct Test {
3131
span: span,

branches/snap-stage3/src/librustc/metadata/csearch.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ pub fn get_type_param_count(cstore: @mut cstore::CStore, def: ast::def_id)
4444
/// Iterates over all the language items in the given crate.
4545
pub fn each_lang_item(cstore: @mut cstore::CStore,
4646
cnum: ast::CrateNum,
47-
f: &fn(ast::NodeId, uint) -> bool) -> bool {
47+
f: &fn(ast::node_id, uint) -> bool) -> bool {
4848
let crate_data = cstore::get_crate_data(cstore, cnum);
4949
decoder::each_lang_item(crate_data, f)
5050
}

branches/snap-stage3/src/librustc/metadata/cstore.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ pub struct CStore {
4343
intr: @ident_interner
4444
}
4545

46-
// Map from NodeId's of local extern mod statements to crate numbers
47-
type extern_mod_crate_map = HashMap<ast::NodeId, ast::CrateNum>;
46+
// Map from node_id's of local extern mod statements to crate numbers
47+
type extern_mod_crate_map = HashMap<ast::node_id, ast::CrateNum>;
4848

4949
pub fn mk_cstore(intr: @ident_interner) -> CStore {
5050
return CStore {
@@ -125,13 +125,13 @@ pub fn get_used_link_args<'a>(cstore: &'a CStore) -> &'a [@str] {
125125
}
126126

127127
pub fn add_extern_mod_stmt_cnum(cstore: &mut CStore,
128-
emod_id: ast::NodeId,
128+
emod_id: ast::node_id,
129129
cnum: ast::CrateNum) {
130130
cstore.extern_mod_crate_map.insert(emod_id, cnum);
131131
}
132132

133133
pub fn find_extern_mod_stmt_cnum(cstore: &CStore,
134-
emod_id: ast::NodeId)
134+
emod_id: ast::node_id)
135135
-> Option<ast::CrateNum> {
136136
cstore.extern_mod_crate_map.find(&emod_id).map_consume(|x| *x)
137137
}

branches/snap-stage3/src/librustc/metadata/decoder.rs

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ pub fn lookup_def(cnum: ast::CrateNum, data: @~[u8], did_: ast::def_id) ->
361361
}
362362

363363
pub fn get_trait_def(cdata: cmd,
364-
item_id: ast::NodeId,
364+
item_id: ast::node_id,
365365
tcx: ty::ctxt) -> ty::TraitDef
366366
{
367367
let item_doc = lookup_item(item_id, cdata.data);
@@ -375,7 +375,7 @@ pub fn get_trait_def(cdata: cmd,
375375
}
376376
}
377377

378-
pub fn get_type(cdata: cmd, id: ast::NodeId, tcx: ty::ctxt)
378+
pub fn get_type(cdata: cmd, id: ast::node_id, tcx: ty::ctxt)
379379
-> ty::ty_param_bounds_and_ty {
380380

381381
let item = lookup_item(id, cdata.data);
@@ -392,19 +392,19 @@ pub fn get_type(cdata: cmd, id: ast::NodeId, tcx: ty::ctxt)
392392
}
393393
}
394394

395-
pub fn get_region_param(cdata: cmd, id: ast::NodeId)
395+
pub fn get_region_param(cdata: cmd, id: ast::node_id)
396396
-> Option<ty::region_variance> {
397397

398398
let item = lookup_item(id, cdata.data);
399399
return item_ty_region_param(item);
400400
}
401401

402-
pub fn get_type_param_count(data: @~[u8], id: ast::NodeId) -> uint {
402+
pub fn get_type_param_count(data: @~[u8], id: ast::node_id) -> uint {
403403
item_ty_param_count(lookup_item(id, data))
404404
}
405405

406406
pub fn get_impl_trait(cdata: cmd,
407-
id: ast::NodeId,
407+
id: ast::node_id,
408408
tcx: ty::ctxt) -> Option<@ty::TraitRef>
409409
{
410410
let item_doc = lookup_item(id, cdata.data);
@@ -414,7 +414,7 @@ pub fn get_impl_trait(cdata: cmd,
414414
}
415415

416416
pub fn get_impl_vtables(cdata: cmd,
417-
id: ast::NodeId,
417+
id: ast::node_id,
418418
tcx: ty::ctxt) -> typeck::impl_res
419419
{
420420
let item_doc = lookup_item(id, cdata.data);
@@ -428,7 +428,7 @@ pub fn get_impl_vtables(cdata: cmd,
428428
}
429429

430430

431-
pub fn get_impl_method(intr: @ident_interner, cdata: cmd, id: ast::NodeId,
431+
pub fn get_impl_method(intr: @ident_interner, cdata: cmd, id: ast::node_id,
432432
name: ast::ident) -> Option<ast::def_id> {
433433
let items = reader::get_doc(reader::Doc(cdata.data), tag_items);
434434
let mut found = None;
@@ -442,7 +442,7 @@ pub fn get_impl_method(intr: @ident_interner, cdata: cmd, id: ast::NodeId,
442442
found
443443
}
444444

445-
pub fn get_symbol(data: @~[u8], id: ast::NodeId) -> ~str {
445+
pub fn get_symbol(data: @~[u8], id: ast::node_id) -> ~str {
446446
return item_symbol(lookup_item(id, data));
447447
}
448448

@@ -462,15 +462,15 @@ fn def_like_to_def(def_like: def_like) -> ast::def {
462462
}
463463

464464
/// Iterates over the language items in the given crate.
465-
pub fn each_lang_item(cdata: cmd, f: &fn(ast::NodeId, uint) -> bool) -> bool {
465+
pub fn each_lang_item(cdata: cmd, f: &fn(ast::node_id, uint) -> bool) -> bool {
466466
let root = reader::Doc(cdata.data);
467467
let lang_items = reader::get_doc(root, tag_lang_items);
468468
for reader::tagged_docs(lang_items, tag_lang_items_item) |item_doc| {
469469
let id_doc = reader::get_doc(item_doc, tag_lang_items_item_id);
470470
let id = reader::doc_as_u32(id_doc) as uint;
471471
let node_id_doc = reader::get_doc(item_doc,
472472
tag_lang_items_item_node_id);
473-
let node_id = reader::doc_as_u32(node_id_doc) as ast::NodeId;
473+
let node_id = reader::doc_as_u32(node_id_doc) as ast::node_id;
474474

475475
if !f(node_id, id) {
476476
return false;
@@ -716,7 +716,7 @@ pub fn each_path(intr: @ident_interner,
716716
context.each_child_of_module_or_crate(crate_items_doc)
717717
}
718718

719-
pub fn get_item_path(cdata: cmd, id: ast::NodeId) -> ast_map::path {
719+
pub fn get_item_path(cdata: cmd, id: ast::node_id) -> ast_map::path {
720720
item_path(lookup_item(id, cdata.data))
721721
}
722722

@@ -727,7 +727,7 @@ pub type decode_inlined_item<'self> = &'self fn(
727727
par_doc: ebml::Doc) -> Option<ast::inlined_item>;
728728

729729
pub fn maybe_get_item_ast(cdata: cmd, tcx: ty::ctxt,
730-
id: ast::NodeId,
730+
id: ast::node_id,
731731
decode_inlined_item: decode_inlined_item)
732732
-> csearch::found_ast {
733733
debug!("Looking up item: %d", id);
@@ -754,7 +754,7 @@ pub fn maybe_get_item_ast(cdata: cmd, tcx: ty::ctxt,
754754
}
755755
}
756756

757-
pub fn get_enum_variants(intr: @ident_interner, cdata: cmd, id: ast::NodeId,
757+
pub fn get_enum_variants(intr: @ident_interner, cdata: cmd, id: ast::node_id,
758758
tcx: ty::ctxt) -> ~[@ty::VariantInfo] {
759759
let data = cdata.data;
760760
let items = reader::get_doc(reader::Doc(data), tag_items);
@@ -833,7 +833,7 @@ fn item_impl_methods(intr: @ident_interner, cdata: cmd, item: ebml::Doc,
833833
}
834834

835835
/// Returns information about the given implementation.
836-
pub fn get_impl(intr: @ident_interner, cdata: cmd, impl_id: ast::NodeId,
836+
pub fn get_impl(intr: @ident_interner, cdata: cmd, impl_id: ast::node_id,
837837
tcx: ty::ctxt)
838838
-> ty::Impl {
839839
let data = cdata.data;
@@ -851,15 +851,15 @@ pub fn get_impl(intr: @ident_interner, cdata: cmd, impl_id: ast::NodeId,
851851
pub fn get_method_name_and_explicit_self(
852852
intr: @ident_interner,
853853
cdata: cmd,
854-
id: ast::NodeId) -> (ast::ident, ast::explicit_self_)
854+
id: ast::node_id) -> (ast::ident, ast::explicit_self_)
855855
{
856856
let method_doc = lookup_item(id, cdata.data);
857857
let name = item_name(intr, method_doc);
858858
let explicit_self = get_explicit_self(method_doc);
859859
(name, explicit_self)
860860
}
861861

862-
pub fn get_method(intr: @ident_interner, cdata: cmd, id: ast::NodeId,
862+
pub fn get_method(intr: @ident_interner, cdata: cmd, id: ast::node_id,
863863
tcx: ty::ctxt) -> ty::Method
864864
{
865865
let method_doc = lookup_item(id, cdata.data);
@@ -892,7 +892,7 @@ pub fn get_method(intr: @ident_interner, cdata: cmd, id: ast::NodeId,
892892
}
893893

894894
pub fn get_trait_method_def_ids(cdata: cmd,
895-
id: ast::NodeId) -> ~[ast::def_id] {
895+
id: ast::node_id) -> ~[ast::def_id] {
896896
let data = cdata.data;
897897
let item = lookup_item(id, data);
898898
let mut result = ~[];
@@ -903,7 +903,7 @@ pub fn get_trait_method_def_ids(cdata: cmd,
903903
}
904904

905905
pub fn get_provided_trait_methods(intr: @ident_interner, cdata: cmd,
906-
id: ast::NodeId, tcx: ty::ctxt) ->
906+
id: ast::node_id, tcx: ty::ctxt) ->
907907
~[@ty::Method] {
908908
let data = cdata.data;
909909
let item = lookup_item(id, data);
@@ -922,7 +922,7 @@ pub fn get_provided_trait_methods(intr: @ident_interner, cdata: cmd,
922922
}
923923

924924
/// Returns the supertraits of the given trait.
925-
pub fn get_supertraits(cdata: cmd, id: ast::NodeId, tcx: ty::ctxt)
925+
pub fn get_supertraits(cdata: cmd, id: ast::node_id, tcx: ty::ctxt)
926926
-> ~[@ty::TraitRef] {
927927
let mut results = ~[];
928928
let item_doc = lookup_item(id, cdata.data);
@@ -933,7 +933,7 @@ pub fn get_supertraits(cdata: cmd, id: ast::NodeId, tcx: ty::ctxt)
933933
}
934934

935935
pub fn get_type_name_if_impl(cdata: cmd,
936-
node_id: ast::NodeId) -> Option<ast::ident> {
936+
node_id: ast::node_id) -> Option<ast::ident> {
937937
let item = lookup_item(node_id, cdata.data);
938938
if item_family(item) != Impl {
939939
return None;
@@ -948,7 +948,7 @@ pub fn get_type_name_if_impl(cdata: cmd,
948948

949949
pub fn get_static_methods_if_impl(intr: @ident_interner,
950950
cdata: cmd,
951-
node_id: ast::NodeId)
951+
node_id: ast::node_id)
952952
-> Option<~[StaticMethodInfo]> {
953953
let item = lookup_item(node_id, cdata.data);
954954
if item_family(item) != Impl {
@@ -992,7 +992,7 @@ pub fn get_static_methods_if_impl(intr: @ident_interner,
992992
}
993993

994994
pub fn get_item_attrs(cdata: cmd,
995-
node_id: ast::NodeId,
995+
node_id: ast::node_id,
996996
f: &fn(~[@ast::MetaItem])) {
997997

998998
let item = lookup_item(node_id, cdata.data);
@@ -1012,7 +1012,7 @@ fn struct_field_family_to_visibility(family: Family) -> ast::visibility {
10121012
}
10131013
}
10141014

1015-
pub fn get_struct_fields(intr: @ident_interner, cdata: cmd, id: ast::NodeId)
1015+
pub fn get_struct_fields(intr: @ident_interner, cdata: cmd, id: ast::node_id)
10161016
-> ~[ty::field_ty] {
10171017
let data = cdata.data;
10181018
let item = lookup_item(id, data);
@@ -1040,7 +1040,7 @@ pub fn get_struct_fields(intr: @ident_interner, cdata: cmd, id: ast::NodeId)
10401040
result
10411041
}
10421042

1043-
pub fn get_item_visibility(cdata: cmd, id: ast::NodeId)
1043+
pub fn get_item_visibility(cdata: cmd, id: ast::node_id)
10441044
-> ast::visibility {
10451045
item_visibility(lookup_item(id, cdata.data))
10461046
}
@@ -1068,7 +1068,7 @@ fn read_path(d: ebml::Doc) -> (~str, uint) {
10681068
}
10691069

10701070
fn describe_def(items: ebml::Doc, id: ast::def_id) -> ~str {
1071-
if id.crate != ast::LOCAL_CRATE { return ~"external"; }
1071+
if id.crate != ast::local_crate { return ~"external"; }
10721072
let it = match maybe_find_item(id.node, items) {
10731073
Some(it) => it,
10741074
None => fail!("describe_def: item not found %?", id)
@@ -1260,7 +1260,7 @@ pub fn list_crate_metadata(intr: @ident_interner, bytes: @~[u8],
12601260
// then we must translate the crate number from that encoded in the external
12611261
// crate to the correct local crate number.
12621262
pub fn translate_def_id(cdata: cmd, did: ast::def_id) -> ast::def_id {
1263-
if did.crate == ast::LOCAL_CRATE {
1263+
if did.crate == ast::local_crate {
12641264
return ast::def_id { crate: cdata.cnum, node: did.node };
12651265
}
12661266

0 commit comments

Comments
 (0)