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
diff --git a/src/librustc/ty/print/pretty.rs b/src/librustc/ty/print/pretty.rs
index 7dd3c8f..db539f9 100644
--- a/src/librustc/ty/print/pretty.rs
+++ b/src/librustc/ty/print/pretty.rs
@@ -889,7 +889,7 @@
// fallback
p!(write("{:?}", ct.val));
if print_ty {
- p!(write(" : "), print(ct.ty));
+ p!(write(": "), print(ct.ty));
}
}
};
@@ -1009,7 +1009,7 @@
// fallback
p!(write("{:?}", ct));
if print_ty {
- p!(write(" : "), print(ty));
+ p!(write(": "), print(ty));
}
}
}
@@ -1610,7 +1610,7 @@
type Error = P::Error;
fn print(&self, mut cx: P) -> Result<Self::Output, Self::Error> {
define_scoped_cx!(cx);
- p!(print(self.0), write(" : "), print(self.1));
+ p!(print(self.0), write(": "), print(self.1));
Ok(cx)
}
}
diff --git a/src/test/ui/error-codes/e0119/complex-impl.stderr b/src/test/ui/error-codes/e0119/complex-impl.stderr
index 0c18a1f..2cc09e8 100644
--- a/src/test/ui/error-codes/e0119/complex-impl.stderr
+++ b/src/test/ui/error-codes/e0119/complex-impl.stderr
@@ -6,7 +6,7 @@
|
= note: conflicting implementation in crate `complex_impl_support`:
- 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>)
- 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;
+ 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;
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
--> $DIR/complex-impl.rs:9:1
diff --git a/src/test/ui/generic-associated-types/issue-62326-parameter-out-of-range.rs b/src/test/ui/generic-associated-types/issue-62326-parameter-out-of-range.rs
index db0da40..60466d0 100644
--- a/src/test/ui/generic-associated-types/issue-62326-parameter-out-of-range.rs
+++ b/src/test/ui/generic-associated-types/issue-62326-parameter-out-of-range.rs
@@ -4,9 +4,8 @@
// FIXME(generic-associated-types) Investigate why this doesn't compile.
trait Iterator {
-//~^ ERROR the requirement `for<'a> <Self as Iterator>::Item<'a> : 'a` is not satisfied
+ //~^ ERROR the requirement `for<'a> <Self as Iterator>::Item<'a>: 'a` is not satisfied
type Item<'a>: 'a;
}
-
fn main() {}
diff --git a/src/test/ui/generic-associated-types/issue-62326-parameter-out-of-range.stderr b/src/test/ui/generic-associated-types/issue-62326-parameter-out-of-range.stderr
index 0716970..4dc69cd 100644
--- a/src/test/ui/generic-associated-types/issue-62326-parameter-out-of-range.stderr
+++ b/src/test/ui/generic-associated-types/issue-62326-parameter-out-of-range.stderr
@@ -1,4 +1,4 @@
-error[E0280]: the requirement `for<'a> <Self as Iterator>::Item<'a> : 'a` is not satisfied
+error[E0280]: the requirement `for<'a> <Self as Iterator>::Item<'a>: 'a` is not satisfied
--> $DIR/issue-62326-parameter-out-of-range.rs:6:1
|
LL | trait Iterator {
diff --git a/src/test/ui/reject-specialized-drops-8142.rs b/src/test/ui/reject-specialized-drops-8142.rs
index d7fec88..c467173 100644
--- a/src/test/ui/reject-specialized-drops-8142.rs
+++ b/src/test/ui/reject-specialized-drops-8142.rs
@@ -21,11 +21,11 @@
union Union<T: Copy> { f: T }
impl<'al,'adds_bnd:'al> Drop for K<'al,'adds_bnd> { // REJECT
- //~^ ERROR `Drop` impl requires `'adds_bnd : 'al`
+ //~^ ERROR `Drop` impl requires `'adds_bnd: 'al`
fn drop(&mut self) { } }
impl<'al,'adds_bnd> Drop for L<'al,'adds_bnd> where 'adds_bnd:'al { // REJECT
- //~^ ERROR `Drop` impl requires `'adds_bnd : 'al`
+ //~^ ERROR `Drop` impl requires `'adds_bnd: 'al`
fn drop(&mut self) { } }
impl<'ml> Drop for M<'ml> { fn drop(&mut self) { } } // ACCEPT
@@ -44,7 +44,7 @@
//~^ ERROR `Drop` impl requires `AddsBnd: Bound`
impl<'rbnd,AddsRBnd:'rbnd> Drop for R<AddsRBnd> { fn drop(&mut self) { } } // REJECT
-//~^ ERROR `Drop` impl requires `AddsRBnd : 'rbnd`
+//~^ ERROR `Drop` impl requires `AddsRBnd: 'rbnd`
impl<Bs:Bound> Drop for S<Bs> { fn drop(&mut self) { } } // ACCEPT
diff --git a/src/test/ui/reject-specialized-drops-8142.stderr b/src/test/ui/reject-specialized-drops-8142.stderr
index 14618df..c09418d 100644
--- a/src/test/ui/reject-specialized-drops-8142.stderr
+++ b/src/test/ui/reject-specialized-drops-8142.stderr
@@ -10,7 +10,7 @@
LL | union Union<T: Copy> { f: T }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-error[E0367]: `Drop` impl requires `'adds_bnd : 'al` but the struct it is implemented for does not
+error[E0367]: `Drop` impl requires `'adds_bnd: 'al` but the struct it is implemented for does not
--> $DIR/reject-specialized-drops-8142.rs:23:20
|
LL | impl<'al,'adds_bnd:'al> Drop for K<'al,'adds_bnd> { // REJECT
@@ -22,7 +22,7 @@
LL | struct K<'l1,'l2> { x: &'l1 i8, y: &'l2 u8 }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-error[E0367]: `Drop` impl requires `'adds_bnd : 'al` but the struct it is implemented for does not
+error[E0367]: `Drop` impl requires `'adds_bnd: 'al` but the struct it is implemented for does not
--> $DIR/reject-specialized-drops-8142.rs:27:67
|
LL | impl<'al,'adds_bnd> Drop for L<'al,'adds_bnd> where 'adds_bnd:'al { // REJECT
@@ -73,7 +73,7 @@
LL | struct Q<Tq> { x: *const Tq }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-error[E0367]: `Drop` impl requires `AddsRBnd : 'rbnd` but the struct it is implemented for does not
+error[E0367]: `Drop` impl requires `AddsRBnd: 'rbnd` but the struct it is implemented for does not
--> $DIR/reject-specialized-drops-8142.rs:46:21
|
LL | impl<'rbnd,AddsRBnd:'rbnd> Drop for R<AddsRBnd> { fn drop(&mut self) { } } // REJECT
diff --git a/src/test/ui/rfc-2093-infer-outlives/cross-crate.stderr b/src/test/ui/rfc-2093-infer-outlives/cross-crate.stderr
index 3368e35..1da8e64 100644
--- a/src/test/ui/rfc-2093-infer-outlives/cross-crate.stderr
+++ b/src/test/ui/rfc-2093-infer-outlives/cross-crate.stderr
@@ -6,7 +6,7 @@
LL | | }
| |_^
|
- = note: T : 'a
+ = note: T: 'a
error: aborting due to previous error
diff --git a/src/test/ui/rfc-2093-infer-outlives/enum.stderr b/src/test/ui/rfc-2093-infer-outlives/enum.stderr
index dd56c1f..868ca2c 100644
--- a/src/test/ui/rfc-2093-infer-outlives/enum.stderr
+++ b/src/test/ui/rfc-2093-infer-outlives/enum.stderr
@@ -6,7 +6,7 @@
LL | | }
| |_^
|
- = note: T : 'a
+ = note: T: 'a
error: rustc_outlives
--> $DIR/enum.rs:13:1
@@ -16,7 +16,7 @@
LL | | }
| |_^
|
- = note: U : 'b
+ = note: U: 'b
error: rustc_outlives
--> $DIR/enum.rs:19:1
@@ -26,7 +26,7 @@
LL | | }
| |_^
|
- = note: K : 'c
+ = note: K: 'c
error: aborting due to 3 previous errors
diff --git a/src/test/ui/rfc-2093-infer-outlives/explicit-dyn.stderr b/src/test/ui/rfc-2093-infer-outlives/explicit-dyn.stderr
index c87ef6c..adb718a 100644
--- a/src/test/ui/rfc-2093-infer-outlives/explicit-dyn.stderr
+++ b/src/test/ui/rfc-2093-infer-outlives/explicit-dyn.stderr
@@ -7,7 +7,7 @@
LL | | }
| |_^
|
- = note: A : 'a
+ = note: A: 'a
error: aborting due to previous error
diff --git a/src/test/ui/rfc-2093-infer-outlives/explicit-enum.stderr b/src/test/ui/rfc-2093-infer-outlives/explicit-enum.stderr
index 611df04..062f5d5 100644
--- a/src/test/ui/rfc-2093-infer-outlives/explicit-enum.stderr
+++ b/src/test/ui/rfc-2093-infer-outlives/explicit-enum.stderr
@@ -6,7 +6,7 @@
LL | | }
| |_^
|
- = note: U : 'a
+ = note: U: 'a
error: aborting due to previous error
diff --git a/src/test/ui/rfc-2093-infer-outlives/explicit-projection.stderr b/src/test/ui/rfc-2093-infer-outlives/explicit-projection.stderr
index 8e9b158..a85aa3d 100644
--- a/src/test/ui/rfc-2093-infer-outlives/explicit-projection.stderr
+++ b/src/test/ui/rfc-2093-infer-outlives/explicit-projection.stderr
@@ -7,7 +7,7 @@
LL | | }
| |_^
|
- = note: B : 'a
+ = note: B: 'a
error: aborting due to previous error
diff --git a/src/test/ui/rfc-2093-infer-outlives/explicit-struct.stderr b/src/test/ui/rfc-2093-infer-outlives/explicit-struct.stderr
index cbff2b7..309c54b 100644
--- a/src/test/ui/rfc-2093-infer-outlives/explicit-struct.stderr
+++ b/src/test/ui/rfc-2093-infer-outlives/explicit-struct.stderr
@@ -6,7 +6,7 @@
LL | | }
| |_^
|
- = note: U : 'b
+ = note: U: 'b
error: aborting due to previous error
diff --git a/src/test/ui/rfc-2093-infer-outlives/explicit-union.stderr b/src/test/ui/rfc-2093-infer-outlives/explicit-union.stderr
index 8aa246e..47c283f 100644
--- a/src/test/ui/rfc-2093-infer-outlives/explicit-union.stderr
+++ b/src/test/ui/rfc-2093-infer-outlives/explicit-union.stderr
@@ -6,7 +6,7 @@
LL | | }
| |_^
|
- = note: U : 'b
+ = note: U: 'b
error: aborting due to previous error
diff --git a/src/test/ui/rfc-2093-infer-outlives/infer-static.stderr b/src/test/ui/rfc-2093-infer-outlives/infer-static.stderr
index 106db76..6fbb7cf 100644
--- a/src/test/ui/rfc-2093-infer-outlives/infer-static.stderr
+++ b/src/test/ui/rfc-2093-infer-outlives/infer-static.stderr
@@ -6,7 +6,7 @@
LL | | }
| |_^
|
- = note: U : 'static
+ = note: U: 'static
error: aborting due to previous error
diff --git a/src/test/ui/rfc-2093-infer-outlives/nested-enum.stderr b/src/test/ui/rfc-2093-infer-outlives/nested-enum.stderr
index 6b143ba..10387f5 100644
--- a/src/test/ui/rfc-2093-infer-outlives/nested-enum.stderr
+++ b/src/test/ui/rfc-2093-infer-outlives/nested-enum.stderr
@@ -7,7 +7,7 @@
LL | | }
| |_^
|
- = note: T : 'a
+ = note: T: 'a
error: aborting due to previous error
diff --git a/src/test/ui/rfc-2093-infer-outlives/nested-regions.stderr b/src/test/ui/rfc-2093-infer-outlives/nested-regions.stderr
index 4d8f7b7..ffdd554 100644
--- a/src/test/ui/rfc-2093-infer-outlives/nested-regions.stderr
+++ b/src/test/ui/rfc-2093-infer-outlives/nested-regions.stderr
@@ -6,9 +6,9 @@
LL | | }
| |_^
|
- = note: 'b : 'a
- = note: T : 'a
- = note: T : 'b
+ = note: 'b: 'a
+ = note: T: 'a
+ = note: T: 'b
error: aborting due to previous error
diff --git a/src/test/ui/rfc-2093-infer-outlives/nested-structs.stderr b/src/test/ui/rfc-2093-infer-outlives/nested-structs.stderr
index 17d7c01..86bcbe6 100644
--- a/src/test/ui/rfc-2093-infer-outlives/nested-structs.stderr
+++ b/src/test/ui/rfc-2093-infer-outlives/nested-structs.stderr
@@ -6,7 +6,7 @@
LL | | }
| |_^
|
- = note: T : 'a
+ = note: T: 'a
error: aborting due to previous error
diff --git a/src/test/ui/rfc-2093-infer-outlives/nested-union.stderr b/src/test/ui/rfc-2093-infer-outlives/nested-union.stderr
index a42285a..e0f248f 100644
--- a/src/test/ui/rfc-2093-infer-outlives/nested-union.stderr
+++ b/src/test/ui/rfc-2093-infer-outlives/nested-union.stderr
@@ -6,7 +6,7 @@
LL | | }
| |_^
|
- = note: T : 'a
+ = note: T: 'a
error: aborting due to previous error
diff --git a/src/test/ui/rfc-2093-infer-outlives/projection.stderr b/src/test/ui/rfc-2093-infer-outlives/projection.stderr
index 8a91c44..3746bab 100644
--- a/src/test/ui/rfc-2093-infer-outlives/projection.stderr
+++ b/src/test/ui/rfc-2093-infer-outlives/projection.stderr
@@ -6,7 +6,7 @@
LL | | }
| |_^
|
- = note: <T as std::iter::Iterator>::Item : 'a
+ = note: <T as std::iter::Iterator>::Item: 'a
error: aborting due to previous error
diff --git a/src/test/ui/rfc-2093-infer-outlives/reference.stderr b/src/test/ui/rfc-2093-infer-outlives/reference.stderr
index adb1c4a..d69aaf6 100644
--- a/src/test/ui/rfc-2093-infer-outlives/reference.stderr
+++ b/src/test/ui/rfc-2093-infer-outlives/reference.stderr
@@ -6,7 +6,7 @@
LL | | }
| |_^
|
- = note: T : 'a
+ = note: T: 'a
error: aborting due to previous error
diff --git a/src/test/ui/rfc-2093-infer-outlives/self-dyn.stderr b/src/test/ui/rfc-2093-infer-outlives/self-dyn.stderr
index 0be14a6..77577fe 100644
--- a/src/test/ui/rfc-2093-infer-outlives/self-dyn.stderr
+++ b/src/test/ui/rfc-2093-infer-outlives/self-dyn.stderr
@@ -7,7 +7,7 @@
LL | | }
| |_^
|
- = note: A : 'a
+ = note: A: 'a
error: aborting due to previous error
diff --git a/src/test/ui/rfc-2093-infer-outlives/self-structs.stderr b/src/test/ui/rfc-2093-infer-outlives/self-structs.stderr
index b32c974..b972ad8 100644
--- a/src/test/ui/rfc-2093-infer-outlives/self-structs.stderr
+++ b/src/test/ui/rfc-2093-infer-outlives/self-structs.stderr
@@ -6,7 +6,7 @@
LL | | }
| |_^
|
- = note: T : 'a
+ = note: T: 'a
error: aborting due to previous error
diff --git a/src/test/ui/trivial-bounds/trivial-bounds-lint.stderr b/src/test/ui/trivial-bounds/trivial-bounds-lint.stderr
index 2f4b2df..37cf6f8 100644
--- a/src/test/ui/trivial-bounds/trivial-bounds-lint.stderr
+++ b/src/test/ui/trivial-bounds/trivial-bounds-lint.stderr
@@ -22,19 +22,19 @@
LL | fn global_projection() where i32: Z<S = i32> {}
| ^^^^^^^^^^
-error: Lifetime bound i32 : 'static does not depend on any type or lifetime parameters
+error: Lifetime bound i32: 'static does not depend on any type or lifetime parameters
--> $DIR/trivial-bounds-lint.rs:29:34
|
LL | fn global_lifetimes() where i32: 'static, &'static str: 'static {}
| ^^^^^^^
-error: Lifetime bound &'static str : 'static does not depend on any type or lifetime parameters
+error: Lifetime bound &'static str: 'static does not depend on any type or lifetime parameters
--> $DIR/trivial-bounds-lint.rs:29:57
|
LL | fn global_lifetimes() where i32: 'static, &'static str: 'static {}
| ^^^^^^^
-error: Lifetime bound 'static : 'static does not depend on any type or lifetime parameters
+error: Lifetime bound 'static: 'static does not depend on any type or lifetime parameters
--> $DIR/trivial-bounds-lint.rs:35:37
|
LL | fn global_outlives() where 'static: 'static {}