Skip to content

Commit eba6917

Browse files
committed
---
yaml --- r: 81830 b: refs/heads/master c: 5867bbd h: refs/heads/master v: v3
1 parent 67999d4 commit eba6917

26 files changed

+55
-55
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: a7d68adbdd75300a4a10b2dcc59e1048f613db48
2+
refs/heads/master: 5867bbd794785c4ea51becbc5d008549b03dcf16
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 6c08cc2db4f98e9f07ae7d50338396c4123c2f0a
55
refs/heads/try: 70152ff55722878cde684ee6462c14c65f2c4729

trunk/src/librustc/middle/trans/base.rs

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2321,6 +2321,23 @@ pub fn trans_mod(ccx: @mut CrateContext, m: &ast::_mod) {
23212321
}
23222322
}
23232323

2324+
fn finish_register_fn(ccx: @mut CrateContext, sp: Span, sym: ~str, node_id: ast::NodeId,
2325+
llfn: ValueRef) {
2326+
ccx.item_symbols.insert(node_id, sym);
2327+
2328+
if !*ccx.sess.building_library {
2329+
lib::llvm::SetLinkage(llfn, lib::llvm::InternalLinkage);
2330+
}
2331+
2332+
// FIXME #4404 android JNI hacks
2333+
let is_entry = is_entry_fn(&ccx.sess, node_id) && (!*ccx.sess.building_library ||
2334+
(*ccx.sess.building_library &&
2335+
ccx.sess.targ_cfg.os == session::OsAndroid));
2336+
if is_entry {
2337+
create_entry_wrapper(ccx, sp, llfn);
2338+
}
2339+
}
2340+
23242341
pub fn register_fn(ccx: @mut CrateContext,
23252342
sp: Span,
23262343
sym: ~str,
@@ -2336,15 +2353,7 @@ pub fn register_fn(ccx: @mut CrateContext,
23362353
};
23372354

23382355
let llfn = decl_rust_fn(ccx, f.sig.inputs, f.sig.output, sym);
2339-
ccx.item_symbols.insert(node_id, sym);
2340-
2341-
// FIXME #4404 android JNI hacks
2342-
let is_entry = is_entry_fn(&ccx.sess, node_id) && (!*ccx.sess.building_library ||
2343-
(*ccx.sess.building_library &&
2344-
ccx.sess.targ_cfg.os == session::OsAndroid));
2345-
if is_entry {
2346-
create_entry_wrapper(ccx, sp, llfn);
2347-
}
2356+
finish_register_fn(ccx, sp, sym, node_id, llfn);
23482357
llfn
23492358
}
23502359

@@ -2361,15 +2370,7 @@ pub fn register_fn_llvmty(ccx: @mut CrateContext,
23612370
ast_map::path_to_str(item_path(ccx, &node_id), token::get_ident_interner()));
23622371

23632372
let llfn = decl_fn(ccx.llmod, sym, cc, fn_ty);
2364-
ccx.item_symbols.insert(node_id, sym);
2365-
2366-
// FIXME #4404 android JNI hacks
2367-
let is_entry = is_entry_fn(&ccx.sess, node_id) && (!*ccx.sess.building_library ||
2368-
(*ccx.sess.building_library &&
2369-
ccx.sess.targ_cfg.os == session::OsAndroid));
2370-
if is_entry {
2371-
create_entry_wrapper(ccx, sp, llfn);
2372-
}
2373+
finish_register_fn(ccx, sp, sym, node_id, llfn);
23732374
llfn
23742375
}
23752376

trunk/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

trunk/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>

trunk/src/libsyntax/parse/obsolete.rs

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

7170
impl to_bytes::IterBytes for ObsoleteSyntax {
@@ -257,10 +256,6 @@ impl ParserObsoleteMethods for Parser {
257256
"instead of `&const Foo` or `@const Foo`, write `&Foo` or \
258257
`@Foo`"
259258
),
260-
ObsoleteEmptyImpl => (
261-
"empty implementation",
262-
"instead of `impl A;`, write `impl A {}`"
263-
),
264259
};
265260

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

trunk/src/libsyntax/parse/parser.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3852,9 +3852,7 @@ impl Parser {
38523852
}
38533853

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

trunk/src/libsyntax/print/pprust.rs

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

599599
print_type(s, ty);
600600

601-
space(s.s);
602-
bopen(s);
603-
for meth in methods.iter() {
604-
print_method(s, *meth);
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);
605612
}
606-
bclose(s, item.span);
607613
}
608614
ast::item_trait(ref generics, ref traits, ref methods) => {
609615
head(s, visibility_qualified(item.vis, "trait"));

trunk/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 } }

trunk/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
}

trunk/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

trunk/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 };

trunk/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 };

trunk/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

trunk/src/test/pretty/empty-impl.pp

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;

trunk/src/test/pretty/empty-impl.rs

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;

trunk/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

trunk/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);

trunk/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};

trunk/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};

trunk/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};

trunk/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};

trunk/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;

trunk/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);

trunk/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);

trunk/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);

trunk/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)