Skip to content

Commit 46ed78e

Browse files
committed
---
yaml --- r: 83391 b: refs/heads/try c: a7d68ad h: refs/heads/master i: 83389: 7d4c12a 83387: 309db57 83383: 9f0fe55 83375: 0355c6b 83359: 7900197 83327: a07e49f v: v3
1 parent 09a06f0 commit 46ed78e

30 files changed

+61
-57
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: 0e4d1fc8cae42e15e00f71d9f439b01bb25a86ae
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 6c08cc2db4f98e9f07ae7d50338396c4123c2f0a
5-
refs/heads/try: 032283276396dc7f738cc38ae228f56618cb3edf
5+
refs/heads/try: a7d68adbdd75300a4a10b2dcc59e1048f613db48
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/librust/rust.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ extern mod rustc;
2828
use std::io;
2929
use std::os;
3030
use std::run;
31-
use std::libc::exit;
3231

3332
enum ValidUsage {
3433
Valid(int), Invalid
@@ -235,7 +234,7 @@ pub fn main() {
235234

236235
if (os_args.len() > 1 && (os_args[1] == ~"-v" || os_args[1] == ~"--version")) {
237236
rustc::version(os_args[0]);
238-
unsafe { exit(0); }
237+
return;
239238
}
240239

241240
let args = os_args.tail();
@@ -245,8 +244,11 @@ pub fn main() {
245244
for command in r.iter() {
246245
let result = do_command(command, args.tail());
247246
match result {
248-
Valid(exit_code) => unsafe { exit(exit_code.to_i32()) },
249-
_ => loop
247+
Valid(exit_code) => {
248+
os::set_exit_status(exit_code);
249+
return;
250+
}
251+
_ => loop
250252
}
251253
}
252254
}

branches/try/src/libstd/rt/io/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ pub trait Writer {
472472

473473
pub trait Stream: Reader + Writer { }
474474

475-
impl<T: Reader + Writer> Stream for T;
475+
impl<T: Reader + Writer> Stream for T {}
476476

477477
pub enum SeekStyle {
478478
/// Seek from the beginning of the stream

branches/try/src/libstd/rt/uv/file.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use libc::{c_int};
2222
use option::{None, Some, Option};
2323

2424
pub struct FsRequest(*uvll::uv_fs_t);
25-
impl Request for FsRequest;
25+
impl Request for FsRequest {}
2626

2727
pub struct RequestData {
2828
complete_cb: Option<FsCallback>

branches/try/src/libsyntax/ast_util.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@ pub fn new_mark(m:Mrk, tail:SyntaxContext) -> SyntaxContext {
740740
}
741741

742742
// Extend a syntax context with a given mark and table
743-
// FIXME #8215 : currently pub to allow testing
743+
// FIXME #4536 : currently pub to allow testing
744744
pub fn new_mark_internal(m:Mrk, tail:SyntaxContext,table:&mut SCTable)
745745
-> SyntaxContext {
746746
let key = (tail,m);
@@ -769,7 +769,7 @@ pub fn new_rename(id:Ident, to:Name, tail:SyntaxContext) -> SyntaxContext {
769769
}
770770
771771
// Extend a syntax context with a given rename and sctable
772-
// FIXME #8215 : currently pub to allow testing
772+
// FIXME #4536 : currently pub to allow testing
773773
pub fn new_rename_internal(id:Ident, to:Name, tail:SyntaxContext, table: &mut SCTable)
774774
-> SyntaxContext {
775775
let key = (tail,id,to);
@@ -792,7 +792,7 @@ pub fn new_rename_internal(id:Ident, to:Name, tail:SyntaxContext, table: &mut SC
792792
793793
/// Make a fresh syntax context table with EmptyCtxt in slot zero
794794
/// and IllegalCtxt in slot one.
795-
// FIXME #8215 : currently pub to allow testing
795+
// FIXME #4536 : currently pub to allow testing
796796
pub fn new_sctable_internal() -> SCTable {
797797
SCTable {
798798
table: ~[EmptyCtxt,IllegalCtxt],
@@ -834,7 +834,7 @@ pub fn mtwt_resolve(id : Ident) -> Name {
834834
resolve_internal(id, get_sctable(), get_resolve_table())
835835
}
836836
837-
// FIXME #8215: must be pub for testing
837+
// FIXME #4536: must be pub for testing
838838
pub type ResolveTable = HashMap<(Name,SyntaxContext),Name>;
839839
840840
// okay, I admit, putting this in TLS is not so nice:
@@ -853,7 +853,7 @@ pub fn get_resolve_table() -> @mut ResolveTable {
853853
854854
// Resolve a syntax object to a name, per MTWT.
855855
// adding memoization to possibly resolve 500+ seconds in resolve for librustc (!)
856-
// FIXME #8215 : currently pub to allow testing
856+
// FIXME #4536 : currently pub to allow testing
857857
pub fn resolve_internal(id : Ident,
858858
table : &mut SCTable,
859859
resolve_table : &mut ResolveTable) -> Name {

branches/try/src/libsyntax/ext/expand.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1640,10 +1640,9 @@ mod test {
16401640
macro_rules! user(($x:ident) => ({letty!($x); $x}))
16411641
fn main() -> int {user!(z)}",
16421642
~[~[0]], false),
1643-
// no longer a fixme #8062: this test exposes a *potential* bug; our system does
1644-
// not behave exactly like MTWT, but a conversation with Matthew Flatt
1645-
// suggests that this can only occur in the presence of local-expand, which
1646-
// we have no plans to support.
1643+
// FIXME #8062: this test exposes a *potential* bug; our system does
1644+
// not behave exactly like MTWT, but I haven't thought of a way that
1645+
// this could cause a bug in Rust, yet.
16471646
// ("fn main() {let hrcoo = 19; macro_rules! getx(()=>(hrcoo)); getx!();}",
16481647
// ~[~[0]], true)
16491648
// FIXME #6994: the next string exposes the bug referred to in issue 6994, so I'm
@@ -1656,7 +1655,6 @@ mod test {
16561655
// fn a(){g!(z)}"
16571656
// create a really evil test case where a $x appears inside a binding of $x
16581657
// but *shouldnt* bind because it was inserted by a different macro....
1659-
// can't write this test case until we have macro-generating macros.
16601658
];
16611659
for (idx,s) in tests.iter().enumerate() {
16621660
run_renaming_test(s,idx);

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -868,6 +868,7 @@ fn consume_whitespace(rdr: @mut StringReader) {
868868
mod test {
869869
use super::*;
870870

871+
use ast;
871872
use codemap::{BytePos, CodeMap, Span};
872873
use diagnostic;
873874
use parse::token;

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,10 +324,17 @@ mod test {
324324
use abi;
325325
use parse::parser::Parser;
326326
use parse::token::{str_to_ident};
327-
use util::parser_testing::{string_to_tts, string_to_parser};
327+
use util::parser_testing::{string_to_tts_and_sess, string_to_parser};
328328
use util::parser_testing::{string_to_expr, string_to_item};
329329
use util::parser_testing::string_to_stmt;
330330

331+
// map a string to tts, return the tt without its parsesess
332+
fn string_to_tts_only(source_str : @str) -> ~[ast::token_tree] {
333+
let (tts,_ps) = string_to_tts_and_sess(source_str);
334+
tts
335+
}
336+
337+
331338
#[cfg(test)] fn to_json_str<E : Encodable<extra::json::Encoder>>(val: @E) -> ~str {
332339
do io::with_str_writer |writer| {
333340
let mut encoder = extra::json::Encoder(writer);
@@ -389,7 +396,7 @@ mod test {
389396
}
390397

391398
#[test] fn string_to_tts_1 () {
392-
let tts = string_to_tts(@"fn a (b : int) { b; }");
399+
let (tts,_ps) = string_to_tts_and_sess(@"fn a (b : int) { b; }");
393400
assert_eq!(to_json_str(@tts),
394401
~"[\
395402
{\

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ pub enum ObsoleteSyntax {
6565
ObsoletePrivVisibility,
6666
ObsoleteTraitFuncVisibility,
6767
ObsoleteConstPointer,
68+
ObsoleteEmptyImpl,
6869
}
6970

7071
impl to_bytes::IterBytes for ObsoleteSyntax {
@@ -256,6 +257,10 @@ impl ParserObsoleteMethods for Parser {
256257
"instead of `&const Foo` or `@const Foo`, write `&Foo` or \
257258
`@Foo`"
258259
),
260+
ObsoleteEmptyImpl => (
261+
"empty implementation",
262+
"instead of `impl A;`, write `impl A {}`"
263+
),
259264
};
260265

261266
self.report(sp, kind, kind_str, desc);

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2035,11 +2035,6 @@ impl Parser {
20352035

20362036
// parse a single token tree from the input.
20372037
pub fn parse_token_tree(&self) -> token_tree {
2038-
// FIXME #6994: currently, this is too eager. It
2039-
// parses token trees but also identifies tt_seq's
2040-
// and tt_nonterminals; it's too early to know yet
2041-
// whether something will be a nonterminal or a seq
2042-
// yet.
20432038
maybe_whole!(deref self, nt_tt);
20442039

20452040
// this is the fall-through for the 'match' below.
@@ -3857,7 +3852,9 @@ impl Parser {
38573852
}
38583853

38593854
let mut meths = ~[];
3860-
if !self.eat(&token::SEMI) {
3855+
if self.eat(&token::SEMI) {
3856+
self.obsolete(*self.span, ObsoleteEmptyImpl);
3857+
} else {
38613858
self.expect(&token::LBRACE);
38623859
while !self.eat(&token::RBRACE) {
38633860
meths.push(self.parse_method());

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

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -598,18 +598,12 @@ pub fn print_item(s: @ps, item: &ast::item) {
598598

599599
print_type(s, ty);
600600

601-
if methods.len() == 0 {
602-
word(s.s, ";");
603-
end(s); // end the head-ibox
604-
end(s); // end the outer cbox
605-
} else {
606-
space(s.s);
607-
bopen(s);
608-
for meth in methods.iter() {
609-
print_method(s, *meth);
610-
}
611-
bclose(s, item.span);
601+
space(s.s);
602+
bopen(s);
603+
for meth in methods.iter() {
604+
print_method(s, *meth);
612605
}
606+
bclose(s, item.span);
613607
}
614608
ast::item_trait(ref generics, ref traits, ref methods) => {
615609
head(s, visibility_qualified(item.vis, "trait"));

branches/try/src/test/auxiliary/trait_inheritance_overloading_xc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ impl Eq for MyInt {
3535
fn ne(&self, other: &MyInt) -> bool { !self.eq(other) }
3636
}
3737

38-
impl MyNum for MyInt;
38+
impl MyNum for MyInt {}
3939

4040
fn mi(v: int) -> MyInt { MyInt { val: v } }

branches/try/src/test/compile-fail/missing-derivable-attr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ impl MyEq for int {
2020
fn eq(&self, other: &int) -> bool { *self == *other }
2121
}
2222

23-
impl MyEq for A; //~ ERROR missing method
23+
impl MyEq for A {} //~ ERROR missing method
2424

2525
fn main() {
2626
}

branches/try/src/test/debug-info/generic-trait-generic-static-default-method.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ trait Trait<T1> {
4040
}
4141
}
4242

43-
impl<T> Trait<T> for Struct;
43+
impl<T> Trait<T> for Struct {}
4444

4545
fn main() {
4646

branches/try/src/test/debug-info/self-in-default-method.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ trait Trait {
118118
}
119119
}
120120

121-
impl Trait for Struct;
121+
impl Trait for Struct {}
122122

123123
fn main() {
124124
let stack = Struct { x: 100 };

branches/try/src/test/debug-info/self-in-generic-default-method.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ trait Trait {
119119
}
120120
}
121121

122-
impl Trait for Struct;
122+
impl Trait for Struct {}
123123

124124
fn main() {
125125
let stack = Struct { x: 987 };

branches/try/src/test/debug-info/trait-generic-static-default-method.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ trait Trait {
4040
}
4141
}
4242

43-
impl Trait for Struct;
43+
impl Trait for Struct {}
4444

4545
fn main() {
4646

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
trait X { }
2-
impl X for uint;
2+
impl X for uint { }
33

44
trait Y { }
5-
impl Y for uint;
5+
impl Y for uint { }
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
trait X { }
2-
impl X for uint;
2+
impl X for uint { }
33

44
trait Y { }
5-
impl Y for uint;
5+
impl Y for uint { }

branches/try/src/test/pretty/path-type-bounds.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// pp-exact
22

33
trait Tr { }
4-
impl Tr for int;
4+
impl Tr for int { }
55

66
fn foo(x: ~Tr: Freeze) -> ~Tr: Freeze { x }
77

branches/try/src/test/run-pass/default-method-supertrait-vtable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ impl Y for int {
2929
fn y(self) -> int { self }
3030
}
3131

32-
impl Z for int;
32+
impl Z for int {}
3333

3434
fn main() {
3535
assert_eq!(12.x(), 12);

branches/try/src/test/run-pass/issue-3979-generics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ impl Positioned<int> for Point {
3131
}
3232
}
3333

34-
impl Movable<int> for Point;
34+
impl Movable<int> for Point {}
3535

3636
pub fn main() {
3737
let mut p = Point{ x: 1, y: 2};

branches/try/src/test/run-pass/issue-3979-xcrate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ impl Positioned for Point {
2424
}
2525
}
2626

27-
impl Movable for Point;
27+
impl Movable for Point {}
2828

2929
pub fn main() {
3030
let mut p = Point{ x: 1, y: 2};

branches/try/src/test/run-pass/issue-3979.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ impl Positioned for Point {
3232
}
3333
}
3434

35-
impl Movable for Point;
35+
impl Movable for Point {}
3636

3737
pub fn main() {
3838
let mut p = Point{ x: 1, y: 2};

branches/try/src/test/run-pass/supertrait-default-generics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ impl<S: Clone> Positioned<S> for Point<S> {
3333
}
3434
}
3535

36-
impl<S: Clone + Add<S, S>> Movable<S> for Point<S>;
36+
impl<S: Clone + Add<S, S>> Movable<S> for Point<S> {}
3737

3838
pub fn main() {
3939
let mut p = Point{ x: 1, y: 2};

branches/try/src/test/run-pass/trait-inheritance-overloading-simple.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ impl Eq for MyInt {
1919
fn ne(&self, other: &MyInt) -> bool { !self.eq(other) }
2020
}
2121

22-
impl MyNum for MyInt;
22+
impl MyNum for MyInt {}
2323

2424
fn f<T:MyNum>(x: T, y: T) -> bool {
2525
return x == y;

branches/try/src/test/run-pass/trait-inheritance-overloading.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ impl Eq for MyInt {
3131
fn ne(&self, other: &MyInt) -> bool { !self.eq(other) }
3232
}
3333

34-
impl MyNum for MyInt;
34+
impl MyNum for MyInt {}
3535

3636
fn f<T:MyNum>(x: T, y: T) -> (T, T, T) {
3737
return (x + y, x - y, x * y);

branches/try/src/test/run-pass/trait-inheritance-subst.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ impl Add<MyInt, MyInt> for MyInt {
2020
fn add(&self, other: &MyInt) -> MyInt { mi(self.val + other.val) }
2121
}
2222

23-
impl MyNum for MyInt;
23+
impl MyNum for MyInt {}
2424

2525
fn f<T:MyNum>(x: T, y: T) -> T {
2626
return x.add(&y);

branches/try/src/test/run-pass/trait-inheritance-subst2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ impl Add<MyInt, MyInt> for MyInt {
3030
fn add(&self, other: &MyInt) -> MyInt { self.chomp(other) }
3131
}
3232

33-
impl MyNum for MyInt;
33+
impl MyNum for MyInt {}
3434

3535
fn f<T:MyNum>(x: T, y: T) -> T {
3636
return x.add(&y).chomp(&y);

branches/try/src/test/run-pass/trait-inheritance2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ struct A { x: int }
1919
impl Foo for A { fn f(&self) -> int { 10 } }
2020
impl Bar for A { fn g(&self) -> int { 20 } }
2121
impl Baz for A { fn h(&self) -> int { 30 } }
22-
impl Quux for A;
22+
impl Quux for A {}
2323

2424
fn f<T:Quux + Foo + Bar + Baz>(a: &T) {
2525
assert_eq!(a.f(), 10);

0 commit comments

Comments
 (0)