Don't use spaces before type ascription like colons

This commit is contained in:
Oliver Scherer 2020-01-24 21:04:17 +01:00
parent 80a65bcaf2
commit ae31436ac7
23 changed files with 35 additions and 36 deletions

View file

@ -889,7 +889,7 @@ pub trait PrettyPrinter<'tcx>:
// fallback // fallback
p!(write("{:?}", ct.val)); p!(write("{:?}", ct.val));
if print_ty { if print_ty {
p!(write(" : "), print(ct.ty)); p!(write(": "), print(ct.ty));
} }
} }
}; };
@ -1009,7 +1009,7 @@ pub trait PrettyPrinter<'tcx>:
// fallback // fallback
p!(write("{:?}", ct)); p!(write("{:?}", ct));
if print_ty { if print_ty {
p!(write(" : "), print(ty)); p!(write(": "), print(ty));
} }
} }
} }
@ -1610,7 +1610,7 @@ where
type Error = P::Error; type Error = P::Error;
fn print(&self, mut cx: P) -> Result<Self::Output, Self::Error> { fn print(&self, mut cx: P) -> Result<Self::Output, Self::Error> {
define_scoped_cx!(cx); define_scoped_cx!(cx);
p!(print(self.0), write(" : "), print(self.1)); p!(print(self.0), write(": "), print(self.1));
Ok(cx) Ok(cx)
} }
} }

View file

@ -6,7 +6,7 @@ LL | impl<R> External for (Q, R) {}
| |
= note: conflicting implementation in crate `complex_impl_support`: = 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>) - 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 error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
--> $DIR/complex-impl.rs:9:1 --> $DIR/complex-impl.rs:9:1

View file

@ -4,9 +4,8 @@
// FIXME(generic-associated-types) Investigate why this doesn't compile. // FIXME(generic-associated-types) Investigate why this doesn't compile.
trait Iterator { 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; type Item<'a>: 'a;
} }
fn main() {} fn main() {}

View file

@ -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 --> $DIR/issue-62326-parameter-out-of-range.rs:6:1
| |
LL | trait Iterator { LL | trait Iterator {

View file

@ -21,11 +21,11 @@ struct TupleStruct<T>(T);
union Union<T: Copy> { f: T } union Union<T: Copy> { f: T }
impl<'al,'adds_bnd:'al> Drop for K<'al,'adds_bnd> { // REJECT 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) { } } fn drop(&mut self) { } }
impl<'al,'adds_bnd> Drop for L<'al,'adds_bnd> where 'adds_bnd:'al { // REJECT 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) { } } fn drop(&mut self) { } }
impl<'ml> Drop for M<'ml> { fn drop(&mut self) { } } // ACCEPT 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
//~^ ERROR `Drop` impl requires `AddsBnd: Bound` //~^ ERROR `Drop` impl requires `AddsBnd: Bound`
impl<'rbnd,AddsRBnd:'rbnd> Drop for R<AddsRBnd> { fn drop(&mut self) { } } // REJECT 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 impl<Bs:Bound> Drop for S<Bs> { fn drop(&mut self) { } } // ACCEPT

View file

@ -10,7 +10,7 @@ note: the implementor must specify the same requirement
LL | union Union<T: Copy> { f: T } 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 --> $DIR/reject-specialized-drops-8142.rs:23:20
| |
LL | impl<'al,'adds_bnd:'al> Drop for K<'al,'adds_bnd> { // REJECT 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
LL | struct K<'l1,'l2> { x: &'l1 i8, y: &'l2 u8 } 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 --> $DIR/reject-specialized-drops-8142.rs:27:67
| |
LL | impl<'al,'adds_bnd> Drop for L<'al,'adds_bnd> where 'adds_bnd:'al { // REJECT 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
LL | struct Q<Tq> { x: *const Tq } 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 --> $DIR/reject-specialized-drops-8142.rs:46:21
| |
LL | impl<'rbnd,AddsRBnd:'rbnd> Drop for R<AddsRBnd> { fn drop(&mut self) { } } // REJECT LL | impl<'rbnd,AddsRBnd:'rbnd> Drop for R<AddsRBnd> { fn drop(&mut self) { } } // REJECT

View file

@ -6,7 +6,7 @@ LL | | bar: std::slice::IterMut<'a, T>
LL | | } LL | | }
| |_^ | |_^
| |
= note: T : 'a = note: T: 'a
error: aborting due to previous error error: aborting due to previous error

View file

@ -6,7 +6,7 @@ LL | | One(Bar<'a, T>)
LL | | } LL | | }
| |_^ | |_^
| |
= note: T : 'a = note: T: 'a
error: rustc_outlives error: rustc_outlives
--> $DIR/enum.rs:13:1 --> $DIR/enum.rs:13:1
@ -16,7 +16,7 @@ LL | | field2: &'b U
LL | | } LL | | }
| |_^ | |_^
| |
= note: U : 'b = note: U: 'b
error: rustc_outlives error: rustc_outlives
--> $DIR/enum.rs:19:1 --> $DIR/enum.rs:19:1
@ -26,7 +26,7 @@ LL | | One(&'c Yang<K>)
LL | | } LL | | }
| |_^ | |_^
| |
= note: K : 'c = note: K: 'c
error: aborting due to 3 previous errors error: aborting due to 3 previous errors

View file

@ -7,7 +7,7 @@ LL | | foo: Box<dyn Trait<'a, A>>
LL | | } LL | | }
| |_^ | |_^
| |
= note: A : 'a = note: A: 'a
error: aborting due to previous error error: aborting due to previous error

View file

@ -6,7 +6,7 @@ LL | | One(Bar<'a, U>)
LL | | } LL | | }
| |_^ | |_^
| |
= note: U : 'a = note: U: 'a
error: aborting due to previous error error: aborting due to previous error

View file

@ -7,7 +7,7 @@ LL | | foo: <A as Trait<'a, B>>::Type
LL | | } LL | | }
| |_^ | |_^
| |
= note: B : 'a = note: B: 'a
error: aborting due to previous error error: aborting due to previous error

View file

@ -6,7 +6,7 @@ LL | | bar: Bar<'b, U>
LL | | } LL | | }
| |_^ | |_^
| |
= note: U : 'b = note: U: 'b
error: aborting due to previous error error: aborting due to previous error

View file

@ -6,7 +6,7 @@ LL | | bar: Bar<'b, U>
LL | | } LL | | }
| |_^ | |_^
| |
= note: U : 'b = note: U: 'b
error: aborting due to previous error error: aborting due to previous error

View file

@ -6,7 +6,7 @@ LL | | bar: Bar<U>
LL | | } LL | | }
| |_^ | |_^
| |
= note: U : 'static = note: U: 'static
error: aborting due to previous error error: aborting due to previous error

View file

@ -7,7 +7,7 @@ LL | | One(Bar<'a, T>)
LL | | } LL | | }
| |_^ | |_^
| |
= note: T : 'a = note: T: 'a
error: aborting due to previous error error: aborting due to previous error

View file

@ -6,9 +6,9 @@ LL | | x: &'a &'b T
LL | | } LL | | }
| |_^ | |_^
| |
= note: 'b : 'a = note: 'b: 'a
= note: T : 'a = note: T: 'a
= note: T : 'b = note: T: 'b
error: aborting due to previous error error: aborting due to previous error

View file

@ -6,7 +6,7 @@ LL | | field1: Bar<'a, T>
LL | | } LL | | }
| |_^ | |_^
| |
= note: T : 'a = note: T: 'a
error: aborting due to previous error error: aborting due to previous error

View file

@ -6,7 +6,7 @@ LL | | field1: Bar<'a, T>
LL | | } LL | | }
| |_^ | |_^
| |
= note: T : 'a = note: T: 'a
error: aborting due to previous error error: aborting due to previous error

View file

@ -6,7 +6,7 @@ LL | | bar: &'a T::Item
LL | | } LL | | }
| |_^ | |_^
| |
= note: <T as std::iter::Iterator>::Item : 'a = note: <T as std::iter::Iterator>::Item: 'a
error: aborting due to previous error error: aborting due to previous error

View file

@ -6,7 +6,7 @@ LL | | bar: &'a T,
LL | | } LL | | }
| |_^ | |_^
| |
= note: T : 'a = note: T: 'a
error: aborting due to previous error error: aborting due to previous error

View file

@ -7,7 +7,7 @@ LL | | foo: Box<dyn Trait<'a, 'b, A>>
LL | | } LL | | }
| |_^ | |_^
| |
= note: A : 'a = note: A: 'a
error: aborting due to previous error error: aborting due to previous error

View file

@ -6,7 +6,7 @@ LL | | field1: dyn Bar<'a, 'b, T>
LL | | } LL | | }
| |_^ | |_^
| |
= note: T : 'a = note: T: 'a
error: aborting due to previous error error: aborting due to previous error

View file

@ -22,19 +22,19 @@ error: Trait bound i32: Z does not depend on any type or lifetime parameters
LL | fn global_projection() where i32: Z<S = i32> {} 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 --> $DIR/trivial-bounds-lint.rs:29:34
| |
LL | fn global_lifetimes() where i32: 'static, &'static str: 'static {} 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 --> $DIR/trivial-bounds-lint.rs:29:57
| |
LL | fn global_lifetimes() where i32: 'static, &'static str: 'static {} 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 --> $DIR/trivial-bounds-lint.rs:35:37
| |
LL | fn global_outlives() where 'static: 'static {} LL | fn global_outlives() where 'static: 'static {}