Skip to content

Commit 93af6d9

Browse files
author
blake2-ppc
committed
---
yaml --- r: 78813 b: refs/heads/try c: 4de9bca h: refs/heads/master i: 78811: c7e48eb v: v3
1 parent a2827dc commit 93af6d9

File tree

16 files changed

+568
-526
lines changed

16 files changed

+568
-526
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: 25ed29a0edb3d48fef843a0b818ee68faf2252da
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 60fba4d7d677ec098e6a43014132fe99f7547363
5-
refs/heads/try: 2f82d89b2869adb4b1b17d19303676fa635d5df3
5+
refs/heads/try: 4de9bca4d813b88f06f7c5f64d2c452c80611f6b
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/libextra/getopts.rs

Lines changed: 5 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -689,9 +689,9 @@ pub mod groups {
689689
}
690690
}
691691

692-
// FIXME: #5516 should be graphemes not codepoints
692+
// FIXME: #5516
693693
// here we just need to indent the start of the description
694-
let rowlen = row.char_len();
694+
let rowlen = row.len();
695695
if rowlen < 24 {
696696
do (24 - rowlen).times {
697697
row.push_char(' ')
@@ -707,14 +707,14 @@ pub mod groups {
707707
desc_normalized_whitespace.push_char(' ');
708708
}
709709

710-
// FIXME: #5516 should be graphemes not codepoints
710+
// FIXME: #5516
711711
let mut desc_rows = ~[];
712712
do each_split_within(desc_normalized_whitespace, 54) |substr| {
713713
desc_rows.push(substr.to_owned());
714714
true
715715
};
716716

717-
// FIXME: #5516 should be graphemes not codepoints
717+
// FIXME: #5516
718718
// wrapped description
719719
row.push_str(desc_rows.connect(desc_sep));
720720

@@ -798,7 +798,7 @@ pub mod groups {
798798
cont
799799
};
800800

801-
ss.char_offset_iter().advance(|x| machine(x));
801+
ss.iter().enumerate().advance(|x| machine(x));
802802

803803
// Let the automaton 'run out' by supplying trailing whitespace
804804
while cont && match state { B | C => true, A => false } {
@@ -1580,31 +1580,4 @@ Options:
15801580
debug!("generated: <<%s>>", usage);
15811581
assert!(usage == expected)
15821582
}
1583-
1584-
#[test]
1585-
fn test_groups_usage_description_multibyte_handling() {
1586-
let optgroups = ~[
1587-
groups::optflag("k", "k\u2013w\u2013",
1588-
"The word kiwi is normally spelled with two i's"),
1589-
groups::optflag("a", "apple",
1590-
"This \u201Cdescription\u201D has some characters that could \
1591-
confuse the line wrapping; an apple costs 0.51€ in some parts of Europe."),
1592-
];
1593-
1594-
let expected =
1595-
~"Usage: fruits
1596-
1597-
Options:
1598-
-k --k–w– The word kiwi is normally spelled with two i's
1599-
-a --apple This “description” has some characters that could
1600-
confuse the line wrapping; an apple costs 0.51in
1601-
some parts of Europe.
1602-
";
1603-
1604-
let usage = groups::usage("Usage: fruits", optgroups);
1605-
1606-
debug!("expected: <<%s>>", expected);
1607-
debug!("generated: <<%s>>", usage);
1608-
assert!(usage == expected)
1609-
}
16101583
}

branches/try/src/librustc/back/arm.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use driver::session::sess_os_to_meta_os;
1313
use driver::session;
1414
use metadata::loader::meta_section_name;
1515

16-
pub fn get_target_strs(target_triple: ~str, target_os: session::os) -> target_strs::t {
16+
pub fn get_target_strs(target_os: session::os) -> target_strs::t {
1717
return target_strs::t {
1818
module_asm: ~"",
1919

@@ -61,7 +61,13 @@ pub fn get_target_strs(target_triple: ~str, target_os: session::os) -> target_st
6161
}
6262
},
6363

64-
target_triple: target_triple,
64+
target_triple: match target_os {
65+
session::os_macos => ~"arm-apple-darwin",
66+
session::os_win32 => ~"arm-pc-mingw32",
67+
session::os_linux => ~"arm-unknown-linux-gnueabihf",
68+
session::os_android => ~"arm-linux-androideabi",
69+
session::os_freebsd => ~"arm-unknown-freebsd"
70+
},
6571

6672
cc_args: ~[~"-marm"]
6773
};

branches/try/src/librustc/back/mips.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use driver::session;
1313
use driver::session::sess_os_to_meta_os;
1414
use metadata::loader::meta_section_name;
1515

16-
pub fn get_target_strs(target_triple: ~str, target_os: session::os) -> target_strs::t {
16+
pub fn get_target_strs(target_os: session::os) -> target_strs::t {
1717
return target_strs::t {
1818
module_asm: ~"",
1919

@@ -61,7 +61,13 @@ pub fn get_target_strs(target_triple: ~str, target_os: session::os) -> target_st
6161
}
6262
},
6363

64-
target_triple: target_triple,
64+
target_triple: match target_os {
65+
session::os_macos => ~"mips-apple-darwin",
66+
session::os_win32 => ~"mips-pc-mingw32",
67+
session::os_linux => ~"mips-unknown-linux-gnu",
68+
session::os_android => ~"mips-unknown-android-gnu",
69+
session::os_freebsd => ~"mips-unknown-freebsd"
70+
},
6571

6672
cc_args: ~[]
6773
};

branches/try/src/librustc/back/x86.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use driver::session::sess_os_to_meta_os;
1414
use driver::session;
1515
use metadata::loader::meta_section_name;
1616

17-
pub fn get_target_strs(target_triple: ~str, target_os: session::os) -> target_strs::t {
17+
pub fn get_target_strs(target_os: session::os) -> target_strs::t {
1818
return target_strs::t {
1919
module_asm: ~"",
2020

@@ -44,7 +44,13 @@ pub fn get_target_strs(target_triple: ~str, target_os: session::os) -> target_st
4444
}
4545
},
4646

47-
target_triple: target_triple,
47+
target_triple: match target_os {
48+
session::os_macos => ~"i686-apple-darwin",
49+
session::os_win32 => ~"i686-pc-mingw32",
50+
session::os_linux => ~"i686-unknown-linux-gnu",
51+
session::os_android => ~"i686-unknown-android-gnu",
52+
session::os_freebsd => ~"i686-unknown-freebsd"
53+
},
4854

4955
cc_args: ~[~"-m32"]
5056
};

branches/try/src/librustc/back/x86_64.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use driver::session::sess_os_to_meta_os;
1414
use driver::session;
1515
use metadata::loader::meta_section_name;
1616

17-
pub fn get_target_strs(target_triple: ~str, target_os: session::os) -> target_strs::t {
17+
pub fn get_target_strs(target_os: session::os) -> target_strs::t {
1818
return target_strs::t {
1919
module_asm: ~"",
2020

@@ -52,7 +52,13 @@ pub fn get_target_strs(target_triple: ~str, target_os: session::os) -> target_st
5252
}
5353
},
5454

55-
target_triple: target_triple,
55+
target_triple: match target_os {
56+
session::os_macos => ~"x86_64-apple-darwin",
57+
session::os_win32 => ~"x86_64-pc-mingw32",
58+
session::os_linux => ~"x86_64-unknown-linux-gnu",
59+
session::os_android => ~"x86_64-unknown-android-gnu",
60+
session::os_freebsd => ~"x86_64-unknown-freebsd",
61+
},
5662

5763
cc_args: ~[~"-m64"]
5864
};

branches/try/src/librustc/driver/driver.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -570,12 +570,11 @@ pub fn build_target_config(sopts: @session::options,
570570
abi::Arm => (ast::ty_i32, ast::ty_u32, ast::ty_f64),
571571
abi::Mips => (ast::ty_i32, ast::ty_u32, ast::ty_f64)
572572
};
573-
let target_triple = sopts.target_triple.clone();
574573
let target_strs = match arch {
575-
abi::X86 => x86::get_target_strs(target_triple, os),
576-
abi::X86_64 => x86_64::get_target_strs(target_triple, os),
577-
abi::Arm => arm::get_target_strs(target_triple, os),
578-
abi::Mips => mips::get_target_strs(target_triple, os)
574+
abi::X86 => x86::get_target_strs(os),
575+
abi::X86_64 => x86_64::get_target_strs(os),
576+
abi::Arm => arm::get_target_strs(os),
577+
abi::Mips => mips::get_target_strs(os)
579578
};
580579
let target_cfg = @session::config {
581580
os: os,

branches/try/src/librustc/metadata/creader.rs

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use syntax::codemap::{span, dummy_sp};
2525
use syntax::diagnostic::span_handler;
2626
use syntax::parse::token;
2727
use syntax::parse::token::ident_interner;
28-
use syntax::visit;
28+
use syntax::oldvisit;
2929

3030
// Traverses an AST, reading all the information about use'd crates and extern
3131
// libraries necessary for later resolving, typechecking, linking, etc.
@@ -46,25 +46,17 @@ pub fn read_crates(diag: @mut span_handler,
4646
next_crate_num: 1,
4747
intr: intr
4848
};
49-
let mut v = ReadCrateVisitor{ e:e };
49+
let v =
50+
oldvisit::mk_simple_visitor(@oldvisit::SimpleVisitor {
51+
visit_view_item: |a| visit_view_item(e, a),
52+
visit_item: |a| visit_item(e, a),
53+
.. *oldvisit::default_simple_visitor()});
5054
visit_crate(e, crate);
51-
visit::walk_crate(&mut v, crate, ());
55+
oldvisit::visit_crate(crate, ((), v));
5256
dump_crates(*e.crate_cache);
5357
warn_if_multiple_versions(e, diag, *e.crate_cache);
5458
}
5559

56-
struct ReadCrateVisitor { e:@mut Env }
57-
impl visit::Visitor<()> for ReadCrateVisitor {
58-
fn visit_view_item(&mut self, a:&ast::view_item, _:()) {
59-
visit_view_item(self.e, a);
60-
visit::walk_view_item(self, a, ());
61-
}
62-
fn visit_item(&mut self, a:@ast::item, _:()) {
63-
visit_item(self.e, a);
64-
visit::walk_item(self, a, ());
65-
}
66-
}
67-
6860
#[deriving(Clone)]
6961
struct cache_entry {
7062
cnum: int,

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ use syntax::visit::Visitor;
5656
* lint attributes.
5757
*
5858
* At each node of the ast which can modify lint attributes, all known lint
59-
* passes are also applied. Each lint pass is a visit::Visitor implementator.
59+
* passes are also applied. Each lint pass is an oldvisit::vt<()> structure.
6060
* The visitors are constructed via the lint_*() functions below. There are
6161
* also some lint checks which operate directly on ast nodes (such as
6262
* @ast::item), and those are organized as check_item_*(). Each visitor added
@@ -508,7 +508,7 @@ impl Context {
508508
}
509509
}
510510

511-
fn add_old_lint(&mut self, v: @mut OuterLint) {
511+
fn add_oldvisit_lint(&mut self, v: @mut OuterLint) {
512512
self.visitors.push(OldVisitor(v, v.inner_variant()));
513513
}
514514

@@ -547,7 +547,7 @@ impl Context {
547547
}
548548
}
549549
}
550-
// Can't use visit::walk_method_helper because the
550+
// Can't use oldvisit::visit_method_helper because the
551551
// item_stopping_visitor has overridden visit_fn(&fk_method(... ))
552552
// to be a no-op, so manually invoke visit_fn.
553553
Method(m) => {
@@ -1450,14 +1450,14 @@ pub fn check_crate(tcx: ty::ctxt, crate: @ast::Crate) {
14501450
}
14511451

14521452
// Register each of the lint passes with the context
1453-
cx.add_old_lint(lint_while_true());
1454-
cx.add_old_lint(lint_path_statement());
1455-
cx.add_old_lint(lint_heap());
1456-
cx.add_old_lint(lint_type_limits());
1457-
cx.add_old_lint(lint_unused_unsafe());
1458-
cx.add_old_lint(lint_unused_mut());
1459-
cx.add_old_lint(lint_unnecessary_allocations());
1460-
cx.add_old_lint(lint_missing_doc());
1453+
cx.add_oldvisit_lint(lint_while_true());
1454+
cx.add_oldvisit_lint(lint_path_statement());
1455+
cx.add_oldvisit_lint(lint_heap());
1456+
cx.add_oldvisit_lint(lint_type_limits());
1457+
cx.add_oldvisit_lint(lint_unused_unsafe());
1458+
cx.add_oldvisit_lint(lint_unused_mut());
1459+
cx.add_oldvisit_lint(lint_unnecessary_allocations());
1460+
cx.add_oldvisit_lint(lint_missing_doc());
14611461
cx.add_lint(lint_session(cx));
14621462

14631463
// Actually perform the lint checks (iterating the ast)

0 commit comments

Comments
 (0)