Rollup merge of #63487 - sd234678:remove-meaningless-comments-in-src/test-2, r=Centril
Remove meaningless comments in src/test
Moved from #63411
diff --git a/src/test/pretty/stmt_expr_attributes.rs b/src/test/pretty/stmt_expr_attributes.rs
index 02d9323..619cce6 100644
--- a/src/test/pretty/stmt_expr_attributes.rs
+++ b/src/test/pretty/stmt_expr_attributes.rs
@@ -259,8 +259,6 @@
}
}
-/////////////////
-
fn foo() { }
fn foo3(_: i32, _: (), _: ()) { }
fn qux(_: i32) { }
diff --git a/src/test/ui/associated-type/associated-type-projection-from-supertrait.rs b/src/test/ui/associated-type/associated-type-projection-from-supertrait.rs
index 06dfe49..7e05bcd 100644
--- a/src/test/ui/associated-type/associated-type-projection-from-supertrait.rs
+++ b/src/test/ui/associated-type/associated-type-projection-from-supertrait.rs
@@ -12,30 +12,22 @@
fn chip_paint(&self, c: Self::Color) { }
}
-///////////////////////////////////////////////////////////////////////////
-
struct Black;
struct ModelT;
impl Vehicle for ModelT { type Color = Black; }
impl Car for ModelT { }
-///////////////////////////////////////////////////////////////////////////
-
struct Blue;
struct ModelU;
impl Vehicle for ModelU { type Color = Blue; }
impl Car for ModelU { }
-///////////////////////////////////////////////////////////////////////////
-
fn dent<C:Car>(c: C, color: C::Color) { c.chip_paint(color) }
fn a() { dent(ModelT, Black); }
fn b() { dent(ModelT, Blue); } //~ ERROR mismatched types
fn c() { dent(ModelU, Black); } //~ ERROR mismatched types
fn d() { dent(ModelU, Blue); }
-///////////////////////////////////////////////////////////////////////////
-
fn e() { ModelT.chip_paint(Black); }
fn f() { ModelT.chip_paint(Blue); } //~ ERROR mismatched types
fn g() { ModelU.chip_paint(Black); } //~ ERROR mismatched types
diff --git a/src/test/ui/associated-type/associated-type-projection-from-supertrait.stderr b/src/test/ui/associated-type/associated-type-projection-from-supertrait.stderr
index 06f1a1c..4ba4925 100644
--- a/src/test/ui/associated-type/associated-type-projection-from-supertrait.stderr
+++ b/src/test/ui/associated-type/associated-type-projection-from-supertrait.stderr
@@ -1,5 +1,5 @@
error[E0308]: mismatched types
- --> $DIR/associated-type-projection-from-supertrait.rs:33:23
+ --> $DIR/associated-type-projection-from-supertrait.rs:27:23
|
LL | fn b() { dent(ModelT, Blue); }
| ^^^^ expected struct `Black`, found struct `Blue`
@@ -8,7 +8,7 @@
found type `Blue`
error[E0308]: mismatched types
- --> $DIR/associated-type-projection-from-supertrait.rs:34:23
+ --> $DIR/associated-type-projection-from-supertrait.rs:28:23
|
LL | fn c() { dent(ModelU, Black); }
| ^^^^^ expected struct `Blue`, found struct `Black`
@@ -17,7 +17,7 @@
found type `Black`
error[E0308]: mismatched types
- --> $DIR/associated-type-projection-from-supertrait.rs:40:28
+ --> $DIR/associated-type-projection-from-supertrait.rs:32:28
|
LL | fn f() { ModelT.chip_paint(Blue); }
| ^^^^ expected struct `Black`, found struct `Blue`
@@ -26,7 +26,7 @@
found type `Blue`
error[E0308]: mismatched types
- --> $DIR/associated-type-projection-from-supertrait.rs:41:28
+ --> $DIR/associated-type-projection-from-supertrait.rs:33:28
|
LL | fn g() { ModelU.chip_paint(Black); }
| ^^^^^ expected struct `Blue`, found struct `Black`
diff --git a/src/test/ui/associated-types/associated-types-binding-to-type-defined-in-supertrait.rs b/src/test/ui/associated-types/associated-types-binding-to-type-defined-in-supertrait.rs
index 6531308..6b2bbbe 100644
--- a/src/test/ui/associated-types/associated-types-binding-to-type-defined-in-supertrait.rs
+++ b/src/test/ui/associated-types/associated-types-binding-to-type-defined-in-supertrait.rs
@@ -11,22 +11,16 @@
fn honk(&self) { }
}
-///////////////////////////////////////////////////////////////////////////
-
struct Black;
struct ModelT;
impl Vehicle for ModelT { type Color = Black; }
impl Car for ModelT { }
-///////////////////////////////////////////////////////////////////////////
-
struct Blue;
struct ModelU;
impl Vehicle for ModelU { type Color = Blue; }
impl Car for ModelU { }
-///////////////////////////////////////////////////////////////////////////
-
fn black_car<C:Car<Color=Black>>(c: C) {
}
diff --git a/src/test/ui/associated-types/associated-types-binding-to-type-defined-in-supertrait.stderr b/src/test/ui/associated-types/associated-types-binding-to-type-defined-in-supertrait.stderr
index 4b54860..89c48d5 100644
--- a/src/test/ui/associated-types/associated-types-binding-to-type-defined-in-supertrait.stderr
+++ b/src/test/ui/associated-types/associated-types-binding-to-type-defined-in-supertrait.stderr
@@ -1,5 +1,5 @@
error[E0271]: type mismatch resolving `<ModelT as Vehicle>::Color == Blue`
- --> $DIR/associated-types-binding-to-type-defined-in-supertrait.rs:37:10
+ --> $DIR/associated-types-binding-to-type-defined-in-supertrait.rs:31:10
|
LL | fn b() { blue_car(ModelT); }
| ^^^^^^^^ expected struct `Black`, found struct `Blue`
@@ -7,13 +7,13 @@
= note: expected type `Black`
found type `Blue`
note: required by `blue_car`
- --> $DIR/associated-types-binding-to-type-defined-in-supertrait.rs:33:1
+ --> $DIR/associated-types-binding-to-type-defined-in-supertrait.rs:27:1
|
LL | fn blue_car<C:Car<Color=Blue>>(c: C) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0271]: type mismatch resolving `<ModelU as Vehicle>::Color == Black`
- --> $DIR/associated-types-binding-to-type-defined-in-supertrait.rs:38:10
+ --> $DIR/associated-types-binding-to-type-defined-in-supertrait.rs:32:10
|
LL | fn c() { black_car(ModelU); }
| ^^^^^^^^^ expected struct `Blue`, found struct `Black`
@@ -21,7 +21,7 @@
= note: expected type `Blue`
found type `Black`
note: required by `black_car`
- --> $DIR/associated-types-binding-to-type-defined-in-supertrait.rs:30:1
+ --> $DIR/associated-types-binding-to-type-defined-in-supertrait.rs:24:1
|
LL | fn black_car<C:Car<Color=Black>>(c: C) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/test/ui/associated-types/associated-types-ref-from-struct.rs b/src/test/ui/associated-types/associated-types-ref-from-struct.rs
index 3ccba28..c89f604 100644
--- a/src/test/ui/associated-types/associated-types-ref-from-struct.rs
+++ b/src/test/ui/associated-types/associated-types-ref-from-struct.rs
@@ -9,8 +9,6 @@
fn test(&self, value: &Self::V) -> bool;
}
-///////////////////////////////////////////////////////////////////////////
-
struct TesterPair<T:Test> {
tester: T,
value: T::V,
@@ -26,8 +24,6 @@
}
}
-///////////////////////////////////////////////////////////////////////////
-
struct EqU32(u32);
impl Test for EqU32 {
type V = u32;
diff --git a/src/test/ui/higher-rank-trait-bounds/hrtb-type-outlives.rs b/src/test/ui/higher-rank-trait-bounds/hrtb-type-outlives.rs
index a8f3818..88d3961 100644
--- a/src/test/ui/higher-rank-trait-bounds/hrtb-type-outlives.rs
+++ b/src/test/ui/higher-rank-trait-bounds/hrtb-type-outlives.rs
@@ -14,7 +14,6 @@
{
}
-///////////////////////////////////////////////////////////////////////////
// Expressed as a where clause
struct SomeStruct<X> {
@@ -30,7 +29,6 @@
want_foo::<SomeStruct<usize>>();
}
-///////////////////////////////////////////////////////////////////////////
// Expressed as shorthand
struct AnotherStruct<X> {
diff --git a/src/test/ui/hrtb/hrtb-conflate-regions.rs b/src/test/ui/hrtb/hrtb-conflate-regions.rs
index 3913036..004d62a 100644
--- a/src/test/ui/hrtb/hrtb-conflate-regions.rs
+++ b/src/test/ui/hrtb/hrtb-conflate-regions.rs
@@ -15,7 +15,6 @@
{
}
-///////////////////////////////////////////////////////////////////////////
// Expressed as a where clause
struct SomeStruct;
diff --git a/src/test/ui/hrtb/hrtb-conflate-regions.stderr b/src/test/ui/hrtb/hrtb-conflate-regions.stderr
index 3fb6baa..20265d6 100644
--- a/src/test/ui/hrtb/hrtb-conflate-regions.stderr
+++ b/src/test/ui/hrtb/hrtb-conflate-regions.stderr
@@ -1,5 +1,5 @@
error[E0277]: the trait bound `for<'a, 'b> SomeStruct: Foo<(&'a isize, &'b isize)>` is not satisfied
- --> $DIR/hrtb-conflate-regions.rs:28:10
+ --> $DIR/hrtb-conflate-regions.rs:27:10
|
LL | fn b() { want_foo2::<SomeStruct>(); }
| ^^^^^^^^^^^^^^^^^^^^^^^ the trait `for<'a, 'b> Foo<(&'a isize, &'b isize)>` is not implemented for `SomeStruct`
diff --git a/src/test/ui/impl-trait/bound-normalization-fail.rs b/src/test/ui/impl-trait/bound-normalization-fail.rs
index 9ba7c91..ce15505 100644
--- a/src/test/ui/impl-trait/bound-normalization-fail.rs
+++ b/src/test/ui/impl-trait/bound-normalization-fail.rs
@@ -8,7 +8,6 @@
// See issue 60414
-/////////////////////////////////////////////
// Reduction to `impl Trait`
struct Foo<T>(T);
@@ -33,7 +32,6 @@
}
}
-/////////////////////////////////////////////
// Same with lifetimes in the trait
mod lifetimes {
diff --git a/src/test/ui/impl-trait/bound-normalization-fail.stderr b/src/test/ui/impl-trait/bound-normalization-fail.stderr
index b5c8e07..4811b1e 100644
--- a/src/test/ui/impl-trait/bound-normalization-fail.stderr
+++ b/src/test/ui/impl-trait/bound-normalization-fail.stderr
@@ -7,7 +7,7 @@
= note: `#[warn(incomplete_features)]` on by default
error[E0271]: type mismatch resolving `<Foo<()> as FooLike>::Output == <T as impl_trait::Trait>::Assoc`
- --> $DIR/bound-normalization-fail.rs:30:32
+ --> $DIR/bound-normalization-fail.rs:29:32
|
LL | fn foo_fail<T: Trait>() -> impl FooLike<Output=T::Assoc> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found associated type
@@ -17,13 +17,13 @@
= note: the return type of a function must have a statically known size
error: `impl Trait` return type cannot contain a projection or `Self` that references lifetimes from a parent scope
- --> $DIR/bound-normalization-fail.rs:47:41
+ --> $DIR/bound-normalization-fail.rs:45:41
|
LL | fn foo2_fail<'a, T: Trait<'a>>() -> impl FooLike<Output=T::Assoc> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0271]: type mismatch resolving `<Foo<()> as FooLike>::Output == <T as lifetimes::Trait<'static>>::Assoc`
- --> $DIR/bound-normalization-fail.rs:47:41
+ --> $DIR/bound-normalization-fail.rs:45:41
|
LL | fn foo2_fail<'a, T: Trait<'a>>() -> impl FooLike<Output=T::Assoc> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found associated type
diff --git a/src/test/ui/impl-trait/bound-normalization-pass.rs b/src/test/ui/impl-trait/bound-normalization-pass.rs
index 5b634e3..b0ed4be 100644
--- a/src/test/ui/impl-trait/bound-normalization-pass.rs
+++ b/src/test/ui/impl-trait/bound-normalization-pass.rs
@@ -8,7 +8,6 @@
// See issue 60414
-/////////////////////////////////////////////
// Reduction to `impl Trait`
struct Foo<T>(T);
@@ -32,7 +31,6 @@
}
}
-/////////////////////////////////////////////
// Same with lifetimes in the trait
mod lifetimes {
@@ -59,7 +57,6 @@
}
}
-/////////////////////////////////////////////
// Reduction using `impl Trait` in bindings
mod impl_trait_in_bindings {
@@ -80,7 +77,6 @@
}
}
-/////////////////////////////////////////////
// The same applied to `type Foo = impl Bar`s
mod opaque_types {
diff --git a/src/test/ui/issues/issue-12028.rs b/src/test/ui/issues/issue-12028.rs
index d553545..7c2b0d6 100644
--- a/src/test/ui/issues/issue-12028.rs
+++ b/src/test/ui/issues/issue-12028.rs
@@ -17,8 +17,6 @@
fn stream(&self) -> Self::S;
}
-//////////////////////////////////////////////////////////////////////////////
-
trait StreamHash<H: StreamHasher>: Hash<H> {
fn input_stream(&self, stream: &mut H::S);
}
diff --git a/src/test/ui/issues/issue-12028.stderr b/src/test/ui/issues/issue-12028.stderr
index 64694c7..24aa88c 100644
--- a/src/test/ui/issues/issue-12028.stderr
+++ b/src/test/ui/issues/issue-12028.stderr
@@ -1,5 +1,5 @@
error[E0284]: type annotations required: cannot resolve `<_ as StreamHasher>::S == <H as StreamHasher>::S`
- --> $DIR/issue-12028.rs:29:14
+ --> $DIR/issue-12028.rs:27:14
|
LL | self.input_stream(&mut stream);
| ^^^^^^^^^^^^
diff --git a/src/test/ui/issues/issue-16739.rs b/src/test/ui/issues/issue-16739.rs
index 54ad8fd..94da2ca 100644
--- a/src/test/ui/issues/issue-16739.rs
+++ b/src/test/ui/issues/issue-16739.rs
@@ -16,8 +16,6 @@
extern "rust-call" fn call_once(mut self, _: ()) -> u32 { self.call_mut(()) }
}
-/////////////////////////////////////////////////////////////////////////
-
impl FnMut<(u32,)> for Foo {
extern "rust-call" fn call_mut(&mut self, (x,): (u32,)) -> u32 { self.foo + x }
}
@@ -27,8 +25,6 @@
extern "rust-call" fn call_once(mut self, args: (u32,)) -> u32 { self.call_mut(args) }
}
-/////////////////////////////////////////////////////////////////////////
-
impl FnMut<(u32,u32)> for Foo {
extern "rust-call" fn call_mut(&mut self, (x, y): (u32, u32)) -> u32 { self.foo + x + y }
}
diff --git a/src/test/ui/methods/method-projection.rs b/src/test/ui/methods/method-projection.rs
index cf33d53..21d983f 100644
--- a/src/test/ui/methods/method-projection.rs
+++ b/src/test/ui/methods/method-projection.rs
@@ -2,9 +2,6 @@
// Test that we can use method notation to call methods based on a
// projection bound from a trait. Issue #20469.
-///////////////////////////////////////////////////////////////////////////
-
-
trait MakeString {
fn make_string(&self) -> String;
}
@@ -21,8 +18,6 @@
}
}
-///////////////////////////////////////////////////////////////////////////
-
trait Foo {
type F: MakeString;
@@ -33,8 +28,6 @@
f.get().make_string()
}
-///////////////////////////////////////////////////////////////////////////
-
struct SomeStruct {
field: isize,
}
@@ -47,8 +40,6 @@
}
}
-///////////////////////////////////////////////////////////////////////////
-
struct SomeOtherStruct {
field: usize,
}
diff --git a/src/test/ui/regions/regions-outlives-projection-container-hrtb.migrate.nll.stderr b/src/test/ui/regions/regions-outlives-projection-container-hrtb.migrate.nll.stderr
index 5028663..eed9934 100644
--- a/src/test/ui/regions/regions-outlives-projection-container-hrtb.migrate.nll.stderr
+++ b/src/test/ui/regions/regions-outlives-projection-container-hrtb.migrate.nll.stderr
@@ -1,5 +1,5 @@
error: lifetime may not live long enough
- --> $DIR/regions-outlives-projection-container-hrtb.rs:35:12
+ --> $DIR/regions-outlives-projection-container-hrtb.rs:30:12
|
LL | fn with_assoc<'a,'b>() {
| -- -- lifetime `'b` defined here
@@ -10,7 +10,7 @@
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'b` must outlive `'a`
error: lifetime may not live long enough
- --> $DIR/regions-outlives-projection-container-hrtb.rs:57:12
+ --> $DIR/regions-outlives-projection-container-hrtb.rs:50:12
|
LL | fn with_assoc_sub<'a,'b>() {
| -- -- lifetime `'b` defined here
diff --git a/src/test/ui/regions/regions-outlives-projection-container-hrtb.migrate.stderr b/src/test/ui/regions/regions-outlives-projection-container-hrtb.migrate.stderr
index d833018..ed58009 100644
--- a/src/test/ui/regions/regions-outlives-projection-container-hrtb.migrate.stderr
+++ b/src/test/ui/regions/regions-outlives-projection-container-hrtb.migrate.stderr
@@ -1,33 +1,33 @@
error[E0491]: in type `&'a WithHrAssoc<TheType<'b>>`, reference has a longer lifetime than the data it references
- --> $DIR/regions-outlives-projection-container-hrtb.rs:35:12
+ --> $DIR/regions-outlives-projection-container-hrtb.rs:30:12
|
LL | let _: &'a WithHrAssoc<TheType<'b>> = loop { };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
-note: the pointer is valid for the lifetime 'a as defined on the function body at 32:15
- --> $DIR/regions-outlives-projection-container-hrtb.rs:32:15
+note: the pointer is valid for the lifetime 'a as defined on the function body at 27:15
+ --> $DIR/regions-outlives-projection-container-hrtb.rs:27:15
|
LL | fn with_assoc<'a,'b>() {
| ^^
-note: but the referenced data is only valid for the lifetime 'b as defined on the function body at 32:18
- --> $DIR/regions-outlives-projection-container-hrtb.rs:32:18
+note: but the referenced data is only valid for the lifetime 'b as defined on the function body at 27:18
+ --> $DIR/regions-outlives-projection-container-hrtb.rs:27:18
|
LL | fn with_assoc<'a,'b>() {
| ^^
error[E0491]: in type `&'a WithHrAssocSub<TheType<'b>>`, reference has a longer lifetime than the data it references
- --> $DIR/regions-outlives-projection-container-hrtb.rs:57:12
+ --> $DIR/regions-outlives-projection-container-hrtb.rs:50:12
|
LL | let _: &'a WithHrAssocSub<TheType<'b>> = loop { };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
-note: the pointer is valid for the lifetime 'a as defined on the function body at 53:19
- --> $DIR/regions-outlives-projection-container-hrtb.rs:53:19
+note: the pointer is valid for the lifetime 'a as defined on the function body at 46:19
+ --> $DIR/regions-outlives-projection-container-hrtb.rs:46:19
|
LL | fn with_assoc_sub<'a,'b>() {
| ^^
-note: but the referenced data is only valid for the lifetime 'b as defined on the function body at 53:22
- --> $DIR/regions-outlives-projection-container-hrtb.rs:53:22
+note: but the referenced data is only valid for the lifetime 'b as defined on the function body at 46:22
+ --> $DIR/regions-outlives-projection-container-hrtb.rs:46:22
|
LL | fn with_assoc_sub<'a,'b>() {
| ^^
diff --git a/src/test/ui/regions/regions-outlives-projection-container-hrtb.nll.stderr b/src/test/ui/regions/regions-outlives-projection-container-hrtb.nll.stderr
index 5028663..eed9934 100644
--- a/src/test/ui/regions/regions-outlives-projection-container-hrtb.nll.stderr
+++ b/src/test/ui/regions/regions-outlives-projection-container-hrtb.nll.stderr
@@ -1,5 +1,5 @@
error: lifetime may not live long enough
- --> $DIR/regions-outlives-projection-container-hrtb.rs:35:12
+ --> $DIR/regions-outlives-projection-container-hrtb.rs:30:12
|
LL | fn with_assoc<'a,'b>() {
| -- -- lifetime `'b` defined here
@@ -10,7 +10,7 @@
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'b` must outlive `'a`
error: lifetime may not live long enough
- --> $DIR/regions-outlives-projection-container-hrtb.rs:57:12
+ --> $DIR/regions-outlives-projection-container-hrtb.rs:50:12
|
LL | fn with_assoc_sub<'a,'b>() {
| -- -- lifetime `'b` defined here
diff --git a/src/test/ui/regions/regions-outlives-projection-container-hrtb.rs b/src/test/ui/regions/regions-outlives-projection-container-hrtb.rs
index 407a4fd..cee7411 100644
--- a/src/test/ui/regions/regions-outlives-projection-container-hrtb.rs
+++ b/src/test/ui/regions/regions-outlives-projection-container-hrtb.rs
@@ -6,9 +6,6 @@
#![allow(dead_code)]
-
-///////////////////////////////////////////////////////////////////////////
-
pub trait TheTrait<'b> {
type TheAssocType;
}
@@ -21,8 +18,6 @@
type TheAssocType = &'b ();
}
-///////////////////////////////////////////////////////////////////////////
-
pub struct WithHrAssoc<T>
where for<'a> T : TheTrait<'a>
{
@@ -37,8 +32,6 @@
//[nll]~^^ ERROR lifetime may not live long enough
}
-///////////////////////////////////////////////////////////////////////////
-
pub trait TheSubTrait : for<'a> TheTrait<'a> {
}
diff --git a/src/test/ui/regions/regions-outlives-projection-container-wc.migrate.nll.stderr b/src/test/ui/regions/regions-outlives-projection-container-wc.migrate.nll.stderr
index 880fe17..8c54d8d 100644
--- a/src/test/ui/regions/regions-outlives-projection-container-wc.migrate.nll.stderr
+++ b/src/test/ui/regions/regions-outlives-projection-container-wc.migrate.nll.stderr
@@ -1,5 +1,5 @@
error: lifetime may not live long enough
- --> $DIR/regions-outlives-projection-container-wc.rs:37:12
+ --> $DIR/regions-outlives-projection-container-wc.rs:33:12
|
LL | fn with_assoc<'a,'b>() {
| -- -- lifetime `'b` defined here
diff --git a/src/test/ui/regions/regions-outlives-projection-container-wc.migrate.stderr b/src/test/ui/regions/regions-outlives-projection-container-wc.migrate.stderr
index 9e31065..152e6c5 100644
--- a/src/test/ui/regions/regions-outlives-projection-container-wc.migrate.stderr
+++ b/src/test/ui/regions/regions-outlives-projection-container-wc.migrate.stderr
@@ -1,16 +1,16 @@
error[E0491]: in type `&'a WithAssoc<TheType<'b>>`, reference has a longer lifetime than the data it references
- --> $DIR/regions-outlives-projection-container-wc.rs:37:12
+ --> $DIR/regions-outlives-projection-container-wc.rs:33:12
|
LL | let _: &'a WithAssoc<TheType<'b>> = loop { };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
-note: the pointer is valid for the lifetime 'a as defined on the function body at 31:15
- --> $DIR/regions-outlives-projection-container-wc.rs:31:15
+note: the pointer is valid for the lifetime 'a as defined on the function body at 27:15
+ --> $DIR/regions-outlives-projection-container-wc.rs:27:15
|
LL | fn with_assoc<'a,'b>() {
| ^^
-note: but the referenced data is only valid for the lifetime 'b as defined on the function body at 31:18
- --> $DIR/regions-outlives-projection-container-wc.rs:31:18
+note: but the referenced data is only valid for the lifetime 'b as defined on the function body at 27:18
+ --> $DIR/regions-outlives-projection-container-wc.rs:27:18
|
LL | fn with_assoc<'a,'b>() {
| ^^
diff --git a/src/test/ui/regions/regions-outlives-projection-container-wc.nll.stderr b/src/test/ui/regions/regions-outlives-projection-container-wc.nll.stderr
index 880fe17..8c54d8d 100644
--- a/src/test/ui/regions/regions-outlives-projection-container-wc.nll.stderr
+++ b/src/test/ui/regions/regions-outlives-projection-container-wc.nll.stderr
@@ -1,5 +1,5 @@
error: lifetime may not live long enough
- --> $DIR/regions-outlives-projection-container-wc.rs:37:12
+ --> $DIR/regions-outlives-projection-container-wc.rs:33:12
|
LL | fn with_assoc<'a,'b>() {
| -- -- lifetime `'b` defined here
diff --git a/src/test/ui/regions/regions-outlives-projection-container-wc.rs b/src/test/ui/regions/regions-outlives-projection-container-wc.rs
index 5037ea5..99965f3 100644
--- a/src/test/ui/regions/regions-outlives-projection-container-wc.rs
+++ b/src/test/ui/regions/regions-outlives-projection-container-wc.rs
@@ -8,8 +8,6 @@
#![allow(dead_code)]
-///////////////////////////////////////////////////////////////////////////
-
pub trait TheTrait {
type TheAssocType;
}
@@ -22,8 +20,6 @@
type TheAssocType = &'b ();
}
-///////////////////////////////////////////////////////////////////////////
-
pub struct WithAssoc<T> where T : TheTrait {
m: [T; 0]
}
diff --git a/src/test/ui/regions/regions-outlives-projection-container.nll.stderr b/src/test/ui/regions/regions-outlives-projection-container.nll.stderr
index ef87d02..2cf6e24 100644
--- a/src/test/ui/regions/regions-outlives-projection-container.nll.stderr
+++ b/src/test/ui/regions/regions-outlives-projection-container.nll.stderr
@@ -1,5 +1,5 @@
error: lifetime may not live long enough
- --> $DIR/regions-outlives-projection-container.rs:40:13
+ --> $DIR/regions-outlives-projection-container.rs:36:13
|
LL | fn with_assoc<'a,'b>() {
| -- -- lifetime `'b` defined here
@@ -10,7 +10,7 @@
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'b` must outlive `'a`
error: lifetime may not live long enough
- --> $DIR/regions-outlives-projection-container.rs:58:13
+ --> $DIR/regions-outlives-projection-container.rs:54:13
|
LL | fn without_assoc<'a,'b>() {
| -- -- lifetime `'b` defined here
@@ -21,7 +21,7 @@
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'b` must outlive `'a`
error: lifetime may not live long enough
- --> $DIR/regions-outlives-projection-container.rs:67:5
+ --> $DIR/regions-outlives-projection-container.rs:63:5
|
LL | fn call_with_assoc<'a,'b>() {
| -- -- lifetime `'b` defined here
@@ -32,7 +32,7 @@
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'b` must outlive `'a`
error: lifetime may not live long enough
- --> $DIR/regions-outlives-projection-container.rs:74:5
+ --> $DIR/regions-outlives-projection-container.rs:70:5
|
LL | fn call_without_assoc<'a,'b>() {
| -- -- lifetime `'b` defined here
diff --git a/src/test/ui/regions/regions-outlives-projection-container.rs b/src/test/ui/regions/regions-outlives-projection-container.rs
index 78305c0..3afc600 100644
--- a/src/test/ui/regions/regions-outlives-projection-container.rs
+++ b/src/test/ui/regions/regions-outlives-projection-container.rs
@@ -5,8 +5,6 @@
#![allow(dead_code)]
#![feature(rustc_attrs)]
-///////////////////////////////////////////////////////////////////////////
-
pub trait TheTrait {
type TheAssocType;
}
@@ -19,8 +17,6 @@
type TheAssocType = &'b ();
}
-///////////////////////////////////////////////////////////////////////////
-
pub struct WithAssoc<T:TheTrait> {
m: [T; 0]
}
diff --git a/src/test/ui/regions/regions-outlives-projection-container.stderr b/src/test/ui/regions/regions-outlives-projection-container.stderr
index b50347a..3c1a98a 100644
--- a/src/test/ui/regions/regions-outlives-projection-container.stderr
+++ b/src/test/ui/regions/regions-outlives-projection-container.stderr
@@ -1,67 +1,67 @@
error[E0491]: in type `&'a WithAssoc<TheType<'b>>`, reference has a longer lifetime than the data it references
- --> $DIR/regions-outlives-projection-container.rs:40:13
+ --> $DIR/regions-outlives-projection-container.rs:36:13
|
LL | let _x: &'a WithAssoc<TheType<'b>> = loop { };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
-note: the pointer is valid for the lifetime 'a as defined on the function body at 32:15
- --> $DIR/regions-outlives-projection-container.rs:32:15
+note: the pointer is valid for the lifetime 'a as defined on the function body at 28:15
+ --> $DIR/regions-outlives-projection-container.rs:28:15
|
LL | fn with_assoc<'a,'b>() {
| ^^
-note: but the referenced data is only valid for the lifetime 'b as defined on the function body at 32:18
- --> $DIR/regions-outlives-projection-container.rs:32:18
+note: but the referenced data is only valid for the lifetime 'b as defined on the function body at 28:18
+ --> $DIR/regions-outlives-projection-container.rs:28:18
|
LL | fn with_assoc<'a,'b>() {
| ^^
error[E0491]: in type `&'a WithoutAssoc<TheType<'b>>`, reference has a longer lifetime than the data it references
- --> $DIR/regions-outlives-projection-container.rs:58:13
+ --> $DIR/regions-outlives-projection-container.rs:54:13
|
LL | let _x: &'a WithoutAssoc<TheType<'b>> = loop { };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
-note: the pointer is valid for the lifetime 'a as defined on the function body at 54:18
- --> $DIR/regions-outlives-projection-container.rs:54:18
+note: the pointer is valid for the lifetime 'a as defined on the function body at 50:18
+ --> $DIR/regions-outlives-projection-container.rs:50:18
|
LL | fn without_assoc<'a,'b>() {
| ^^
-note: but the referenced data is only valid for the lifetime 'b as defined on the function body at 54:21
- --> $DIR/regions-outlives-projection-container.rs:54:21
+note: but the referenced data is only valid for the lifetime 'b as defined on the function body at 50:21
+ --> $DIR/regions-outlives-projection-container.rs:50:21
|
LL | fn without_assoc<'a,'b>() {
| ^^
error[E0491]: in type `&'a WithAssoc<TheType<'b>>`, reference has a longer lifetime than the data it references
- --> $DIR/regions-outlives-projection-container.rs:67:12
+ --> $DIR/regions-outlives-projection-container.rs:63:12
|
LL | call::<&'a WithAssoc<TheType<'b>>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
-note: the pointer is valid for the lifetime 'a as defined on the function body at 62:20
- --> $DIR/regions-outlives-projection-container.rs:62:20
+note: the pointer is valid for the lifetime 'a as defined on the function body at 58:20
+ --> $DIR/regions-outlives-projection-container.rs:58:20
|
LL | fn call_with_assoc<'a,'b>() {
| ^^
-note: but the referenced data is only valid for the lifetime 'b as defined on the function body at 62:23
- --> $DIR/regions-outlives-projection-container.rs:62:23
+note: but the referenced data is only valid for the lifetime 'b as defined on the function body at 58:23
+ --> $DIR/regions-outlives-projection-container.rs:58:23
|
LL | fn call_with_assoc<'a,'b>() {
| ^^
error[E0491]: in type `&'a WithoutAssoc<TheType<'b>>`, reference has a longer lifetime than the data it references
- --> $DIR/regions-outlives-projection-container.rs:74:12
+ --> $DIR/regions-outlives-projection-container.rs:70:12
|
LL | call::<&'a WithoutAssoc<TheType<'b>>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
-note: the pointer is valid for the lifetime 'a as defined on the function body at 71:23
- --> $DIR/regions-outlives-projection-container.rs:71:23
+note: the pointer is valid for the lifetime 'a as defined on the function body at 67:23
+ --> $DIR/regions-outlives-projection-container.rs:67:23
|
LL | fn call_without_assoc<'a,'b>() {
| ^^
-note: but the referenced data is only valid for the lifetime 'b as defined on the function body at 71:26
- --> $DIR/regions-outlives-projection-container.rs:71:26
+note: but the referenced data is only valid for the lifetime 'b as defined on the function body at 67:26
+ --> $DIR/regions-outlives-projection-container.rs:67:26
|
LL | fn call_without_assoc<'a,'b>() {
| ^^
diff --git a/src/test/ui/specialization/defaultimpl/specialization-no-default.rs b/src/test/ui/specialization/defaultimpl/specialization-no-default.rs
index 7ea79a9..37005f83 100644
--- a/src/test/ui/specialization/defaultimpl/specialization-no-default.rs
+++ b/src/test/ui/specialization/defaultimpl/specialization-no-default.rs
@@ -3,9 +3,7 @@
// Check a number of scenarios in which one impl tries to override another,
// without correctly using `default`.
-////////////////////////////////////////////////////////////////////////////////
// Test 1: one layer of specialization, multiple methods, missing `default`
-////////////////////////////////////////////////////////////////////////////////
trait Foo {
fn foo(&self);
@@ -25,9 +23,7 @@
fn bar(&self) {} //~ ERROR E0520
}
-////////////////////////////////////////////////////////////////////////////////
// Test 2: one layer of specialization, missing `default` on associated type
-////////////////////////////////////////////////////////////////////////////////
trait Bar {
type T;
@@ -41,9 +37,7 @@
type T = (); //~ ERROR E0520
}
-////////////////////////////////////////////////////////////////////////////////
// Test 3a: multiple layers of specialization, missing interior `default`
-////////////////////////////////////////////////////////////////////////////////
trait Baz {
fn baz(&self);
@@ -61,10 +55,8 @@
fn baz(&self) {} //~ ERROR E0520
}
-////////////////////////////////////////////////////////////////////////////////
// Test 3b: multiple layers of specialization, missing interior `default`,
// redundant `default` in bottom layer.
-////////////////////////////////////////////////////////////////////////////////
trait Redundant {
fn redundant(&self);
diff --git a/src/test/ui/specialization/defaultimpl/specialization-no-default.stderr b/src/test/ui/specialization/defaultimpl/specialization-no-default.stderr
index 91690f6..13636b2 100644
--- a/src/test/ui/specialization/defaultimpl/specialization-no-default.stderr
+++ b/src/test/ui/specialization/defaultimpl/specialization-no-default.stderr
@@ -1,5 +1,5 @@
error[E0520]: `foo` specializes an item from a parent `impl`, but that item is not marked `default`
- --> $DIR/specialization-no-default.rs:22:5
+ --> $DIR/specialization-no-default.rs:20:5
|
LL | / impl<T> Foo for T {
LL | | fn foo(&self) {}
@@ -13,7 +13,7 @@
= note: to specialize, `foo` in the parent `impl` must be marked `default`
error[E0520]: `bar` specializes an item from a parent `impl`, but that item is not marked `default`
- --> $DIR/specialization-no-default.rs:25:5
+ --> $DIR/specialization-no-default.rs:23:5
|
LL | / impl<T> Foo for T {
LL | | fn foo(&self) {}
@@ -27,7 +27,7 @@
= note: to specialize, `bar` in the parent `impl` must be marked `default`
error[E0520]: `T` specializes an item from a parent `impl`, but that item is not marked `default`
- --> $DIR/specialization-no-default.rs:41:5
+ --> $DIR/specialization-no-default.rs:37:5
|
LL | / impl<T> Bar for T {
LL | | type T = u8;
@@ -40,7 +40,7 @@
= note: to specialize, `T` in the parent `impl` must be marked `default`
error[E0520]: `baz` specializes an item from a parent `impl`, but that item is not marked `default`
- --> $DIR/specialization-no-default.rs:61:5
+ --> $DIR/specialization-no-default.rs:55:5
|
LL | / impl<T: Clone> Baz for T {
LL | | fn baz(&self) {}
@@ -53,7 +53,7 @@
= note: to specialize, `baz` in the parent `impl` must be marked `default`
error[E0520]: `redundant` specializes an item from a parent `impl`, but that item is not marked `default`
- --> $DIR/specialization-no-default.rs:82:5
+ --> $DIR/specialization-no-default.rs:74:5
|
LL | / impl<T: Clone> Redundant for T {
LL | | fn redundant(&self) {}
diff --git a/src/test/ui/specialization/specialization-no-default.rs b/src/test/ui/specialization/specialization-no-default.rs
index 29afbbd9..57346b2 100644
--- a/src/test/ui/specialization/specialization-no-default.rs
+++ b/src/test/ui/specialization/specialization-no-default.rs
@@ -3,9 +3,7 @@
// Check a number of scenarios in which one impl tries to override another,
// without correctly using `default`.
-////////////////////////////////////////////////////////////////////////////////
// Test 1: one layer of specialization, multiple methods, missing `default`
-////////////////////////////////////////////////////////////////////////////////
trait Foo {
fn foo(&self);
@@ -25,9 +23,7 @@
fn bar(&self) {} //~ ERROR E0520
}
-////////////////////////////////////////////////////////////////////////////////
// Test 2: one layer of specialization, missing `default` on associated type
-////////////////////////////////////////////////////////////////////////////////
trait Bar {
type T;
@@ -41,9 +37,7 @@
type T = (); //~ ERROR E0520
}
-////////////////////////////////////////////////////////////////////////////////
// Test 3a: multiple layers of specialization, missing interior `default`
-////////////////////////////////////////////////////////////////////////////////
trait Baz {
fn baz(&self);
@@ -61,10 +55,8 @@
fn baz(&self) {} //~ ERROR E0520
}
-////////////////////////////////////////////////////////////////////////////////
// Test 3b: multiple layers of specialization, missing interior `default`,
// redundant `default` in bottom layer.
-////////////////////////////////////////////////////////////////////////////////
trait Redundant {
fn redundant(&self);
diff --git a/src/test/ui/specialization/specialization-no-default.stderr b/src/test/ui/specialization/specialization-no-default.stderr
index c39986d..992e9ab 100644
--- a/src/test/ui/specialization/specialization-no-default.stderr
+++ b/src/test/ui/specialization/specialization-no-default.stderr
@@ -1,5 +1,5 @@
error[E0520]: `foo` specializes an item from a parent `impl`, but that item is not marked `default`
- --> $DIR/specialization-no-default.rs:22:5
+ --> $DIR/specialization-no-default.rs:20:5
|
LL | / impl<T> Foo for T {
LL | | fn foo(&self) {}
@@ -13,7 +13,7 @@
= note: to specialize, `foo` in the parent `impl` must be marked `default`
error[E0520]: `bar` specializes an item from a parent `impl`, but that item is not marked `default`
- --> $DIR/specialization-no-default.rs:25:5
+ --> $DIR/specialization-no-default.rs:23:5
|
LL | / impl<T> Foo for T {
LL | | fn foo(&self) {}
@@ -27,7 +27,7 @@
= note: to specialize, `bar` in the parent `impl` must be marked `default`
error[E0520]: `T` specializes an item from a parent `impl`, but that item is not marked `default`
- --> $DIR/specialization-no-default.rs:41:5
+ --> $DIR/specialization-no-default.rs:37:5
|
LL | / impl<T> Bar for T {
LL | | type T = u8;
@@ -40,7 +40,7 @@
= note: to specialize, `T` in the parent `impl` must be marked `default`
error[E0520]: `baz` specializes an item from a parent `impl`, but that item is not marked `default`
- --> $DIR/specialization-no-default.rs:61:5
+ --> $DIR/specialization-no-default.rs:55:5
|
LL | / impl<T: Clone> Baz for T {
LL | | fn baz(&self) {}
@@ -53,7 +53,7 @@
= note: to specialize, `baz` in the parent `impl` must be marked `default`
error[E0520]: `redundant` specializes an item from a parent `impl`, but that item is not marked `default`
- --> $DIR/specialization-no-default.rs:82:5
+ --> $DIR/specialization-no-default.rs:74:5
|
LL | / impl<T: Clone> Redundant for T {
LL | | fn redundant(&self) {}
diff --git a/src/test/ui/traits/traits-conditional-model-fn.rs b/src/test/ui/traits/traits-conditional-model-fn.rs
index 27ce6d9..afdfb96 100644
--- a/src/test/ui/traits/traits-conditional-model-fn.rs
+++ b/src/test/ui/traits/traits-conditional-model-fn.rs
@@ -14,8 +14,6 @@
use std::rc::Rc;
use std::cell::Cell;
-///////////////////////////////////////////////////////////////////////////
-
struct SomeGoableThing {
counter: Rc<Cell<isize>>
}
@@ -26,8 +24,6 @@
}
}
-///////////////////////////////////////////////////////////////////////////
-
struct SomeGoOnceableThing {
counter: Rc<Cell<isize>>
}
@@ -38,8 +34,6 @@
}
}
-///////////////////////////////////////////////////////////////////////////
-
fn main() {
let counter = Rc::new(Cell::new(0));
let mut x = SomeGoableThing { counter: counter.clone() };