Skip to content

Commit e4263a7

Browse files
committed
---
yaml --- r: 143244 b: refs/heads/try2 c: f73bb2b h: refs/heads/master v: v3
1 parent be6d626 commit e4263a7

Some content is hidden

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

79 files changed

+1189
-1260
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 906264b50fa6b69eed567388063233bd279242b1
8+
refs/heads/try2: f73bb2bfe637b7e0edd8086fe8ba45032d8e3320
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/mk/tests.mk

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -537,10 +537,6 @@ TEST_SREQ$(1)_T_$(2)_H_$(3) = \
537537

538538
# Rules for the cfail/rfail/rpass/bench/perf test runner
539539

540-
# The tests select when to use debug configuration on their own;
541-
# remove directive, if present, from CFG_RUSTC_FLAGS (issue #7898).
542-
CTEST_RUSTC_FLAGS = $$(subst --cfg debug,,$$(CFG_RUSTC_FLAGS))
543-
544540
CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
545541
--compile-lib-path $$(HLIB$(1)_H_$(3)) \
546542
--run-lib-path $$(TLIB$(1)_T_$(2)_H_$(3)) \
@@ -552,7 +548,7 @@ CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
552548
--target $(2) \
553549
--adb-path=$(CFG_ADB) \
554550
--adb-test-dir=$(CFG_ADB_TEST_DIR) \
555-
--rustcflags "$(RUSTC_FLAGS_$(2)) $$(CTEST_RUSTC_FLAGS) --target=$(2)" \
551+
--rustcflags "$(RUSTC_FLAGS_$(2)) $$(CFG_RUSTC_FLAGS) --target=$(2)" \
556552
$$(CTEST_TESTARGS)
557553

558554
CTEST_DEPS_rpass_$(1)-T-$(2)-H-$(3) = $$(RPASS_TESTS)

branches/try2/src/etc/tidy.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ def do_license_check(name, contents):
4949
report_err("FIXME without issue number")
5050
if line.find("TODO") != -1:
5151
report_err("TODO is deprecated; use FIXME")
52-
match = re.match(r'^.*//\s*(NOTE.*)$', line)
53-
if match:
54-
report_warn(match.group(1))
52+
idx = line.find("// NOTE")
53+
if idx != -1:
54+
report_warn("NOTE" + line[idx + len("// NOTE"):])
5555
if (line.find('\t') != -1 and
5656
fileinput.filename().find("Makefile") == -1):
5757
report_err("tab character")

branches/try2/src/libextra/future.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ mod test {
194194
195195
#[test]
196196
fn test_interface_unwrap() {
197-
let f = from_value(~"fail");
197+
let mut f = from_value(~"fail");
198198
assert_eq!(f.unwrap(), ~"fail");
199199
}
200200

branches/try2/src/libextra/getopts.rs

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ pub fn opt_default(mm: &Matches, nm: &str, def: &str) -> Option<~str> {
457457
let vals = opt_vals(mm, nm);
458458
if vals.is_empty() { return None::<~str>; }
459459
return match vals[0] { Val(ref s) => Some::<~str>((*s).clone()),
460-
_ => Some::<~str>(def.to_owned()) }
460+
_ => Some::<~str>(str::to_owned(def)) }
461461
}
462462

463463
#[deriving(Eq)]
@@ -497,10 +497,10 @@ pub mod groups {
497497
desc: &str, hint: &str) -> OptGroup {
498498
let len = short_name.len();
499499
assert!(len == 1 || len == 0);
500-
return OptGroup { short_name: short_name.to_owned(),
501-
long_name: long_name.to_owned(),
502-
hint: hint.to_owned(),
503-
desc: desc.to_owned(),
500+
return OptGroup { short_name: str::to_owned(short_name),
501+
long_name: str::to_owned(long_name),
502+
hint: str::to_owned(hint),
503+
desc: str::to_owned(desc),
504504
hasarg: Yes,
505505
occur: Req};
506506
}
@@ -510,10 +510,10 @@ pub mod groups {
510510
desc: &str, hint: &str) -> OptGroup {
511511
let len = short_name.len();
512512
assert!(len == 1 || len == 0);
513-
return OptGroup {short_name: short_name.to_owned(),
514-
long_name: long_name.to_owned(),
515-
hint: hint.to_owned(),
516-
desc: desc.to_owned(),
513+
return OptGroup {short_name: str::to_owned(short_name),
514+
long_name: str::to_owned(long_name),
515+
hint: str::to_owned(hint),
516+
desc: str::to_owned(desc),
517517
hasarg: Yes,
518518
occur: Optional};
519519
}
@@ -523,10 +523,10 @@ pub mod groups {
523523
desc: &str) -> OptGroup {
524524
let len = short_name.len();
525525
assert!(len == 1 || len == 0);
526-
return OptGroup {short_name: short_name.to_owned(),
527-
long_name: long_name.to_owned(),
526+
return OptGroup {short_name: str::to_owned(short_name),
527+
long_name: str::to_owned(long_name),
528528
hint: ~"",
529-
desc: desc.to_owned(),
529+
desc: str::to_owned(desc),
530530
hasarg: No,
531531
occur: Optional};
532532
}
@@ -536,10 +536,10 @@ pub mod groups {
536536
desc: &str, hint: &str) -> OptGroup {
537537
let len = short_name.len();
538538
assert!(len == 1 || len == 0);
539-
return OptGroup {short_name: short_name.to_owned(),
540-
long_name: long_name.to_owned(),
541-
hint: hint.to_owned(),
542-
desc: desc.to_owned(),
539+
return OptGroup {short_name: str::to_owned(short_name),
540+
long_name: str::to_owned(long_name),
541+
hint: str::to_owned(hint),
542+
desc: str::to_owned(desc),
543543
hasarg: Maybe,
544544
occur: Optional};
545545
}
@@ -552,10 +552,10 @@ pub mod groups {
552552
desc: &str, hint: &str) -> OptGroup {
553553
let len = short_name.len();
554554
assert!(len == 1 || len == 0);
555-
return OptGroup {short_name: short_name.to_owned(),
556-
long_name: long_name.to_owned(),
557-
hint: hint.to_owned(),
558-
desc: desc.to_owned(),
555+
return OptGroup {short_name: str::to_owned(short_name),
556+
long_name: str::to_owned(long_name),
557+
hint: str::to_owned(hint),
558+
desc: str::to_owned(desc),
559559
hasarg: Yes,
560560
occur: Multi};
561561
}
@@ -678,7 +678,7 @@ pub mod groups {
678678
row
679679
});
680680

681-
return brief.to_owned() +
681+
return str::to_owned(brief) +
682682
"\n\nOptions:\n" +
683683
rows.collect::<~[~str]>().connect("\n") +
684684
"\n\n";

branches/try2/src/libextra/num/bigint.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -732,11 +732,6 @@ impl Ord for Sign {
732732
}
733733
}
734734

735-
impl TotalEq for Sign {
736-
fn equals(&self, other: &Sign) -> bool {
737-
*self == *other
738-
}
739-
}
740735
impl TotalOrd for Sign {
741736

742737
fn cmp(&self, other: &Sign) -> Ordering {

branches/try2/src/libextra/num/rational.rs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -110,25 +110,6 @@ cmp_impl!(impl TotalEq, equals)
110110
cmp_impl!(impl Ord, lt, gt, le, ge)
111111
cmp_impl!(impl TotalOrd, cmp -> cmp::Ordering)
112112

113-
impl<T: Clone + Integer + Ord> Orderable for Ratio<T> {
114-
#[inline]
115-
fn min(&self, other: &Ratio<T>) -> Ratio<T> {
116-
if *self < *other { self.clone() } else { other.clone() }
117-
}
118-
119-
#[inline]
120-
fn max(&self, other: &Ratio<T>) -> Ratio<T> {
121-
if *self > *other { self.clone() } else { other.clone() }
122-
}
123-
124-
#[inline]
125-
fn clamp(&self, mn: &Ratio<T>, mx: &Ratio<T>) -> Ratio<T> {
126-
if *self > *mx { mx.clone()} else
127-
if *self < *mn { mn.clone() } else { self.clone() }
128-
}
129-
}
130-
131-
132113
/* Arithmetic */
133114
// a/b * c/d = (a*c)/(b*d)
134115
impl<T: Clone + Integer + Ord>

branches/try2/src/libextra/rl.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pub mod rustrt {
3232

3333
/// Add a line to history
3434
pub unsafe fn add_history(line: &str) -> bool {
35-
do line.as_c_str |buf| {
35+
do str::as_c_str(line) |buf| {
3636
rustrt::linenoiseHistoryAdd(buf) == 1 as c_int
3737
}
3838
}
@@ -44,21 +44,21 @@ pub unsafe fn set_history_max_len(len: int) -> bool {
4444

4545
/// Save line history to a file
4646
pub unsafe fn save_history(file: &str) -> bool {
47-
do file.as_c_str |buf| {
47+
do str::as_c_str(file) |buf| {
4848
rustrt::linenoiseHistorySave(buf) == 1 as c_int
4949
}
5050
}
5151

5252
/// Load line history from a file
5353
pub unsafe fn load_history(file: &str) -> bool {
54-
do file.as_c_str |buf| {
54+
do str::as_c_str(file) |buf| {
5555
rustrt::linenoiseHistoryLoad(buf) == 1 as c_int
5656
}
5757
}
5858

5959
/// Print out a prompt and then wait for input and return it
6060
pub unsafe fn read(prompt: &str) -> Option<~str> {
61-
do prompt.as_c_str |buf| {
61+
do str::as_c_str(prompt) |buf| {
6262
let line = rustrt::linenoise(buf);
6363

6464
if line.is_null() { None }
@@ -80,7 +80,7 @@ pub unsafe fn complete(cb: CompletionCb) {
8080

8181
unsafe {
8282
do cb(str::raw::from_c_str(line)) |suggestion| {
83-
do suggestion.as_c_str |buf| {
83+
do str::as_c_str(suggestion) |buf| {
8484
rustrt::linenoiseAddCompletion(completions, buf);
8585
}
8686
}

branches/try2/src/libextra/terminfo/parm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ priv fn format(val: Param, op: FormatOp, flags: Flags) -> Result<~[u8],~str> {
545545
String(s) => {
546546
match op {
547547
FormatString => {
548-
let mut s = s.to_bytes_with_null();
548+
let mut s = s.as_bytes_with_null_consume();
549549
s.pop(); // remove the null
550550
if flags.precision > 0 && flags.precision < s.len() {
551551
s.truncate(flags.precision);

branches/try2/src/libextra/time.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1027,7 +1027,7 @@ mod tests {
10271027
10281028
fn test(s: &str, format: &str) -> bool {
10291029
match strptime(s, format) {
1030-
Ok(ref tm) => tm.strftime(format) == s.to_owned(),
1030+
Ok(ref tm) => tm.strftime(format) == str::to_owned(s),
10311031
Err(e) => fail!(e)
10321032
}
10331033
}

branches/try2/src/librustc/back/link.rs

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ pub fn WriteOutputFile(sess: Session,
7676
OptLevel: c_int,
7777
EnableSegmentedStacks: bool) {
7878
unsafe {
79-
do Triple.as_c_str |Triple| {
80-
do Feature.as_c_str |Feature| {
81-
do Output.as_c_str |Output| {
79+
do str::as_c_str(Triple) |Triple| {
80+
do str::as_c_str(Feature) |Feature| {
81+
do str::as_c_str(Output) |Output| {
8282
let result = llvm::LLVMRustWriteOutputFile(
8383
PM,
8484
M,
@@ -263,16 +263,16 @@ pub mod write {
263263
output_type_bitcode => {
264264
if opts.optimize != session::No {
265265
let filename = output.with_filetype("no-opt.bc");
266-
do filename.to_str().as_c_str |buf| {
267-
llvm::LLVMWriteBitcodeToFile(llmod, buf);
268-
}
266+
str::as_c_str(filename.to_str(), |buf| {
267+
llvm::LLVMWriteBitcodeToFile(llmod, buf)
268+
});
269269
}
270270
}
271271
_ => {
272272
let filename = output.with_filetype("bc");
273-
do filename.to_str().as_c_str |buf| {
274-
llvm::LLVMWriteBitcodeToFile(llmod, buf);
275-
}
273+
str::as_c_str(filename.to_str(), |buf| {
274+
llvm::LLVMWriteBitcodeToFile(llmod, buf)
275+
});
276276
}
277277
}
278278
}
@@ -333,9 +333,9 @@ pub mod write {
333333
// Always output the bitcode file with --save-temps
334334

335335
let filename = output.with_filetype("opt.bc");
336-
do filename.to_str().as_c_str |buf| {
336+
str::as_c_str(filename.to_str(), |buf| {
337337
llvm::LLVMWriteBitcodeToFile(llmod, buf)
338-
};
338+
});
339339
// Save the assembly file if -S is used
340340
if output_type == output_type_assembly {
341341
WriteOutputFile(
@@ -391,15 +391,13 @@ pub mod write {
391391

392392
if output_type == output_type_llvm_assembly {
393393
// Given options "-S --emit-llvm": output LLVM assembly
394-
do output.to_str().as_c_str |buf_o| {
395-
llvm::LLVMRustAddPrintModulePass(pm.llpm, llmod, buf_o);
396-
}
394+
str::as_c_str(output.to_str(), |buf_o| {
395+
llvm::LLVMRustAddPrintModulePass(pm.llpm, llmod, buf_o)});
397396
} else {
398397
// If only a bitcode file is asked for by using the
399398
// '--emit-llvm' flag, then output it here
400-
do output.to_str().as_c_str |buf| {
401-
llvm::LLVMWriteBitcodeToFile(llmod, buf);
402-
}
399+
str::as_c_str(output.to_str(),
400+
|buf| llvm::LLVMWriteBitcodeToFile(llmod, buf) );
403401
}
404402

405403
llvm::LLVMDisposeModule(llmod);

branches/try2/src/librustc/back/passes.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
use std::str;
1112
use std::io;
1213

1314
use driver::session::{OptLevel, No, Less, Aggressive};
@@ -173,7 +174,7 @@ pub fn populate_pass_manager(sess: Session, pm: &mut PassManager, pass_list:&[~s
173174
}
174175

175176
pub fn create_pass(name:&str) -> Option<PassRef> {
176-
do name.as_c_str |s| {
177+
do str::as_c_str(name) |s| {
177178
unsafe {
178179
let p = llvm::LLVMCreatePass(s);
179180
if p.is_null() {

branches/try2/src/librustc/lib/llvm.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use std::hashmap::HashMap;
1313
use std::libc::{c_uint, c_ushort};
1414
use std::option;
15+
use std::str;
1516

1617
use middle::trans::type_::Type;
1718

@@ -2286,9 +2287,10 @@ pub struct TargetData {
22862287
}
22872288

22882289
pub fn mk_target_data(string_rep: &str) -> TargetData {
2289-
let lltd = do string_rep.as_c_str |buf| {
2290-
unsafe { llvm::LLVMCreateTargetData(buf) }
2291-
};
2290+
let lltd =
2291+
str::as_c_str(string_rep, |buf| unsafe {
2292+
llvm::LLVMCreateTargetData(buf)
2293+
});
22922294

22932295
TargetData {
22942296
lltd: lltd,

branches/try2/src/librustc/metadata/common.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ pub static tag_misc_info: uint = 0x7f;
180180
pub static tag_misc_info_crate_items: uint = 0x80;
181181

182182
pub static tag_item_method_provided_source: uint = 0x81;
183-
pub static tag_item_impl_vtables: uint = 0x82;
184183

185184
pub struct LinkMeta {
186185
name: @str,

branches/try2/src/librustc/metadata/csearch.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ use metadata::cstore;
1616
use metadata::decoder;
1717
use metadata;
1818
use middle::ty;
19-
use middle::typeck;
2019

2120
use std::vec;
2221
use reader = extra::ebml::reader;
@@ -217,14 +216,6 @@ pub fn get_impl_trait(tcx: ty::ctxt,
217216
decoder::get_impl_trait(cdata, def.node, tcx)
218217
}
219218

220-
// Given a def_id for an impl, return information about its vtables
221-
pub fn get_impl_vtables(tcx: ty::ctxt,
222-
def: ast::def_id) -> typeck::impl_res {
223-
let cstore = tcx.cstore;
224-
let cdata = cstore::get_crate_data(cstore, def.crate);
225-
decoder::get_impl_vtables(cdata, def.node, tcx)
226-
}
227-
228219
pub fn get_impl_method(cstore: @mut cstore::CStore,
229220
def: ast::def_id,
230221
mname: ast::ident)

0 commit comments

Comments
 (0)