Skip to content

Commit a396434

Browse files
authored
Rollup merge of rust-lang#63487 - sd234678:remove-meaningless-comments-in-src/test-2, r=Centril
Remove meaningless comments in src/test Moved from rust-lang#63411
2 parents a3b6e8e + b21ee49 commit a396434

32 files changed

+68
-149
lines changed

src/test/pretty/stmt_expr_attributes.rs

-2
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,6 @@ fn _12() {
259259
}
260260
}
261261

262-
/////////////////
263-
264262
fn foo() { }
265263
fn foo3(_: i32, _: (), _: ()) { }
266264
fn qux(_: i32) { }

src/test/ui/associated-type/associated-type-projection-from-supertrait.rs

-8
Original file line numberDiff line numberDiff line change
@@ -12,30 +12,22 @@ pub trait Car : Vehicle {
1212
fn chip_paint(&self, c: Self::Color) { }
1313
}
1414

15-
///////////////////////////////////////////////////////////////////////////
16-
1715
struct Black;
1816
struct ModelT;
1917
impl Vehicle for ModelT { type Color = Black; }
2018
impl Car for ModelT { }
2119

22-
///////////////////////////////////////////////////////////////////////////
23-
2420
struct Blue;
2521
struct ModelU;
2622
impl Vehicle for ModelU { type Color = Blue; }
2723
impl Car for ModelU { }
2824

29-
///////////////////////////////////////////////////////////////////////////
30-
3125
fn dent<C:Car>(c: C, color: C::Color) { c.chip_paint(color) }
3226
fn a() { dent(ModelT, Black); }
3327
fn b() { dent(ModelT, Blue); } //~ ERROR mismatched types
3428
fn c() { dent(ModelU, Black); } //~ ERROR mismatched types
3529
fn d() { dent(ModelU, Blue); }
3630

37-
///////////////////////////////////////////////////////////////////////////
38-
3931
fn e() { ModelT.chip_paint(Black); }
4032
fn f() { ModelT.chip_paint(Blue); } //~ ERROR mismatched types
4133
fn g() { ModelU.chip_paint(Black); } //~ ERROR mismatched types

src/test/ui/associated-type/associated-type-projection-from-supertrait.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0308]: mismatched types
2-
--> $DIR/associated-type-projection-from-supertrait.rs:33:23
2+
--> $DIR/associated-type-projection-from-supertrait.rs:27:23
33
|
44
LL | fn b() { dent(ModelT, Blue); }
55
| ^^^^ expected struct `Black`, found struct `Blue`
@@ -8,7 +8,7 @@ LL | fn b() { dent(ModelT, Blue); }
88
found type `Blue`
99

1010
error[E0308]: mismatched types
11-
--> $DIR/associated-type-projection-from-supertrait.rs:34:23
11+
--> $DIR/associated-type-projection-from-supertrait.rs:28:23
1212
|
1313
LL | fn c() { dent(ModelU, Black); }
1414
| ^^^^^ expected struct `Blue`, found struct `Black`
@@ -17,7 +17,7 @@ LL | fn c() { dent(ModelU, Black); }
1717
found type `Black`
1818

1919
error[E0308]: mismatched types
20-
--> $DIR/associated-type-projection-from-supertrait.rs:40:28
20+
--> $DIR/associated-type-projection-from-supertrait.rs:32:28
2121
|
2222
LL | fn f() { ModelT.chip_paint(Blue); }
2323
| ^^^^ expected struct `Black`, found struct `Blue`
@@ -26,7 +26,7 @@ LL | fn f() { ModelT.chip_paint(Blue); }
2626
found type `Blue`
2727

2828
error[E0308]: mismatched types
29-
--> $DIR/associated-type-projection-from-supertrait.rs:41:28
29+
--> $DIR/associated-type-projection-from-supertrait.rs:33:28
3030
|
3131
LL | fn g() { ModelU.chip_paint(Black); }
3232
| ^^^^^ expected struct `Blue`, found struct `Black`

src/test/ui/associated-types/associated-types-binding-to-type-defined-in-supertrait.rs

-6
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,16 @@ pub trait Car : Vehicle {
1111
fn honk(&self) { }
1212
}
1313

14-
///////////////////////////////////////////////////////////////////////////
15-
1614
struct Black;
1715
struct ModelT;
1816
impl Vehicle for ModelT { type Color = Black; }
1917
impl Car for ModelT { }
2018

21-
///////////////////////////////////////////////////////////////////////////
22-
2319
struct Blue;
2420
struct ModelU;
2521
impl Vehicle for ModelU { type Color = Blue; }
2622
impl Car for ModelU { }
2723

28-
///////////////////////////////////////////////////////////////////////////
29-
3024
fn black_car<C:Car<Color=Black>>(c: C) {
3125
}
3226

src/test/ui/associated-types/associated-types-binding-to-type-defined-in-supertrait.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
error[E0271]: type mismatch resolving `<ModelT as Vehicle>::Color == Blue`
2-
--> $DIR/associated-types-binding-to-type-defined-in-supertrait.rs:37:10
2+
--> $DIR/associated-types-binding-to-type-defined-in-supertrait.rs:31:10
33
|
44
LL | fn b() { blue_car(ModelT); }
55
| ^^^^^^^^ expected struct `Black`, found struct `Blue`
66
|
77
= note: expected type `Black`
88
found type `Blue`
99
note: required by `blue_car`
10-
--> $DIR/associated-types-binding-to-type-defined-in-supertrait.rs:33:1
10+
--> $DIR/associated-types-binding-to-type-defined-in-supertrait.rs:27:1
1111
|
1212
LL | fn blue_car<C:Car<Color=Blue>>(c: C) {
1313
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1414

1515
error[E0271]: type mismatch resolving `<ModelU as Vehicle>::Color == Black`
16-
--> $DIR/associated-types-binding-to-type-defined-in-supertrait.rs:38:10
16+
--> $DIR/associated-types-binding-to-type-defined-in-supertrait.rs:32:10
1717
|
1818
LL | fn c() { black_car(ModelU); }
1919
| ^^^^^^^^^ expected struct `Blue`, found struct `Black`
2020
|
2121
= note: expected type `Blue`
2222
found type `Black`
2323
note: required by `black_car`
24-
--> $DIR/associated-types-binding-to-type-defined-in-supertrait.rs:30:1
24+
--> $DIR/associated-types-binding-to-type-defined-in-supertrait.rs:24:1
2525
|
2626
LL | fn black_car<C:Car<Color=Black>>(c: C) {
2727
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/test/ui/associated-types/associated-types-ref-from-struct.rs

-4
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ trait Test {
99
fn test(&self, value: &Self::V) -> bool;
1010
}
1111

12-
///////////////////////////////////////////////////////////////////////////
13-
1412
struct TesterPair<T:Test> {
1513
tester: T,
1614
value: T::V,
@@ -26,8 +24,6 @@ impl<T:Test> TesterPair<T> {
2624
}
2725
}
2826

29-
///////////////////////////////////////////////////////////////////////////
30-
3127
struct EqU32(u32);
3228
impl Test for EqU32 {
3329
type V = u32;

src/test/ui/higher-rank-trait-bounds/hrtb-type-outlives.rs

-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ fn want_foo<T>()
1414
{
1515
}
1616

17-
///////////////////////////////////////////////////////////////////////////
1817
// Expressed as a where clause
1918

2019
struct SomeStruct<X> {
@@ -30,7 +29,6 @@ fn one() {
3029
want_foo::<SomeStruct<usize>>();
3130
}
3231

33-
///////////////////////////////////////////////////////////////////////////
3432
// Expressed as shorthand
3533

3634
struct AnotherStruct<X> {

src/test/ui/hrtb/hrtb-conflate-regions.rs

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ fn want_foo1<T>()
1515
{
1616
}
1717

18-
///////////////////////////////////////////////////////////////////////////
1918
// Expressed as a where clause
2019

2120
struct SomeStruct;

src/test/ui/hrtb/hrtb-conflate-regions.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0277]: the trait bound `for<'a, 'b> SomeStruct: Foo<(&'a isize, &'b isize)>` is not satisfied
2-
--> $DIR/hrtb-conflate-regions.rs:28:10
2+
--> $DIR/hrtb-conflate-regions.rs:27:10
33
|
44
LL | fn b() { want_foo2::<SomeStruct>(); }
55
| ^^^^^^^^^^^^^^^^^^^^^^^ the trait `for<'a, 'b> Foo<(&'a isize, &'b isize)>` is not implemented for `SomeStruct`

src/test/ui/impl-trait/bound-normalization-fail.rs

-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
// See issue 60414
1010

11-
/////////////////////////////////////////////
1211
// Reduction to `impl Trait`
1312

1413
struct Foo<T>(T);
@@ -33,7 +32,6 @@ mod impl_trait {
3332
}
3433
}
3534

36-
/////////////////////////////////////////////
3735
// Same with lifetimes in the trait
3836

3937
mod lifetimes {

src/test/ui/impl-trait/bound-normalization-fail.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ LL | #![feature(impl_trait_in_bindings)]
77
= note: `#[warn(incomplete_features)]` on by default
88

99
error[E0271]: type mismatch resolving `<Foo<()> as FooLike>::Output == <T as impl_trait::Trait>::Assoc`
10-
--> $DIR/bound-normalization-fail.rs:30:32
10+
--> $DIR/bound-normalization-fail.rs:29:32
1111
|
1212
LL | fn foo_fail<T: Trait>() -> impl FooLike<Output=T::Assoc> {
1313
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found associated type
@@ -17,13 +17,13 @@ LL | fn foo_fail<T: Trait>() -> impl FooLike<Output=T::Assoc> {
1717
= note: the return type of a function must have a statically known size
1818

1919
error: `impl Trait` return type cannot contain a projection or `Self` that references lifetimes from a parent scope
20-
--> $DIR/bound-normalization-fail.rs:47:41
20+
--> $DIR/bound-normalization-fail.rs:45:41
2121
|
2222
LL | fn foo2_fail<'a, T: Trait<'a>>() -> impl FooLike<Output=T::Assoc> {
2323
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2424

2525
error[E0271]: type mismatch resolving `<Foo<()> as FooLike>::Output == <T as lifetimes::Trait<'static>>::Assoc`
26-
--> $DIR/bound-normalization-fail.rs:47:41
26+
--> $DIR/bound-normalization-fail.rs:45:41
2727
|
2828
LL | fn foo2_fail<'a, T: Trait<'a>>() -> impl FooLike<Output=T::Assoc> {
2929
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found associated type

src/test/ui/impl-trait/bound-normalization-pass.rs

-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
// See issue 60414
1010

11-
/////////////////////////////////////////////
1211
// Reduction to `impl Trait`
1312

1413
struct Foo<T>(T);
@@ -32,7 +31,6 @@ mod impl_trait {
3231
}
3332
}
3433

35-
/////////////////////////////////////////////
3634
// Same with lifetimes in the trait
3735

3836
mod lifetimes {
@@ -59,7 +57,6 @@ mod lifetimes {
5957
}
6058
}
6159

62-
/////////////////////////////////////////////
6360
// Reduction using `impl Trait` in bindings
6461

6562
mod impl_trait_in_bindings {
@@ -80,7 +77,6 @@ mod impl_trait_in_bindings {
8077
}
8178
}
8279

83-
/////////////////////////////////////////////
8480
// The same applied to `type Foo = impl Bar`s
8581

8682
mod opaque_types {

src/test/ui/issues/issue-12028.rs

-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ trait StreamHasher {
1717
fn stream(&self) -> Self::S;
1818
}
1919

20-
//////////////////////////////////////////////////////////////////////////////
21-
2220
trait StreamHash<H: StreamHasher>: Hash<H> {
2321
fn input_stream(&self, stream: &mut H::S);
2422
}

src/test/ui/issues/issue-12028.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0284]: type annotations required: cannot resolve `<_ as StreamHasher>::S == <H as StreamHasher>::S`
2-
--> $DIR/issue-12028.rs:29:14
2+
--> $DIR/issue-12028.rs:27:14
33
|
44
LL | self.input_stream(&mut stream);
55
| ^^^^^^^^^^^^

src/test/ui/issues/issue-16739.rs

-4
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ impl FnOnce<()> for Foo {
1616
extern "rust-call" fn call_once(mut self, _: ()) -> u32 { self.call_mut(()) }
1717
}
1818

19-
/////////////////////////////////////////////////////////////////////////
20-
2119
impl FnMut<(u32,)> for Foo {
2220
extern "rust-call" fn call_mut(&mut self, (x,): (u32,)) -> u32 { self.foo + x }
2321
}
@@ -27,8 +25,6 @@ impl FnOnce<(u32,)> for Foo {
2725
extern "rust-call" fn call_once(mut self, args: (u32,)) -> u32 { self.call_mut(args) }
2826
}
2927

30-
/////////////////////////////////////////////////////////////////////////
31-
3228
impl FnMut<(u32,u32)> for Foo {
3329
extern "rust-call" fn call_mut(&mut self, (x, y): (u32, u32)) -> u32 { self.foo + x + y }
3430
}

src/test/ui/methods/method-projection.rs

-9
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
// Test that we can use method notation to call methods based on a
33
// projection bound from a trait. Issue #20469.
44

5-
///////////////////////////////////////////////////////////////////////////
6-
7-
85
trait MakeString {
96
fn make_string(&self) -> String;
107
}
@@ -21,8 +18,6 @@ impl MakeString for usize {
2118
}
2219
}
2320

24-
///////////////////////////////////////////////////////////////////////////
25-
2621
trait Foo {
2722
type F: MakeString;
2823

@@ -33,8 +28,6 @@ fn foo<F:Foo>(f: &F) -> String {
3328
f.get().make_string()
3429
}
3530

36-
///////////////////////////////////////////////////////////////////////////
37-
3831
struct SomeStruct {
3932
field: isize,
4033
}
@@ -47,8 +40,6 @@ impl Foo for SomeStruct {
4740
}
4841
}
4942

50-
///////////////////////////////////////////////////////////////////////////
51-
5243
struct SomeOtherStruct {
5344
field: usize,
5445
}

src/test/ui/regions/regions-outlives-projection-container-hrtb.migrate.nll.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: lifetime may not live long enough
2-
--> $DIR/regions-outlives-projection-container-hrtb.rs:35:12
2+
--> $DIR/regions-outlives-projection-container-hrtb.rs:30:12
33
|
44
LL | fn with_assoc<'a,'b>() {
55
| -- -- lifetime `'b` defined here
@@ -10,7 +10,7 @@ LL | let _: &'a WithHrAssoc<TheType<'b>> = loop { };
1010
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'b` must outlive `'a`
1111

1212
error: lifetime may not live long enough
13-
--> $DIR/regions-outlives-projection-container-hrtb.rs:57:12
13+
--> $DIR/regions-outlives-projection-container-hrtb.rs:50:12
1414
|
1515
LL | fn with_assoc_sub<'a,'b>() {
1616
| -- -- lifetime `'b` defined here

src/test/ui/regions/regions-outlives-projection-container-hrtb.migrate.stderr

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
error[E0491]: in type `&'a WithHrAssoc<TheType<'b>>`, reference has a longer lifetime than the data it references
2-
--> $DIR/regions-outlives-projection-container-hrtb.rs:35:12
2+
--> $DIR/regions-outlives-projection-container-hrtb.rs:30:12
33
|
44
LL | let _: &'a WithHrAssoc<TheType<'b>> = loop { };
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
7-
note: the pointer is valid for the lifetime 'a as defined on the function body at 32:15
8-
--> $DIR/regions-outlives-projection-container-hrtb.rs:32:15
7+
note: the pointer is valid for the lifetime 'a as defined on the function body at 27:15
8+
--> $DIR/regions-outlives-projection-container-hrtb.rs:27:15
99
|
1010
LL | fn with_assoc<'a,'b>() {
1111
| ^^
12-
note: but the referenced data is only valid for the lifetime 'b as defined on the function body at 32:18
13-
--> $DIR/regions-outlives-projection-container-hrtb.rs:32:18
12+
note: but the referenced data is only valid for the lifetime 'b as defined on the function body at 27:18
13+
--> $DIR/regions-outlives-projection-container-hrtb.rs:27:18
1414
|
1515
LL | fn with_assoc<'a,'b>() {
1616
| ^^
1717

1818
error[E0491]: in type `&'a WithHrAssocSub<TheType<'b>>`, reference has a longer lifetime than the data it references
19-
--> $DIR/regions-outlives-projection-container-hrtb.rs:57:12
19+
--> $DIR/regions-outlives-projection-container-hrtb.rs:50:12
2020
|
2121
LL | let _: &'a WithHrAssocSub<TheType<'b>> = loop { };
2222
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2323
|
24-
note: the pointer is valid for the lifetime 'a as defined on the function body at 53:19
25-
--> $DIR/regions-outlives-projection-container-hrtb.rs:53:19
24+
note: the pointer is valid for the lifetime 'a as defined on the function body at 46:19
25+
--> $DIR/regions-outlives-projection-container-hrtb.rs:46:19
2626
|
2727
LL | fn with_assoc_sub<'a,'b>() {
2828
| ^^
29-
note: but the referenced data is only valid for the lifetime 'b as defined on the function body at 53:22
30-
--> $DIR/regions-outlives-projection-container-hrtb.rs:53:22
29+
note: but the referenced data is only valid for the lifetime 'b as defined on the function body at 46:22
30+
--> $DIR/regions-outlives-projection-container-hrtb.rs:46:22
3131
|
3232
LL | fn with_assoc_sub<'a,'b>() {
3333
| ^^

src/test/ui/regions/regions-outlives-projection-container-hrtb.nll.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: lifetime may not live long enough
2-
--> $DIR/regions-outlives-projection-container-hrtb.rs:35:12
2+
--> $DIR/regions-outlives-projection-container-hrtb.rs:30:12
33
|
44
LL | fn with_assoc<'a,'b>() {
55
| -- -- lifetime `'b` defined here
@@ -10,7 +10,7 @@ LL | let _: &'a WithHrAssoc<TheType<'b>> = loop { };
1010
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'b` must outlive `'a`
1111

1212
error: lifetime may not live long enough
13-
--> $DIR/regions-outlives-projection-container-hrtb.rs:57:12
13+
--> $DIR/regions-outlives-projection-container-hrtb.rs:50:12
1414
|
1515
LL | fn with_assoc_sub<'a,'b>() {
1616
| -- -- lifetime `'b` defined here

0 commit comments

Comments
 (0)