Skip to content

Commit fe1e815

Browse files
committed
Auto merge of #68517 - oli-obk:spaces2, r=nagisa
Don't use spaces before type ascription like colons Split out of #67133 to make that PR simpler r? @eddyb
2 parents 086b2a4 + ae31436 commit fe1e815

23 files changed

+35
-36
lines changed

src/librustc/ty/print/pretty.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -889,7 +889,7 @@ pub trait PrettyPrinter<'tcx>:
889889
// fallback
890890
p!(write("{:?}", ct.val));
891891
if print_ty {
892-
p!(write(" : "), print(ct.ty));
892+
p!(write(": "), print(ct.ty));
893893
}
894894
}
895895
};
@@ -1009,7 +1009,7 @@ pub trait PrettyPrinter<'tcx>:
10091009
// fallback
10101010
p!(write("{:?}", ct));
10111011
if print_ty {
1012-
p!(write(" : "), print(ty));
1012+
p!(write(": "), print(ty));
10131013
}
10141014
}
10151015
}
@@ -1610,7 +1610,7 @@ where
16101610
type Error = P::Error;
16111611
fn print(&self, mut cx: P) -> Result<Self::Output, Self::Error> {
16121612
define_scoped_cx!(cx);
1613-
p!(print(self.0), write(" : "), print(self.1));
1613+
p!(print(self.0), write(": "), print(self.1));
16141614
Ok(cx)
16151615
}
16161616
}

src/test/ui/error-codes/e0119/complex-impl.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | impl<R> External for (Q, R) {}
66
|
77
= note: conflicting implementation in crate `complex_impl_support`:
88
- impl<'a, 'b, 'c, T, U, V, W> complex_impl_support::External for (T, complex_impl_support::M<'a, 'b, 'c, std::boxed::Box<U>, V, W>)
9-
where <U as std::ops::FnOnce<(T,)>>::Output == V, <V as std::iter::Iterator>::Item == T, 'b : 'a, T : 'a, U: std::ops::FnOnce<(T,)>, U : 'static, V: std::iter::Iterator, V: std::clone::Clone, W: std::ops::Add, <W as std::ops::Add>::Output: std::marker::Copy;
9+
where <U as std::ops::FnOnce<(T,)>>::Output == V, <V as std::iter::Iterator>::Item == T, 'b: 'a, T: 'a, U: std::ops::FnOnce<(T,)>, U: 'static, V: std::iter::Iterator, V: std::clone::Clone, W: std::ops::Add, <W as std::ops::Add>::Output: std::marker::Copy;
1010

1111
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
1212
--> $DIR/complex-impl.rs:9:1

src/test/ui/generic-associated-types/issue-62326-parameter-out-of-range.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@
44
// FIXME(generic-associated-types) Investigate why this doesn't compile.
55

66
trait Iterator {
7-
//~^ ERROR the requirement `for<'a> <Self as Iterator>::Item<'a> : 'a` is not satisfied
7+
//~^ ERROR the requirement `for<'a> <Self as Iterator>::Item<'a>: 'a` is not satisfied
88
type Item<'a>: 'a;
99
}
1010

11-
1211
fn main() {}

src/test/ui/generic-associated-types/issue-62326-parameter-out-of-range.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0280]: the requirement `for<'a> <Self as Iterator>::Item<'a> : 'a` is not satisfied
1+
error[E0280]: the requirement `for<'a> <Self as Iterator>::Item<'a>: 'a` is not satisfied
22
--> $DIR/issue-62326-parameter-out-of-range.rs:6:1
33
|
44
LL | trait Iterator {

src/test/ui/reject-specialized-drops-8142.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ struct TupleStruct<T>(T);
2121
union Union<T: Copy> { f: T }
2222

2323
impl<'al,'adds_bnd:'al> Drop for K<'al,'adds_bnd> { // REJECT
24-
//~^ ERROR `Drop` impl requires `'adds_bnd : 'al`
24+
//~^ ERROR `Drop` impl requires `'adds_bnd: 'al`
2525
fn drop(&mut self) { } }
2626

2727
impl<'al,'adds_bnd> Drop for L<'al,'adds_bnd> where 'adds_bnd:'al { // REJECT
28-
//~^ ERROR `Drop` impl requires `'adds_bnd : 'al`
28+
//~^ ERROR `Drop` impl requires `'adds_bnd: 'al`
2929
fn drop(&mut self) { } }
3030

3131
impl<'ml> Drop for M<'ml> { fn drop(&mut self) { } } // ACCEPT
@@ -44,7 +44,7 @@ impl<AddsBnd:Bound> Drop for Q<AddsBnd> { fn drop(&mut self) { } } // REJECT
4444
//~^ ERROR `Drop` impl requires `AddsBnd: Bound`
4545

4646
impl<'rbnd,AddsRBnd:'rbnd> Drop for R<AddsRBnd> { fn drop(&mut self) { } } // REJECT
47-
//~^ ERROR `Drop` impl requires `AddsRBnd : 'rbnd`
47+
//~^ ERROR `Drop` impl requires `AddsRBnd: 'rbnd`
4848

4949
impl<Bs:Bound> Drop for S<Bs> { fn drop(&mut self) { } } // ACCEPT
5050

src/test/ui/reject-specialized-drops-8142.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ note: the implementor must specify the same requirement
1010
LL | union Union<T: Copy> { f: T }
1111
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1212

13-
error[E0367]: `Drop` impl requires `'adds_bnd : 'al` but the struct it is implemented for does not
13+
error[E0367]: `Drop` impl requires `'adds_bnd: 'al` but the struct it is implemented for does not
1414
--> $DIR/reject-specialized-drops-8142.rs:23:20
1515
|
1616
LL | impl<'al,'adds_bnd:'al> Drop for K<'al,'adds_bnd> { // REJECT
@@ -22,7 +22,7 @@ note: the implementor must specify the same requirement
2222
LL | struct K<'l1,'l2> { x: &'l1 i8, y: &'l2 u8 }
2323
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2424

25-
error[E0367]: `Drop` impl requires `'adds_bnd : 'al` but the struct it is implemented for does not
25+
error[E0367]: `Drop` impl requires `'adds_bnd: 'al` but the struct it is implemented for does not
2626
--> $DIR/reject-specialized-drops-8142.rs:27:67
2727
|
2828
LL | impl<'al,'adds_bnd> Drop for L<'al,'adds_bnd> where 'adds_bnd:'al { // REJECT
@@ -73,7 +73,7 @@ note: the implementor must specify the same requirement
7373
LL | struct Q<Tq> { x: *const Tq }
7474
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7575

76-
error[E0367]: `Drop` impl requires `AddsRBnd : 'rbnd` but the struct it is implemented for does not
76+
error[E0367]: `Drop` impl requires `AddsRBnd: 'rbnd` but the struct it is implemented for does not
7777
--> $DIR/reject-specialized-drops-8142.rs:46:21
7878
|
7979
LL | impl<'rbnd,AddsRBnd:'rbnd> Drop for R<AddsRBnd> { fn drop(&mut self) { } } // REJECT

src/test/ui/rfc-2093-infer-outlives/cross-crate.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | | bar: std::slice::IterMut<'a, T>
66
LL | | }
77
| |_^
88
|
9-
= note: T : 'a
9+
= note: T: 'a
1010

1111
error: aborting due to previous error
1212

src/test/ui/rfc-2093-infer-outlives/enum.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | | One(Bar<'a, T>)
66
LL | | }
77
| |_^
88
|
9-
= note: T : 'a
9+
= note: T: 'a
1010

1111
error: rustc_outlives
1212
--> $DIR/enum.rs:13:1
@@ -16,7 +16,7 @@ LL | | field2: &'b U
1616
LL | | }
1717
| |_^
1818
|
19-
= note: U : 'b
19+
= note: U: 'b
2020

2121
error: rustc_outlives
2222
--> $DIR/enum.rs:19:1
@@ -26,7 +26,7 @@ LL | | One(&'c Yang<K>)
2626
LL | | }
2727
| |_^
2828
|
29-
= note: K : 'c
29+
= note: K: 'c
3030

3131
error: aborting due to 3 previous errors
3232

src/test/ui/rfc-2093-infer-outlives/explicit-dyn.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ LL | | foo: Box<dyn Trait<'a, A>>
77
LL | | }
88
| |_^
99
|
10-
= note: A : 'a
10+
= note: A: 'a
1111

1212
error: aborting due to previous error
1313

src/test/ui/rfc-2093-infer-outlives/explicit-enum.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | | One(Bar<'a, U>)
66
LL | | }
77
| |_^
88
|
9-
= note: U : 'a
9+
= note: U: 'a
1010

1111
error: aborting due to previous error
1212

src/test/ui/rfc-2093-infer-outlives/explicit-projection.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ LL | | foo: <A as Trait<'a, B>>::Type
77
LL | | }
88
| |_^
99
|
10-
= note: B : 'a
10+
= note: B: 'a
1111

1212
error: aborting due to previous error
1313

src/test/ui/rfc-2093-infer-outlives/explicit-struct.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | | bar: Bar<'b, U>
66
LL | | }
77
| |_^
88
|
9-
= note: U : 'b
9+
= note: U: 'b
1010

1111
error: aborting due to previous error
1212

src/test/ui/rfc-2093-infer-outlives/explicit-union.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | | bar: Bar<'b, U>
66
LL | | }
77
| |_^
88
|
9-
= note: U : 'b
9+
= note: U: 'b
1010

1111
error: aborting due to previous error
1212

src/test/ui/rfc-2093-infer-outlives/infer-static.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | | bar: Bar<U>
66
LL | | }
77
| |_^
88
|
9-
= note: U : 'static
9+
= note: U: 'static
1010

1111
error: aborting due to previous error
1212

src/test/ui/rfc-2093-infer-outlives/nested-enum.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ LL | | One(Bar<'a, T>)
77
LL | | }
88
| |_^
99
|
10-
= note: T : 'a
10+
= note: T: 'a
1111

1212
error: aborting due to previous error
1313

src/test/ui/rfc-2093-infer-outlives/nested-regions.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ LL | | x: &'a &'b T
66
LL | | }
77
| |_^
88
|
9-
= note: 'b : 'a
10-
= note: T : 'a
11-
= note: T : 'b
9+
= note: 'b: 'a
10+
= note: T: 'a
11+
= note: T: 'b
1212

1313
error: aborting due to previous error
1414

src/test/ui/rfc-2093-infer-outlives/nested-structs.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | | field1: Bar<'a, T>
66
LL | | }
77
| |_^
88
|
9-
= note: T : 'a
9+
= note: T: 'a
1010

1111
error: aborting due to previous error
1212

src/test/ui/rfc-2093-infer-outlives/nested-union.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | | field1: Bar<'a, T>
66
LL | | }
77
| |_^
88
|
9-
= note: T : 'a
9+
= note: T: 'a
1010

1111
error: aborting due to previous error
1212

src/test/ui/rfc-2093-infer-outlives/projection.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | | bar: &'a T::Item
66
LL | | }
77
| |_^
88
|
9-
= note: <T as std::iter::Iterator>::Item : 'a
9+
= note: <T as std::iter::Iterator>::Item: 'a
1010

1111
error: aborting due to previous error
1212

src/test/ui/rfc-2093-infer-outlives/reference.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | | bar: &'a T,
66
LL | | }
77
| |_^
88
|
9-
= note: T : 'a
9+
= note: T: 'a
1010

1111
error: aborting due to previous error
1212

src/test/ui/rfc-2093-infer-outlives/self-dyn.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ LL | | foo: Box<dyn Trait<'a, 'b, A>>
77
LL | | }
88
| |_^
99
|
10-
= note: A : 'a
10+
= note: A: 'a
1111

1212
error: aborting due to previous error
1313

src/test/ui/rfc-2093-infer-outlives/self-structs.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | | field1: dyn Bar<'a, 'b, T>
66
LL | | }
77
| |_^
88
|
9-
= note: T : 'a
9+
= note: T: 'a
1010

1111
error: aborting due to previous error
1212

src/test/ui/trivial-bounds/trivial-bounds-lint.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,19 @@ error: Trait bound i32: Z does not depend on any type or lifetime parameters
2222
LL | fn global_projection() where i32: Z<S = i32> {}
2323
| ^^^^^^^^^^
2424

25-
error: Lifetime bound i32 : 'static does not depend on any type or lifetime parameters
25+
error: Lifetime bound i32: 'static does not depend on any type or lifetime parameters
2626
--> $DIR/trivial-bounds-lint.rs:29:34
2727
|
2828
LL | fn global_lifetimes() where i32: 'static, &'static str: 'static {}
2929
| ^^^^^^^
3030

31-
error: Lifetime bound &'static str : 'static does not depend on any type or lifetime parameters
31+
error: Lifetime bound &'static str: 'static does not depend on any type or lifetime parameters
3232
--> $DIR/trivial-bounds-lint.rs:29:57
3333
|
3434
LL | fn global_lifetimes() where i32: 'static, &'static str: 'static {}
3535
| ^^^^^^^
3636

37-
error: Lifetime bound 'static : 'static does not depend on any type or lifetime parameters
37+
error: Lifetime bound 'static: 'static does not depend on any type or lifetime parameters
3838
--> $DIR/trivial-bounds-lint.rs:35:37
3939
|
4040
LL | fn global_outlives() where 'static: 'static {}

0 commit comments

Comments
 (0)