Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't use spaces before type ascription like colons #68517

Merged
merged 1 commit into from
Jan 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/librustc/ty/print/pretty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,7 @@ pub trait PrettyPrinter<'tcx>:
// fallback
p!(write("{:?}", ct.val));
if print_ty {
p!(write(" : "), print(ct.ty));
p!(write(": "), print(ct.ty));
}
}
};
Expand Down Expand Up @@ -1009,7 +1009,7 @@ pub trait PrettyPrinter<'tcx>:
// fallback
p!(write("{:?}", ct));
if print_ty {
p!(write(" : "), print(ty));
p!(write(": "), print(ty));
}
}
}
Expand Down Expand Up @@ -1610,7 +1610,7 @@ where
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)
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/error-codes/e0119/complex-impl.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ LL | impl<R> External for (Q, R) {}
|
= 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {}
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions src/test/ui/reject-specialized-drops-8142.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ struct TupleStruct<T>(T);
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
Expand All @@ -44,7 +44,7 @@ impl<AddsBnd:Bound> Drop for Q<AddsBnd> { fn drop(&mut self) { } } // REJECT
//~^ 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

Expand Down
6 changes: 3 additions & 3 deletions src/test/ui/reject-specialized-drops-8142.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ note: the implementor must specify the same requirement
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
Expand All @@ -22,7 +22,7 @@ note: the implementor must specify the same requirement
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
Expand Down Expand Up @@ -73,7 +73,7 @@ note: the implementor must specify the same requirement
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
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/rfc-2093-infer-outlives/cross-crate.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ LL | | bar: std::slice::IterMut<'a, T>
LL | | }
| |_^
|
= note: T : 'a
= note: T: 'a

error: aborting due to previous error

6 changes: 3 additions & 3 deletions src/test/ui/rfc-2093-infer-outlives/enum.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ LL | | One(Bar<'a, T>)
LL | | }
| |_^
|
= note: T : 'a
= note: T: 'a

error: rustc_outlives
--> $DIR/enum.rs:13:1
Expand All @@ -16,7 +16,7 @@ LL | | field2: &'b U
LL | | }
| |_^
|
= note: U : 'b
= note: U: 'b

error: rustc_outlives
--> $DIR/enum.rs:19:1
Expand All @@ -26,7 +26,7 @@ LL | | One(&'c Yang<K>)
LL | | }
| |_^
|
= note: K : 'c
= note: K: 'c

error: aborting due to 3 previous errors

2 changes: 1 addition & 1 deletion src/test/ui/rfc-2093-infer-outlives/explicit-dyn.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ LL | | foo: Box<dyn Trait<'a, A>>
LL | | }
| |_^
|
= note: A : 'a
= note: A: 'a

error: aborting due to previous error

2 changes: 1 addition & 1 deletion src/test/ui/rfc-2093-infer-outlives/explicit-enum.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ LL | | One(Bar<'a, U>)
LL | | }
| |_^
|
= note: U : 'a
= note: U: 'a

error: aborting due to previous error

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ LL | | foo: <A as Trait<'a, B>>::Type
LL | | }
| |_^
|
= note: B : 'a
= note: B: 'a

error: aborting due to previous error

2 changes: 1 addition & 1 deletion src/test/ui/rfc-2093-infer-outlives/explicit-struct.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ LL | | bar: Bar<'b, U>
LL | | }
| |_^
|
= note: U : 'b
= note: U: 'b

error: aborting due to previous error

2 changes: 1 addition & 1 deletion src/test/ui/rfc-2093-infer-outlives/explicit-union.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ LL | | bar: Bar<'b, U>
LL | | }
| |_^
|
= note: U : 'b
= note: U: 'b

error: aborting due to previous error

2 changes: 1 addition & 1 deletion src/test/ui/rfc-2093-infer-outlives/infer-static.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ LL | | bar: Bar<U>
LL | | }
| |_^
|
= note: U : 'static
= note: U: 'static

error: aborting due to previous error

2 changes: 1 addition & 1 deletion src/test/ui/rfc-2093-infer-outlives/nested-enum.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ LL | | One(Bar<'a, T>)
LL | | }
| |_^
|
= note: T : 'a
= note: T: 'a

error: aborting due to previous error

6 changes: 3 additions & 3 deletions src/test/ui/rfc-2093-infer-outlives/nested-regions.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ LL | | x: &'a &'b T
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

2 changes: 1 addition & 1 deletion src/test/ui/rfc-2093-infer-outlives/nested-structs.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ LL | | field1: Bar<'a, T>
LL | | }
| |_^
|
= note: T : 'a
= note: T: 'a

error: aborting due to previous error

2 changes: 1 addition & 1 deletion src/test/ui/rfc-2093-infer-outlives/nested-union.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ LL | | field1: Bar<'a, T>
LL | | }
| |_^
|
= note: T : 'a
= note: T: 'a

error: aborting due to previous error

2 changes: 1 addition & 1 deletion src/test/ui/rfc-2093-infer-outlives/projection.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ LL | | bar: &'a T::Item
LL | | }
| |_^
|
= note: <T as std::iter::Iterator>::Item : 'a
= note: <T as std::iter::Iterator>::Item: 'a

error: aborting due to previous error

2 changes: 1 addition & 1 deletion src/test/ui/rfc-2093-infer-outlives/reference.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ LL | | bar: &'a T,
LL | | }
| |_^
|
= note: T : 'a
= note: T: 'a

error: aborting due to previous error

2 changes: 1 addition & 1 deletion src/test/ui/rfc-2093-infer-outlives/self-dyn.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ LL | | foo: Box<dyn Trait<'a, 'b, A>>
LL | | }
| |_^
|
= note: A : 'a
= note: A: 'a

error: aborting due to previous error

2 changes: 1 addition & 1 deletion src/test/ui/rfc-2093-infer-outlives/self-structs.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ LL | | field1: dyn Bar<'a, 'b, T>
LL | | }
| |_^
|
= note: T : 'a
= note: T: 'a

error: aborting due to previous error

6 changes: 3 additions & 3 deletions src/test/ui/trivial-bounds/trivial-bounds-lint.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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> {}
| ^^^^^^^^^^

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 {}
Expand Down