Skip to content

Commit f4e29e7

Browse files
committed
Fixup various places that were doing &T+'a and do &(T+'a)
1 parent 74a1041 commit f4e29e7

37 files changed

+56
-56
lines changed

src/libcore/fmt/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ pub struct Formatter<'a> {
8585
width: Option<uint>,
8686
precision: Option<uint>,
8787

88-
buf: &'a mut FormatWriter+'a,
88+
buf: &'a mut (FormatWriter+'a),
8989
curarg: slice::Items<'a, Argument<'a>>,
9090
args: &'a [Argument<'a>],
9191
}
@@ -565,7 +565,7 @@ impl<'a, Sized? T: Show> Show for &'a T {
565565
impl<'a, Sized? T: Show> Show for &'a mut T {
566566
fn fmt(&self, f: &mut Formatter) -> Result { (**self).fmt(f) }
567567
}
568-
impl<'a> Show for &'a Show+'a {
568+
impl<'a> Show for &'a (Show+'a) {
569569
fn fmt(&self, f: &mut Formatter) -> Result { (*self).fmt(f) }
570570
}
571571

@@ -724,7 +724,7 @@ macro_rules! tuple (
724724

725725
tuple! { T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, }
726726

727-
impl<'a> Show for &'a any::Any+'a {
727+
impl<'a> Show for &'a (any::Any+'a) {
728728
fn fmt(&self, f: &mut Formatter) -> Result { f.pad("&Any") }
729729
}
730730

src/librustc/middle/expr_use_visitor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ impl OverloadedCallType {
295295
pub struct ExprUseVisitor<'d,'t,'tcx,TYPER:'t> {
296296
typer: &'t TYPER,
297297
mc: mc::MemCategorizationContext<'t,TYPER>,
298-
delegate: &'d mut Delegate<'tcx>+'d,
298+
delegate: &'d mut (Delegate<'tcx>+'d),
299299
}
300300

301301
// If the TYPER results in an error, it's because the type check

src/librustc/middle/traits/select.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ use util::ppaux::Repr;
4343
pub struct SelectionContext<'cx, 'tcx:'cx> {
4444
infcx: &'cx InferCtxt<'cx, 'tcx>,
4545
param_env: &'cx ty::ParameterEnvironment<'tcx>,
46-
typer: &'cx Typer<'tcx>+'cx,
46+
typer: &'cx (Typer<'tcx>+'cx),
4747

4848
/// Skolemizer used specifically for skolemizing entries on the
4949
/// obligation stack. This ensures that all entries on the stack

src/librustc/middle/typeck/rscope.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,11 @@ impl RegionScope for BindingRscope {
139139
/// A scope which simply shifts the Debruijn index of other scopes
140140
/// to account for binding levels.
141141
pub struct ShiftedRscope<'r> {
142-
base_scope: &'r RegionScope+'r
142+
base_scope: &'r (RegionScope+'r)
143143
}
144144

145145
impl<'r> ShiftedRscope<'r> {
146-
pub fn new(base_scope: &'r RegionScope+'r) -> ShiftedRscope<'r> {
146+
pub fn new(base_scope: &'r (RegionScope+'r)) -> ShiftedRscope<'r> {
147147
ShiftedRscope { base_scope: base_scope }
148148
}
149149
}

src/librustrt/unwind.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ struct Exception {
8686
cause: Option<Box<Any + Send>>,
8787
}
8888

89-
pub type Callback = fn(msg: &Any + Send, file: &'static str, line: uint);
89+
pub type Callback = fn(msg: &(Any + Send), file: &'static str, line: uint);
9090

9191
// Variables used for invoking callbacks when a task starts to unwind.
9292
//

src/libserialize/json.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ fn fmt_number_or_null(v: f64) -> string::String {
398398

399399
/// A structure for implementing serialization to JSON.
400400
pub struct Encoder<'a> {
401-
writer: &'a mut io::Writer+'a,
401+
writer: &'a mut (io::Writer+'a),
402402
}
403403

404404
impl<'a> Encoder<'a> {
@@ -602,7 +602,7 @@ impl<'a> ::Encoder<io::IoError> for Encoder<'a> {
602602
/// Another encoder for JSON, but prints out human-readable JSON instead of
603603
/// compact data
604604
pub struct PrettyEncoder<'a> {
605-
writer: &'a mut io::Writer+'a,
605+
writer: &'a mut (io::Writer+'a),
606606
curr_indent: uint,
607607
indent: uint,
608608
}

src/libstd/comm/select.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ pub struct Handle<'rx, T:'rx> {
8484
next: *mut Handle<'static, ()>,
8585
prev: *mut Handle<'static, ()>,
8686
added: bool,
87-
packet: &'rx Packet+'rx,
87+
packet: &'rx (Packet+'rx),
8888

8989
// due to our fun transmutes, we be sure to place this at the end. (nothing
9090
// previous relies on T)

src/libstd/failure.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ impl Writer for Stdio {
4040
}
4141
}
4242

43-
pub fn on_fail(obj: &Any + Send, file: &'static str, line: uint) {
43+
pub fn on_fail(obj: &(Any+Send), file: &'static str, line: uint) {
4444
let msg = match obj.downcast_ref::<&'static str>() {
4545
Some(s) => *s,
4646
None => match obj.downcast_ref::<String>() {

src/libstd/io/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,7 @@ impl<'a> Reader for Box<Reader+'a> {
911911
}
912912
}
913913

914-
impl<'a> Reader for &'a mut Reader+'a {
914+
impl<'a> Reader for &'a mut (Reader+'a) {
915915
fn read(&mut self, buf: &mut [u8]) -> IoResult<uint> { (*self).read(buf) }
916916
}
917917

@@ -1279,7 +1279,7 @@ impl<'a> Writer for Box<Writer+'a> {
12791279
}
12801280
}
12811281

1282-
impl<'a> Writer for &'a mut Writer+'a {
1282+
impl<'a> Writer for &'a mut (Writer+'a) {
12831283
#[inline]
12841284
fn write(&mut self, buf: &[u8]) -> IoResult<()> { (**self).write(buf) }
12851285

src/libstd/rt/backtrace.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ mod imp {
288288

289289
struct Context<'a> {
290290
idx: int,
291-
writer: &'a mut Writer+'a,
291+
writer: &'a mut (Writer+'a),
292292
last_error: Option<IoError>,
293293
}
294294

src/libsyntax/print/pprust.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ pub struct State<'a> {
6161
literals: Option<Vec<comments::Literal> >,
6262
cur_cmnt_and_lit: CurrentCommentAndLiteral,
6363
boxes: Vec<pp::Breaks>,
64-
ann: &'a PpAnn+'a,
64+
ann: &'a (PpAnn+'a),
6565
encode_idents_with_hygiene: bool,
6666
}
6767

src/test/compile-fail/dst-index.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ impl Index<uint, str> for S {
2525
struct T;
2626

2727
impl Index<uint, Show + 'static> for T {
28-
fn index<'a>(&'a self, idx: &uint) -> &'a Show + 'static {
28+
fn index<'a>(&'a self, idx: &uint) -> &'a (Show + 'static) {
2929
static x: uint = 42;
3030
&x
3131
}

src/test/compile-fail/issue-12470.rs

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

2626
struct A<'a> {
27-
p: &'a X+'a
27+
p: &'a (X+'a)
2828
}
2929

3030
fn make_a<'a>(p: &'a X) -> A<'a> {

src/test/compile-fail/issue-14285.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ struct A;
1414

1515
impl Foo for A {}
1616

17-
struct B<'a>(&'a Foo+'a);
17+
struct B<'a>(&'a (Foo+'a));
1818

1919
fn foo<'a>(a: &Foo) -> B<'a> {
2020
B(a) //~ ERROR cannot infer an appropriate lifetime

src/test/compile-fail/kindck-copy.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ fn test<'a,T,U:Copy>(_: &'a int) {
4444

4545
// borrowed object types are generally ok
4646
assert_copy::<&'a Dummy>();
47-
assert_copy::<&'a Dummy+Copy>();
48-
assert_copy::<&'static Dummy+Copy>();
47+
assert_copy::<&'a (Dummy+Copy)>();
48+
assert_copy::<&'static (Dummy+Copy)>();
4949

5050
// owned object types are not ok
5151
assert_copy::<Box<Dummy>>(); //~ ERROR `core::kinds::Copy` is not implemented
5252
assert_copy::<Box<Dummy+Copy>>(); //~ ERROR `core::kinds::Copy` is not implemented
5353

5454
// mutable object types are not ok
55-
assert_copy::<&'a mut Dummy+Copy>(); //~ ERROR `core::kinds::Copy` is not implemented
55+
assert_copy::<&'a mut (Dummy+Copy)>(); //~ ERROR `core::kinds::Copy` is not implemented
5656

5757
// closures are like an `&mut` object
5858
assert_copy::<||>(); //~ ERROR `core::kinds::Copy` is not implemented

src/test/compile-fail/kindck-send-object.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ trait Message : Send { }
1919
// careful with object types, who knows what they close over...
2020

2121
fn object_ref_with_static_bound_not_ok() {
22-
assert_send::<&'static Dummy+'static>();
22+
assert_send::<&'static (Dummy+'static)>();
2323
//~^ ERROR the trait `core::kinds::Send` is not implemented
2424
}
2525

@@ -36,7 +36,7 @@ fn closure_with_no_bound_not_ok<'a>() {
3636
}
3737

3838
fn object_with_send_bound_ok() {
39-
assert_send::<&'static Dummy+Send>();
39+
assert_send::<&'static (Dummy+Send)>();
4040
assert_send::<Box<Dummy+Send>>();
4141
assert_send::<proc():Send>;
4242
assert_send::<||:Send>;

src/test/compile-fail/kindck-send-object1.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ fn test51<'a>() {
2121
//~^ ERROR the trait `core::kinds::Send` is not implemented
2222
}
2323
fn test52<'a>() {
24-
assert_send::<&'a Dummy+Send>();
24+
assert_send::<&'a (Dummy+Send)>();
2525
//~^ ERROR does not fulfill the required lifetime
2626
}
2727

2828
// ...unless they are properly bounded
2929
fn test60() {
30-
assert_send::<&'static Dummy+Send>();
30+
assert_send::<&'static (Dummy+Send)>();
3131
}
3232
fn test61() {
3333
assert_send::<Box<Dummy+Send>>();

src/test/compile-fail/kindck-send-object2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ fn test53() {
2323

2424
// ...unless they are properly bounded
2525
fn test60() {
26-
assert_send::<&'static Dummy+Send>();
26+
assert_send::<&'static (Dummy+Send)>();
2727
}
2828
fn test61() {
2929
assert_send::<Box<Dummy+Send>>();

src/test/compile-fail/region-object-lifetime-1.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ fn borrowed_receiver_different_lifetimes<'a,'b>(x: &'a Foo) -> &'b () {
2828

2929
// Borrowed receiver with two distinct lifetimes, but we know that
3030
// 'b:'a, hence &'a () is permitted.
31-
fn borrowed_receiver_related_lifetimes<'a,'b>(x: &'a Foo+'b) -> &'a () {
31+
fn borrowed_receiver_related_lifetimes<'a,'b>(x: &'a (Foo+'b)) -> &'a () {
3232
x.borrowed()
3333
}
3434

3535
// Here we have two distinct lifetimes, but we try to return a pointer
3636
// with the longer lifetime when (from the signature) we only know
3737
// that it lives as long as the shorter lifetime. Therefore, error.
38-
fn borrowed_receiver_related_lifetimes2<'a,'b>(x: &'a Foo+'b) -> &'b () {
38+
fn borrowed_receiver_related_lifetimes2<'a,'b>(x: &'a (Foo+'b)) -> &'b () {
3939
x.borrowed() //~ ERROR cannot infer
4040
}
4141

src/test/compile-fail/regions-bounded-by-send.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ fn box_with_region_not_ok<'a>() {
5757
// objects with insufficient bounds no ok
5858

5959
fn object_with_random_bound_not_ok<'a>() {
60-
assert_send::<&'a Dummy+'a>();
60+
assert_send::<&'a (Dummy+'a)>();
6161
//~^ ERROR not implemented
6262
}
6363

6464
fn object_with_send_bound_not_ok<'a>() {
65-
assert_send::<&'a Dummy+Send>();
65+
assert_send::<&'a (Dummy+Send)>();
6666
//~^ ERROR does not fulfill
6767
}
6868

src/test/compile-fail/regions-close-object-into-object.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111

1212
trait A<T> {}
13-
struct B<'a, T>(&'a A<T>+'a);
13+
struct B<'a, T>(&'a (A<T>+'a));
1414

1515
trait X {}
1616
impl<'a, T> X for B<'a, T> {}

src/test/compile-fail/regions-trait-variance.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ impl Drop for B {
3131
}
3232

3333
struct A<'r> {
34-
p: &'r X+'r
34+
p: &'r (X+'r)
3535
}
3636

3737
fn make_a(p:&X) -> A {

src/test/compile-fail/trait-bounds-not-on-impl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ trait Foo {
1313

1414
struct Bar;
1515

16-
impl Foo + Owned for Bar { //~ ERROR bounded traits are only valid in type position
16+
impl Foo + Owned for Bar { //~ ERROR not a trait
1717
}
1818

1919
fn main() { }

src/test/compile-fail/trait-bounds-not-on-struct.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111

1212
struct Foo;
1313

14-
fn foo(_x: Box<Foo + Send>) { } //~ ERROR kind bounds can only be used on trait types
14+
fn foo(_x: Box<Foo + Send>) { } //~ ERROR expected a reference to a trait
1515

1616
fn main() { }

src/test/compile-fail/trait-bounds-sugar.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ trait Foo {}
1616
fn a(_x: Box<Foo+Send>) {
1717
}
1818

19-
fn b(_x: &'static Foo+'static) {
19+
fn b(_x: &'static (Foo+'static)) {
2020
}
2121

2222
fn c(x: Box<Foo+Sync>) {
2323
a(x); //~ ERROR mismatched types
2424
}
2525

26-
fn d(x: &'static Foo+Sync) {
26+
fn d(x: &'static (Foo+Sync)) {
2727
b(x); //~ ERROR cannot infer
2828
//~^ ERROR mismatched types
2929
}

src/test/run-pass/colorful-write-macros.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use std::fmt;
1818
use std::fmt::FormatWriter;
1919

2020
struct Foo<'a> {
21-
writer: &'a mut Writer+'a,
21+
writer: &'a mut (Writer+'a),
2222
other: &'a str,
2323
}
2424

src/test/run-pass/dst-index.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ impl Index<uint, str> for S {
2525
struct T;
2626

2727
impl Index<uint, Show + 'static> for T {
28-
fn index<'a>(&'a self, idx: &uint) -> &'a Show + 'static {
28+
fn index<'a>(&'a self, idx: &uint) -> &'a (Show + 'static) {
2929
static x: uint = 42;
3030
&x
3131
}

src/test/run-pass/issue-10902.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010

1111
pub mod two_tuple {
1212
pub trait T {}
13-
pub struct P<'a>(&'a T + 'a, &'a T + 'a);
13+
pub struct P<'a>(&'a (T + 'a), &'a (T + 'a));
1414
pub fn f<'a>(car: &'a T, cdr: &'a T) -> P<'a> {
1515
P(car, cdr)
1616
}
1717
}
1818

1919
pub mod two_fields {
2020
pub trait T {}
21-
pub struct P<'a> { car: &'a T + 'a, cdr: &'a T + 'a }
21+
pub struct P<'a> { car: &'a (T + 'a), cdr: &'a (T + 'a) }
2222
pub fn f<'a>(car: &'a T, cdr: &'a T) -> P<'a> {
2323
P{ car: car, cdr: cdr }
2424
}

src/test/run-pass/issue-11205.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ fn main() {
4949
foog(x, &[box 1i]);
5050

5151
struct T<'a> {
52-
t: [&'a Foo+'a, ..2]
52+
t: [&'a (Foo+'a), ..2]
5353
}
5454
let _n = T {
5555
t: [&1i, &2i]
@@ -64,7 +64,7 @@ fn main() {
6464
};
6565

6666
struct F<'b> {
67-
t: &'b [&'b Foo+'b]
67+
t: &'b [&'b (Foo+'b)]
6868
}
6969
let _n = F {
7070
t: &[&1i, &2i]

src/test/run-pass/issue-14901.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use std::io::Reader;
1212

1313
enum Wrapper<'a> {
14-
WrapReader(&'a Reader + 'a)
14+
WrapReader(&'a (Reader + 'a))
1515
}
1616

1717
trait Wrap<'a> {

src/test/run-pass/issue-14958.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ trait Foo {}
1414

1515
struct Bar;
1616

17-
impl<'a> std::ops::Fn<(&'a Foo+'a,), ()> for Bar {
17+
impl<'a> std::ops::Fn<(&'a (Foo+'a),), ()> for Bar {
1818
extern "rust-call" fn call(&self, _: (&'a Foo,)) {}
1919
}
2020

src/test/run-pass/issue-14959.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ impl Alloy {
3333
}
3434
}
3535

36-
impl<'a, 'b> Fn<(&'b mut Response+'b,),()> for SendFile<'a> {
37-
extern "rust-call" fn call(&self, (_res,): (&'b mut Response+'b,)) {}
36+
impl<'a, 'b> Fn<(&'b mut (Response+'b),),()> for SendFile<'a> {
37+
extern "rust-call" fn call(&self, (_res,): (&'b mut (Response+'b),)) {}
3838
}
3939

4040
impl<Rq: Request, Rs: Response> Ingot<Rq, Rs> for HelloWorld {

0 commit comments

Comments
 (0)