From 4eca24700be4cf9f1fad3e7674e4849f4de234a1 Mon Sep 17 00:00:00 2001 From: Anirudh Balaji Date: Fri, 22 Jun 2018 00:20:51 -0700 Subject: [PATCH 1/9] Add explanation for (copy, clone)_from_slice It elaborates over why we have to slice the 4-size src to 2-size (same as dst). --- src/libcore/slice/mod.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/libcore/slice/mod.rs b/src/libcore/slice/mod.rs index 6f4c130d8f3..01db55a00f6 100644 --- a/src/libcore/slice/mod.rs +++ b/src/libcore/slice/mod.rs @@ -1541,6 +1541,10 @@ impl [T] { /// let src = [1, 2, 3, 4]; /// let mut dst = [0, 0]; /// + /// // Note: the slices must be the same length, so + /// // you can slice the source to be the same size. + /// // Here we slice the source, four elements, to two, the same size + /// // as the destination slice. It *will* panic if we don't do this. /// dst.clone_from_slice(&src[2..]); /// /// assert_eq!(src, [1, 2, 3, 4]); @@ -1607,6 +1611,10 @@ impl [T] { /// let src = [1, 2, 3, 4]; /// let mut dst = [0, 0]; /// + /// // Note: the slices must be the same length, so + /// // you can slice the source to be the same size. + /// // Here we slice the source, four elements, to two, the same size + /// // as the destination slice. It *will* panic if we don't do this. /// dst.copy_from_slice(&src[2..]); /// /// assert_eq!(src, [1, 2, 3, 4]); From 57f7f22fe46a08c197e4cd1d2e78df9de4c00798 Mon Sep 17 00:00:00 2001 From: Anirudh Balaji Date: Sun, 24 Jun 2018 15:31:03 -0700 Subject: [PATCH 2/9] Make line-breaking more consistent. --- src/libcore/slice/mod.rs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/libcore/slice/mod.rs b/src/libcore/slice/mod.rs index 01db55a00f6..a6d95b11825 100644 --- a/src/libcore/slice/mod.rs +++ b/src/libcore/slice/mod.rs @@ -1541,10 +1541,9 @@ impl [T] { /// let src = [1, 2, 3, 4]; /// let mut dst = [0, 0]; /// - /// // Note: the slices must be the same length, so - /// // you can slice the source to be the same size. - /// // Here we slice the source, four elements, to two, the same size - /// // as the destination slice. It *will* panic if we don't do this. + /// // Note: the slices must be the same length, so you can slice the + /// // source to be the same size. Here we slice the source, four elements, + /// // to two, the same size as the destination slice. It *will* panic if we don't do this. /// dst.clone_from_slice(&src[2..]); /// /// assert_eq!(src, [1, 2, 3, 4]); @@ -1611,10 +1610,9 @@ impl [T] { /// let src = [1, 2, 3, 4]; /// let mut dst = [0, 0]; /// - /// // Note: the slices must be the same length, so - /// // you can slice the source to be the same size. - /// // Here we slice the source, four elements, to two, the same size - /// // as the destination slice. It *will* panic if we don't do this. + /// // Note: the slices must be the same length, so you can slice the + /// // source to be the same size. Here we slice the source, four elements, + /// // to two, the same size as the destination slice. It *will* panic if we don't do this. /// dst.copy_from_slice(&src[2..]); /// /// assert_eq!(src, [1, 2, 3, 4]); From c95fba7b5b7cc3a923707df414f4bc8258400d52 Mon Sep 17 00:00:00 2001 From: Anirudh Balaji Date: Wed, 27 Jun 2018 13:49:50 -0700 Subject: [PATCH 3/9] Nit: Remove leading whitespace --- src/libcore/slice/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libcore/slice/mod.rs b/src/libcore/slice/mod.rs index a6d95b11825..0ee4c0bdbe7 100644 --- a/src/libcore/slice/mod.rs +++ b/src/libcore/slice/mod.rs @@ -1541,7 +1541,7 @@ impl [T] { /// let src = [1, 2, 3, 4]; /// let mut dst = [0, 0]; /// - /// // Note: the slices must be the same length, so you can slice the + /// // Note: the slices must be the same length, so you can slice the /// // source to be the same size. Here we slice the source, four elements, /// // to two, the same size as the destination slice. It *will* panic if we don't do this. /// dst.clone_from_slice(&src[2..]); @@ -1610,7 +1610,7 @@ impl [T] { /// let src = [1, 2, 3, 4]; /// let mut dst = [0, 0]; /// - /// // Note: the slices must be the same length, so you can slice the + /// // Note: the slices must be the same length, so you can slice the /// // source to be the same size. Here we slice the source, four elements, /// // to two, the same size as the destination slice. It *will* panic if we don't do this. /// dst.copy_from_slice(&src[2..]); From c90a821d43dee1ff0d04d84a9adb4ec11dbe6c47 Mon Sep 17 00:00:00 2001 From: Anirudh Balaji Date: Mon, 9 Jul 2018 13:41:46 -0700 Subject: [PATCH 4/9] Add "or destination" to {copy, clone}_from_slice example --- src/libcore/slice/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libcore/slice/mod.rs b/src/libcore/slice/mod.rs index 0ee4c0bdbe7..c41776a1460 100644 --- a/src/libcore/slice/mod.rs +++ b/src/libcore/slice/mod.rs @@ -1541,8 +1541,8 @@ impl [T] { /// let src = [1, 2, 3, 4]; /// let mut dst = [0, 0]; /// - /// // Note: the slices must be the same length, so you can slice the - /// // source to be the same size. Here we slice the source, four elements, + /// // Note: the slices must be the same length, so you can slice the source + /// // or the destination to be the same size. Here we slice the source, four elements, /// // to two, the same size as the destination slice. It *will* panic if we don't do this. /// dst.clone_from_slice(&src[2..]); /// @@ -1610,8 +1610,8 @@ impl [T] { /// let src = [1, 2, 3, 4]; /// let mut dst = [0, 0]; /// - /// // Note: the slices must be the same length, so you can slice the - /// // source to be the same size. Here we slice the source, four elements, + /// // Note: the slices must be the same length, so you can slice the source + /// // or the destination to be the same size. Here we slice the source, four elements, /// // to two, the same size as the destination slice. It *will* panic if we don't do this. /// dst.copy_from_slice(&src[2..]); /// From 4b51484fed75750a84d8422d26a9a7e6c06294e0 Mon Sep 17 00:00:00 2001 From: Anirudh Balaji Date: Tue, 10 Jul 2018 10:56:58 -0700 Subject: [PATCH 5/9] Change wording for {copy, clone}_from_slice --- src/libcore/slice/mod.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/libcore/slice/mod.rs b/src/libcore/slice/mod.rs index c41776a1460..a0270d747a9 100644 --- a/src/libcore/slice/mod.rs +++ b/src/libcore/slice/mod.rs @@ -1541,9 +1541,9 @@ impl [T] { /// let src = [1, 2, 3, 4]; /// let mut dst = [0, 0]; /// - /// // Note: the slices must be the same length, so you can slice the source - /// // or the destination to be the same size. Here we slice the source, four elements, - /// // to two, the same size as the destination slice. It *will* panic if we don't do this. + /// // Because the slices have to be the same length, + /// // we slice the source slice from four elements + /// // to two. It will panic if we don't do this. /// dst.clone_from_slice(&src[2..]); /// /// assert_eq!(src, [1, 2, 3, 4]); @@ -1610,9 +1610,9 @@ impl [T] { /// let src = [1, 2, 3, 4]; /// let mut dst = [0, 0]; /// - /// // Note: the slices must be the same length, so you can slice the source - /// // or the destination to be the same size. Here we slice the source, four elements, - /// // to two, the same size as the destination slice. It *will* panic if we don't do this. + /// // Because the slices have to be the same length, + /// // we slice the source slice from four elements + /// // to two. It will panic if we don't do this. /// dst.copy_from_slice(&src[2..]); /// /// assert_eq!(src, [1, 2, 3, 4]); From b8c96ce530227c345908bddd91e0380d9a206e06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Re=CC=81my=20Rakic?= Date: Tue, 10 Jul 2018 23:10:13 +0200 Subject: [PATCH 6/9] Fix typo in error message E0277 --- src/libcore/marker.rs | 2 +- .../compile-fail/associated-types-unsized.rs | 2 +- src/test/compile-fail/bad-sized.rs | 4 +- src/test/compile-fail/dst-bad-assign-2.rs | 2 +- src/test/compile-fail/dst-bad-assign-3.rs | 2 +- src/test/compile-fail/dst-bad-assign.rs | 2 +- src/test/compile-fail/dst-bad-deep-2.rs | 2 +- src/test/compile-fail/dst-bad-deep.rs | 2 +- .../dst-object-from-unsized-type.rs | 8 ++-- .../compile-fail/dst-sized-trait-param.rs | 4 +- src/test/compile-fail/extern-types-unsized.rs | 8 ++-- src/test/compile-fail/issue-14366.rs | 2 +- src/test/compile-fail/issue-15756.rs | 2 +- src/test/compile-fail/issue-17651.rs | 2 +- src/test/compile-fail/issue-18107.rs | 2 +- src/test/compile-fail/issue-18919.rs | 2 +- src/test/compile-fail/issue-20005.rs | 2 +- src/test/compile-fail/issue-20433.rs | 2 +- src/test/compile-fail/issue-20605.rs | 2 +- src/test/compile-fail/issue-22874.rs | 2 +- src/test/compile-fail/issue-23281.rs | 2 +- src/test/compile-fail/issue-24446.rs | 2 +- src/test/compile-fail/issue-27060-2.rs | 2 +- src/test/compile-fail/issue-27078.rs | 2 +- src/test/compile-fail/issue-35988.rs | 2 +- src/test/compile-fail/issue-38954.rs | 2 +- src/test/compile-fail/issue-41229-ref-str.rs | 2 +- src/test/compile-fail/issue-42312.rs | 4 +- src/test/compile-fail/issue-5883.rs | 4 +- src/test/compile-fail/range-1.rs | 2 +- src/test/compile-fail/str-mut-idx.rs | 4 +- src/test/compile-fail/substs-ppaux.rs | 4 +- .../trait-bounds-not-on-bare-trait.rs | 2 +- src/test/compile-fail/union/union-unsized.rs | 4 +- src/test/compile-fail/unsized-bare-typaram.rs | 2 +- src/test/compile-fail/unsized-enum.rs | 2 +- .../unsized-inherent-impl-self-type.rs | 2 +- src/test/compile-fail/unsized-struct.rs | 4 +- .../unsized-trait-impl-self-type.rs | 2 +- .../unsized-trait-impl-trait-arg.rs | 2 +- src/test/compile-fail/unsized3.rs | 12 +++--- src/test/compile-fail/unsized5.rs | 12 +++--- src/test/compile-fail/unsized6.rs | 26 ++++++------ src/test/compile-fail/unsized7.rs | 2 +- src/test/ui/const-unsized.rs | 8 ++-- src/test/ui/const-unsized.stderr | 8 ++-- src/test/ui/error-codes/E0277.rs | 2 +- src/test/ui/error-codes/E0277.stderr | 2 +- .../ui/feature-gate-trivial_bounds.stderr | 6 +-- src/test/ui/generator/sized-yield.rs | 4 +- src/test/ui/generator/sized-yield.stderr | 6 +-- src/test/ui/mismatched_types/cast-rfc0401.rs | 4 +- .../ui/mismatched_types/cast-rfc0401.stderr | 8 ++-- src/test/ui/resolve/issue-5035-2.rs | 2 +- src/test/ui/resolve/issue-5035-2.stderr | 2 +- .../ui/suggestions/str-array-assignment.rs | 2 +- .../suggestions/str-array-assignment.stderr | 2 +- src/test/ui/trait-suggest-where-clause.rs | 8 ++-- src/test/ui/trait-suggest-where-clause.stderr | 8 ++-- src/test/ui/trivial-bounds-leak.stderr | 2 +- src/test/ui/union/union-sized-field.rs | 6 +-- src/test/ui/union/union-sized-field.stderr | 6 +-- src/test/ui/unsized-enum2.rs | 40 +++++++++---------- src/test/ui/unsized-enum2.stderr | 40 +++++++++---------- 64 files changed, 163 insertions(+), 163 deletions(-) diff --git a/src/libcore/marker.rs b/src/libcore/marker.rs index 4a54ebce0a3..090f61a5d69 100644 --- a/src/libcore/marker.rs +++ b/src/libcore/marker.rs @@ -92,7 +92,7 @@ impl !Send for *mut T { } #[stable(feature = "rust1", since = "1.0.0")] #[lang = "sized"] #[rustc_on_unimplemented( - message="the size for value values of type `{Self}` cannot be known at compilation time", + message="the size for values of type `{Self}` cannot be known at compilation time", label="doesn't have a size known at compile-time", note="to learn more, visit ", diff --git a/src/test/compile-fail/associated-types-unsized.rs b/src/test/compile-fail/associated-types-unsized.rs index 3bb0382ef03..c561ae861ed 100644 --- a/src/test/compile-fail/associated-types-unsized.rs +++ b/src/test/compile-fail/associated-types-unsized.rs @@ -14,7 +14,7 @@ trait Get { } fn foo(t: T) { - let x = t.get(); //~ ERROR the size for value values of type + let x = t.get(); //~ ERROR the size for values of type } fn main() { diff --git a/src/test/compile-fail/bad-sized.rs b/src/test/compile-fail/bad-sized.rs index 9b87ec4d446..a58aebee77b 100644 --- a/src/test/compile-fail/bad-sized.rs +++ b/src/test/compile-fail/bad-sized.rs @@ -13,6 +13,6 @@ trait Trait {} pub fn main() { let x: Vec = Vec::new(); //~^ ERROR only auto traits can be used as additional traits in a trait object - //~| ERROR the size for value values of type - //~| ERROR the size for value values of type + //~| ERROR the size for values of type + //~| ERROR the size for values of type } diff --git a/src/test/compile-fail/dst-bad-assign-2.rs b/src/test/compile-fail/dst-bad-assign-2.rs index 1dbdd42ca36..372f3187805 100644 --- a/src/test/compile-fail/dst-bad-assign-2.rs +++ b/src/test/compile-fail/dst-bad-assign-2.rs @@ -43,6 +43,6 @@ pub fn main() { let f5: &mut Fat = &mut Fat { f1: 5, f2: "some str", ptr: Bar1 {f :42} }; let z: Box = Box::new(Bar1 {f: 36}); f5.ptr = *z; - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type } diff --git a/src/test/compile-fail/dst-bad-assign-3.rs b/src/test/compile-fail/dst-bad-assign-3.rs index 2a209a2959b..339cfb5443d 100644 --- a/src/test/compile-fail/dst-bad-assign-3.rs +++ b/src/test/compile-fail/dst-bad-assign-3.rs @@ -45,5 +45,5 @@ pub fn main() { //~| expected type `dyn ToBar` //~| found type `Bar1` //~| expected trait ToBar, found struct `Bar1` - //~| ERROR the size for value values of type + //~| ERROR the size for values of type } diff --git a/src/test/compile-fail/dst-bad-assign.rs b/src/test/compile-fail/dst-bad-assign.rs index e28586c4755..9a329c636ae 100644 --- a/src/test/compile-fail/dst-bad-assign.rs +++ b/src/test/compile-fail/dst-bad-assign.rs @@ -47,5 +47,5 @@ pub fn main() { //~| expected type `dyn ToBar` //~| found type `Bar1` //~| expected trait ToBar, found struct `Bar1` - //~| ERROR the size for value values of type + //~| ERROR the size for values of type } diff --git a/src/test/compile-fail/dst-bad-deep-2.rs b/src/test/compile-fail/dst-bad-deep-2.rs index 82d81913cd3..a54301071ba 100644 --- a/src/test/compile-fail/dst-bad-deep-2.rs +++ b/src/test/compile-fail/dst-bad-deep-2.rs @@ -19,5 +19,5 @@ pub fn main() { let f: ([isize; 3],) = ([5, 6, 7],); let g: &([isize],) = &f; let h: &(([isize],),) = &(*g,); - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type } diff --git a/src/test/compile-fail/dst-bad-deep.rs b/src/test/compile-fail/dst-bad-deep.rs index b8ca22185bc..3d7e2b8f671 100644 --- a/src/test/compile-fail/dst-bad-deep.rs +++ b/src/test/compile-fail/dst-bad-deep.rs @@ -21,5 +21,5 @@ pub fn main() { let f: Fat<[isize; 3]> = Fat { ptr: [5, 6, 7] }; let g: &Fat<[isize]> = &f; let h: &Fat> = &Fat { ptr: *g }; - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type } diff --git a/src/test/compile-fail/dst-object-from-unsized-type.rs b/src/test/compile-fail/dst-object-from-unsized-type.rs index 4a892753595..70b46b1bd79 100644 --- a/src/test/compile-fail/dst-object-from-unsized-type.rs +++ b/src/test/compile-fail/dst-object-from-unsized-type.rs @@ -16,22 +16,22 @@ impl Foo for [u8] {} fn test1(t: &T) { let u: &Foo = t; - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type } fn test2(t: &T) { let v: &Foo = t as &Foo; - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type } fn test3() { let _: &[&Foo] = &["hi"]; - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type } fn test4(x: &[u8]) { let _: &Foo = x as &Foo; - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type } fn main() { } diff --git a/src/test/compile-fail/dst-sized-trait-param.rs b/src/test/compile-fail/dst-sized-trait-param.rs index 06795567432..7316a48970f 100644 --- a/src/test/compile-fail/dst-sized-trait-param.rs +++ b/src/test/compile-fail/dst-sized-trait-param.rs @@ -15,9 +15,9 @@ trait Foo : Sized { fn take(self, x: &T) { } } // Note: T is sized impl Foo<[isize]> for usize { } -//~^ ERROR the size for value values of type +//~^ ERROR the size for values of type impl Foo for [usize] { } -//~^ ERROR the size for value values of type +//~^ ERROR the size for values of type pub fn main() { } diff --git a/src/test/compile-fail/extern-types-unsized.rs b/src/test/compile-fail/extern-types-unsized.rs index 135b466161d..f2db4553868 100644 --- a/src/test/compile-fail/extern-types-unsized.rs +++ b/src/test/compile-fail/extern-types-unsized.rs @@ -30,14 +30,14 @@ fn assert_sized() { } fn main() { assert_sized::(); - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type assert_sized::(); - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type assert_sized::>(); - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type assert_sized::>>(); - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type } diff --git a/src/test/compile-fail/issue-14366.rs b/src/test/compile-fail/issue-14366.rs index 5212cbb004e..0b154d0a3ea 100644 --- a/src/test/compile-fail/issue-14366.rs +++ b/src/test/compile-fail/issue-14366.rs @@ -10,5 +10,5 @@ fn main() { let _x = "test" as &::std::any::Any; - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type } diff --git a/src/test/compile-fail/issue-15756.rs b/src/test/compile-fail/issue-15756.rs index 4756099ab95..c123e85a0e0 100644 --- a/src/test/compile-fail/issue-15756.rs +++ b/src/test/compile-fail/issue-15756.rs @@ -15,7 +15,7 @@ fn dft_iter<'a, T>(arg1: Chunks<'a,T>, arg2: ChunksMut<'a,T>) { for &mut something - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type in arg2 { } diff --git a/src/test/compile-fail/issue-17651.rs b/src/test/compile-fail/issue-17651.rs index e7019ff7c0d..cbd0da4b53c 100644 --- a/src/test/compile-fail/issue-17651.rs +++ b/src/test/compile-fail/issue-17651.rs @@ -13,5 +13,5 @@ fn main() { (|| Box::new(*(&[0][..])))(); - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type } diff --git a/src/test/compile-fail/issue-18107.rs b/src/test/compile-fail/issue-18107.rs index 9239ceb341f..260038b7add 100644 --- a/src/test/compile-fail/issue-18107.rs +++ b/src/test/compile-fail/issue-18107.rs @@ -12,7 +12,7 @@ pub trait AbstractRenderer {} fn _create_render(_: &()) -> AbstractRenderer -//~^ ERROR the size for value values of type +//~^ ERROR the size for values of type { match 0 { _ => unimplemented!() diff --git a/src/test/compile-fail/issue-18919.rs b/src/test/compile-fail/issue-18919.rs index 0b717ec6413..cc87a0977a0 100644 --- a/src/test/compile-fail/issue-18919.rs +++ b/src/test/compile-fail/issue-18919.rs @@ -11,7 +11,7 @@ type FuncType<'f> = Fn(&isize) -> isize + 'f; fn ho_func(f: Option) { - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type } fn main() {} diff --git a/src/test/compile-fail/issue-20005.rs b/src/test/compile-fail/issue-20005.rs index 426657ac92e..8db09182fa3 100644 --- a/src/test/compile-fail/issue-20005.rs +++ b/src/test/compile-fail/issue-20005.rs @@ -15,7 +15,7 @@ trait From { } trait To { - fn to( //~ ERROR the size for value values of type + fn to( //~ ERROR the size for values of type self ) -> >::Result where Dst: From { From::from(self) diff --git a/src/test/compile-fail/issue-20433.rs b/src/test/compile-fail/issue-20433.rs index 8b7f2d5a458..f760cd59968 100644 --- a/src/test/compile-fail/issue-20433.rs +++ b/src/test/compile-fail/issue-20433.rs @@ -14,5 +14,5 @@ struct The; impl The { fn iceman(c: Vec<[i32]>) {} - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type } diff --git a/src/test/compile-fail/issue-20605.rs b/src/test/compile-fail/issue-20605.rs index 2d8d9c65655..60d012ab134 100644 --- a/src/test/compile-fail/issue-20605.rs +++ b/src/test/compile-fail/issue-20605.rs @@ -10,7 +10,7 @@ fn changer<'a>(mut things: Box>) { for item in *things { *item = 0 } -//~^ ERROR the size for value values of type +//~^ ERROR the size for values of type } fn main() {} diff --git a/src/test/compile-fail/issue-22874.rs b/src/test/compile-fail/issue-22874.rs index cb199580b10..e0a87b3a174 100644 --- a/src/test/compile-fail/issue-22874.rs +++ b/src/test/compile-fail/issue-22874.rs @@ -10,7 +10,7 @@ struct Table { rows: [[String]], - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type } fn f(table: &Table) -> &[String] { diff --git a/src/test/compile-fail/issue-23281.rs b/src/test/compile-fail/issue-23281.rs index d6b5c329825..5de00eb8f68 100644 --- a/src/test/compile-fail/issue-23281.rs +++ b/src/test/compile-fail/issue-23281.rs @@ -14,7 +14,7 @@ pub struct Struct; impl Struct { pub fn function(funs: Vec ()>) {} - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type } fn main() {} diff --git a/src/test/compile-fail/issue-24446.rs b/src/test/compile-fail/issue-24446.rs index 74c68c50ae3..a9c7978642d 100644 --- a/src/test/compile-fail/issue-24446.rs +++ b/src/test/compile-fail/issue-24446.rs @@ -11,7 +11,7 @@ fn main() { static foo: Fn() -> u32 = || -> u32 { //~^ ERROR mismatched types - //~| ERROR the size for value values of type + //~| ERROR the size for values of type 0 }; } diff --git a/src/test/compile-fail/issue-27060-2.rs b/src/test/compile-fail/issue-27060-2.rs index bc5567e1686..619616adda6 100644 --- a/src/test/compile-fail/issue-27060-2.rs +++ b/src/test/compile-fail/issue-27060-2.rs @@ -10,7 +10,7 @@ #[repr(packed)] pub struct Bad { - data: T, //~ ERROR the size for value values of type + data: T, //~ ERROR the size for values of type } fn main() {} diff --git a/src/test/compile-fail/issue-27078.rs b/src/test/compile-fail/issue-27078.rs index 6efc1f10243..294c288a970 100644 --- a/src/test/compile-fail/issue-27078.rs +++ b/src/test/compile-fail/issue-27078.rs @@ -13,7 +13,7 @@ trait Foo { const BAR: i32; fn foo(self) -> &'static i32 { - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type &::BAR } } diff --git a/src/test/compile-fail/issue-35988.rs b/src/test/compile-fail/issue-35988.rs index 805b1a48a03..5909322ff1f 100644 --- a/src/test/compile-fail/issue-35988.rs +++ b/src/test/compile-fail/issue-35988.rs @@ -10,7 +10,7 @@ enum E { V([Box]), - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type } fn main() {} diff --git a/src/test/compile-fail/issue-38954.rs b/src/test/compile-fail/issue-38954.rs index 1b64d17bbef..7f01ed3f820 100644 --- a/src/test/compile-fail/issue-38954.rs +++ b/src/test/compile-fail/issue-38954.rs @@ -9,6 +9,6 @@ // except according to those terms. fn _test(ref _p: str) {} -//~^ ERROR the size for value values of type +//~^ ERROR the size for values of type fn main() { } diff --git a/src/test/compile-fail/issue-41229-ref-str.rs b/src/test/compile-fail/issue-41229-ref-str.rs index 6207e669d00..5d7546e1bc4 100644 --- a/src/test/compile-fail/issue-41229-ref-str.rs +++ b/src/test/compile-fail/issue-41229-ref-str.rs @@ -9,6 +9,6 @@ // except according to those terms. pub fn example(ref s: str) {} -//~^ ERROR the size for value values of type +//~^ ERROR the size for values of type fn main() {} diff --git a/src/test/compile-fail/issue-42312.rs b/src/test/compile-fail/issue-42312.rs index 2ab44433ede..f7705297dfd 100644 --- a/src/test/compile-fail/issue-42312.rs +++ b/src/test/compile-fail/issue-42312.rs @@ -12,10 +12,10 @@ use std::ops::Deref; pub trait Foo { fn baz(_: Self::Target) where Self: Deref {} - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type } pub fn f(_: ToString) {} -//~^ ERROR the size for value values of type +//~^ ERROR the size for values of type fn main() { } diff --git a/src/test/compile-fail/issue-5883.rs b/src/test/compile-fail/issue-5883.rs index 82d4666ce54..a91f5d281dd 100644 --- a/src/test/compile-fail/issue-5883.rs +++ b/src/test/compile-fail/issue-5883.rs @@ -15,8 +15,8 @@ struct Struct { } fn new_struct(r: A+'static) - -> Struct { //~^ ERROR the size for value values of type - //~^ ERROR the size for value values of type + -> Struct { //~^ ERROR the size for values of type + //~^ ERROR the size for values of type Struct { r: r } } diff --git a/src/test/compile-fail/range-1.rs b/src/test/compile-fail/range-1.rs index ed26204bbe1..59c78052e15 100644 --- a/src/test/compile-fail/range-1.rs +++ b/src/test/compile-fail/range-1.rs @@ -22,5 +22,5 @@ pub fn main() { // Unsized type. let arr: &[_] = &[1, 2, 3]; let range = *arr..; - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type } diff --git a/src/test/compile-fail/str-mut-idx.rs b/src/test/compile-fail/str-mut-idx.rs index cc5fd7e3f24..136bfaefa71 100644 --- a/src/test/compile-fail/str-mut-idx.rs +++ b/src/test/compile-fail/str-mut-idx.rs @@ -12,8 +12,8 @@ fn bot() -> T { loop {} } fn mutate(s: &mut str) { s[1..2] = bot(); - //~^ ERROR the size for value values of type - //~| ERROR the size for value values of type + //~^ ERROR the size for values of type + //~| ERROR the size for values of type s[1usize] = bot(); //~^ ERROR the type `str` cannot be mutably indexed by `usize` } diff --git a/src/test/compile-fail/substs-ppaux.rs b/src/test/compile-fail/substs-ppaux.rs index b8557cb79e3..d0e9a7f4a40 100644 --- a/src/test/compile-fail/substs-ppaux.rs +++ b/src/test/compile-fail/substs-ppaux.rs @@ -56,6 +56,6 @@ fn foo<'z>() where &'z (): Sized { //[normal]~| found type `fn() {foo::<'static>}` >::bar; - //[verbose]~^ ERROR the size for value values of type - //[normal]~^^ ERROR the size for value values of type + //[verbose]~^ ERROR the size for values of type + //[normal]~^^ ERROR the size for values of type } diff --git a/src/test/compile-fail/trait-bounds-not-on-bare-trait.rs b/src/test/compile-fail/trait-bounds-not-on-bare-trait.rs index 89fddf1f65f..9c38d8a9e2a 100644 --- a/src/test/compile-fail/trait-bounds-not-on-bare-trait.rs +++ b/src/test/compile-fail/trait-bounds-not-on-bare-trait.rs @@ -15,7 +15,7 @@ trait Foo { // This should emit the less confusing error, not the more confusing one. fn foo(_x: Foo + Send) { - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type } fn main() { } diff --git a/src/test/compile-fail/union/union-unsized.rs b/src/test/compile-fail/union/union-unsized.rs index a9a2a3c4c92..d79c2ed710e 100644 --- a/src/test/compile-fail/union/union-unsized.rs +++ b/src/test/compile-fail/union/union-unsized.rs @@ -12,7 +12,7 @@ union U { a: str, - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type b: u8, } @@ -20,7 +20,7 @@ union U { union W { a: u8, b: str, - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type } fn main() {} diff --git a/src/test/compile-fail/unsized-bare-typaram.rs b/src/test/compile-fail/unsized-bare-typaram.rs index 736794ac538..498bdded350 100644 --- a/src/test/compile-fail/unsized-bare-typaram.rs +++ b/src/test/compile-fail/unsized-bare-typaram.rs @@ -10,5 +10,5 @@ fn bar() { } fn foo() { bar::() } -//~^ ERROR the size for value values of type +//~^ ERROR the size for values of type fn main() { } diff --git a/src/test/compile-fail/unsized-enum.rs b/src/test/compile-fail/unsized-enum.rs index f9702e29f1d..4a6a5557c95 100644 --- a/src/test/compile-fail/unsized-enum.rs +++ b/src/test/compile-fail/unsized-enum.rs @@ -15,7 +15,7 @@ fn not_sized() { } enum Foo { FooSome(U), FooNone } fn foo1() { not_sized::>() } // Hunky dory. fn foo2() { not_sized::>() } -//~^ ERROR the size for value values of type +//~^ ERROR the size for values of type // // Not OK: `T` is not sized. diff --git a/src/test/compile-fail/unsized-inherent-impl-self-type.rs b/src/test/compile-fail/unsized-inherent-impl-self-type.rs index 03d3d98b59f..a679bf77015 100644 --- a/src/test/compile-fail/unsized-inherent-impl-self-type.rs +++ b/src/test/compile-fail/unsized-inherent-impl-self-type.rs @@ -15,7 +15,7 @@ struct S5(Y); impl S5 { - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type } fn main() { } diff --git a/src/test/compile-fail/unsized-struct.rs b/src/test/compile-fail/unsized-struct.rs index 8cb1f760664..f2c63455c51 100644 --- a/src/test/compile-fail/unsized-struct.rs +++ b/src/test/compile-fail/unsized-struct.rs @@ -15,14 +15,14 @@ fn not_sized() { } struct Foo { data: T } fn foo1() { not_sized::>() } // Hunky dory. fn foo2() { not_sized::>() } -//~^ ERROR the size for value values of type +//~^ ERROR the size for values of type // // Not OK: `T` is not sized. struct Bar { data: T } fn bar1() { not_sized::>() } fn bar2() { is_sized::>() } -//~^ ERROR the size for value values of type +//~^ ERROR the size for values of type // // Not OK: `Bar` is not sized, but it should be. diff --git a/src/test/compile-fail/unsized-trait-impl-self-type.rs b/src/test/compile-fail/unsized-trait-impl-self-type.rs index b3610a4c9b9..5c0b8f12402 100644 --- a/src/test/compile-fail/unsized-trait-impl-self-type.rs +++ b/src/test/compile-fail/unsized-trait-impl-self-type.rs @@ -18,7 +18,7 @@ trait T3 { struct S5(Y); impl T3 for S5 { - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type } fn main() { } diff --git a/src/test/compile-fail/unsized-trait-impl-trait-arg.rs b/src/test/compile-fail/unsized-trait-impl-trait-arg.rs index 50a058a4338..875a52e11c0 100644 --- a/src/test/compile-fail/unsized-trait-impl-trait-arg.rs +++ b/src/test/compile-fail/unsized-trait-impl-trait-arg.rs @@ -16,7 +16,7 @@ trait T2 { } struct S4(Box); impl T2 for S4 { - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type } fn main() { } diff --git a/src/test/compile-fail/unsized3.rs b/src/test/compile-fail/unsized3.rs index 945f20b2877..2e346e473ca 100644 --- a/src/test/compile-fail/unsized3.rs +++ b/src/test/compile-fail/unsized3.rs @@ -15,7 +15,7 @@ use std::marker; // Unbounded. fn f1(x: &X) { f2::(x); - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type } fn f2(x: &X) { } @@ -26,7 +26,7 @@ trait T { } fn f3(x: &X) { f4::(x); - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type } fn f4(x: &X) { } @@ -41,20 +41,20 @@ struct S { fn f8(x1: &S, x2: &S) { f5(x1); - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type f6(x2); // ok } // Test some tuples. fn f9(x1: Box>) { f5(&(*x1, 34)); - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type } fn f10(x1: Box>) { f5(&(32, *x1)); - //~^ ERROR the size for value values of type - //~| ERROR the size for value values of type + //~^ ERROR the size for values of type + //~| ERROR the size for values of type } pub fn main() { diff --git a/src/test/compile-fail/unsized5.rs b/src/test/compile-fail/unsized5.rs index e04aa3599e9..a50786e306a 100644 --- a/src/test/compile-fail/unsized5.rs +++ b/src/test/compile-fail/unsized5.rs @@ -12,32 +12,32 @@ struct S1 { f1: X, - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type f2: isize, } struct S2 { f: isize, g: X, - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type h: isize, } struct S3 { f: str, - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type g: [usize] } struct S4 { f: [u8], - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type g: usize } enum E { V1(X, isize), - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type } enum F { V2{f1: X, f: isize}, - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type } pub fn main() { diff --git a/src/test/compile-fail/unsized6.rs b/src/test/compile-fail/unsized6.rs index 8ac9fe4c587..1a57f2caf8d 100644 --- a/src/test/compile-fail/unsized6.rs +++ b/src/test/compile-fail/unsized6.rs @@ -15,40 +15,40 @@ trait T {} fn f1(x: &X) { let _: W; // <-- this is OK, no bindings created, no initializer. let _: (isize, (X, isize)); - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type let y: Y; - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type let y: (isize, (Z, usize)); - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type } fn f2(x: &X) { let y: X; - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type let y: (isize, (Y, isize)); - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type } fn f3(x1: Box, x2: Box, x3: Box) { let y: X = *x1; - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type let y = *x2; - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type let (y, z) = (*x3, 4); - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type } fn f4(x1: Box, x2: Box, x3: Box) { let y: X = *x1; - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type let y = *x2; - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type let (y, z) = (*x3, 4); - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type } fn g1(x: X) {} -//~^ ERROR the size for value values of type +//~^ ERROR the size for values of type fn g2(x: X) {} -//~^ ERROR the size for value values of type +//~^ ERROR the size for values of type pub fn main() { } diff --git a/src/test/compile-fail/unsized7.rs b/src/test/compile-fail/unsized7.rs index 44d7df35680..07b4ae4c394 100644 --- a/src/test/compile-fail/unsized7.rs +++ b/src/test/compile-fail/unsized7.rs @@ -20,7 +20,7 @@ trait T1 { struct S3(Box); impl T1 for S3 { - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type } fn main() { } diff --git a/src/test/ui/const-unsized.rs b/src/test/ui/const-unsized.rs index c0a367604c3..39ac969b80e 100644 --- a/src/test/ui/const-unsized.rs +++ b/src/test/ui/const-unsized.rs @@ -11,16 +11,16 @@ use std::fmt::Debug; const CONST_0: Debug+Sync = *(&0 as &(Debug+Sync)); -//~^ ERROR the size for value values of type +//~^ ERROR the size for values of type const CONST_FOO: str = *"foo"; -//~^ ERROR the size for value values of type +//~^ ERROR the size for values of type static STATIC_1: Debug+Sync = *(&1 as &(Debug+Sync)); -//~^ ERROR the size for value values of type +//~^ ERROR the size for values of type static STATIC_BAR: str = *"bar"; -//~^ ERROR the size for value values of type +//~^ ERROR the size for values of type fn main() { println!("{:?} {:?} {:?} {:?}", &CONST_0, &CONST_FOO, &STATIC_1, &STATIC_BAR); diff --git a/src/test/ui/const-unsized.stderr b/src/test/ui/const-unsized.stderr index d6fc5391ba8..e0b31510260 100644 --- a/src/test/ui/const-unsized.stderr +++ b/src/test/ui/const-unsized.stderr @@ -1,4 +1,4 @@ -error[E0277]: the size for value values of type `(dyn std::fmt::Debug + std::marker::Sync + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `(dyn std::fmt::Debug + std::marker::Sync + 'static)` cannot be known at compilation time --> $DIR/const-unsized.rs:13:29 | LL | const CONST_0: Debug+Sync = *(&0 as &(Debug+Sync)); @@ -8,7 +8,7 @@ LL | const CONST_0: Debug+Sync = *(&0 as &(Debug+Sync)); = note: to learn more, visit = note: constant expressions must have a statically known size -error[E0277]: the size for value values of type `str` cannot be known at compilation time +error[E0277]: the size for values of type `str` cannot be known at compilation time --> $DIR/const-unsized.rs:16:24 | LL | const CONST_FOO: str = *"foo"; @@ -18,7 +18,7 @@ LL | const CONST_FOO: str = *"foo"; = note: to learn more, visit = note: constant expressions must have a statically known size -error[E0277]: the size for value values of type `(dyn std::fmt::Debug + std::marker::Sync + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `(dyn std::fmt::Debug + std::marker::Sync + 'static)` cannot be known at compilation time --> $DIR/const-unsized.rs:19:31 | LL | static STATIC_1: Debug+Sync = *(&1 as &(Debug+Sync)); @@ -28,7 +28,7 @@ LL | static STATIC_1: Debug+Sync = *(&1 as &(Debug+Sync)); = note: to learn more, visit = note: constant expressions must have a statically known size -error[E0277]: the size for value values of type `str` cannot be known at compilation time +error[E0277]: the size for values of type `str` cannot be known at compilation time --> $DIR/const-unsized.rs:22:26 | LL | static STATIC_BAR: str = *"bar"; diff --git a/src/test/ui/error-codes/E0277.rs b/src/test/ui/error-codes/E0277.rs index 95f10e7206f..80cb5eb7a4b 100644 --- a/src/test/ui/error-codes/E0277.rs +++ b/src/test/ui/error-codes/E0277.rs @@ -21,7 +21,7 @@ fn some_func(foo: T) { } fn f(p: Path) { } -//~^ ERROR the size for value values of type +//~^ ERROR the size for values of type fn main() { some_func(5i32); diff --git a/src/test/ui/error-codes/E0277.stderr b/src/test/ui/error-codes/E0277.stderr index ca5b0d2b987..3ea057d7922 100644 --- a/src/test/ui/error-codes/E0277.stderr +++ b/src/test/ui/error-codes/E0277.stderr @@ -1,4 +1,4 @@ -error[E0277]: the size for value values of type `[u8]` cannot be known at compilation time +error[E0277]: the size for values of type `[u8]` cannot be known at compilation time --> $DIR/E0277.rs:23:6 | LL | fn f(p: Path) { } diff --git a/src/test/ui/feature-gate-trivial_bounds.stderr b/src/test/ui/feature-gate-trivial_bounds.stderr index 19a6a863795..52963671da9 100644 --- a/src/test/ui/feature-gate-trivial_bounds.stderr +++ b/src/test/ui/feature-gate-trivial_bounds.stderr @@ -87,7 +87,7 @@ LL | | } = help: see issue #48214 = help: add #![feature(trivial_bounds)] to the crate attributes to enable -error[E0277]: the size for value values of type `str` cannot be known at compilation time +error[E0277]: the size for values of type `str` cannot be known at compilation time --> $DIR/feature-gate-trivial_bounds.rs:62:1 | LL | struct TwoStrs(str, str) where str: Sized; //~ ERROR @@ -98,7 +98,7 @@ LL | struct TwoStrs(str, str) where str: Sized; //~ ERROR = help: see issue #48214 = help: add #![feature(trivial_bounds)] to the crate attributes to enable -error[E0277]: the size for value values of type `(dyn A + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `(dyn A + 'static)` cannot be known at compilation time --> $DIR/feature-gate-trivial_bounds.rs:65:1 | LL | / fn unsized_local() where Dst: Sized { //~ ERROR @@ -112,7 +112,7 @@ LL | | } = help: see issue #48214 = help: add #![feature(trivial_bounds)] to the crate attributes to enable -error[E0277]: the size for value values of type `str` cannot be known at compilation time +error[E0277]: the size for values of type `str` cannot be known at compilation time --> $DIR/feature-gate-trivial_bounds.rs:69:1 | LL | / fn return_str() -> str where str: Sized { //~ ERROR diff --git a/src/test/ui/generator/sized-yield.rs b/src/test/ui/generator/sized-yield.rs index efaee4095c1..461da94dde0 100644 --- a/src/test/ui/generator/sized-yield.rs +++ b/src/test/ui/generator/sized-yield.rs @@ -15,9 +15,9 @@ use std::ops::Generator; fn main() { let s = String::from("foo"); let mut gen = move || { - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type yield s[..]; }; unsafe { gen.resume(); } - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type } diff --git a/src/test/ui/generator/sized-yield.stderr b/src/test/ui/generator/sized-yield.stderr index 2938268a804..dfccd7c4d23 100644 --- a/src/test/ui/generator/sized-yield.stderr +++ b/src/test/ui/generator/sized-yield.stderr @@ -1,9 +1,9 @@ -error[E0277]: the size for value values of type `str` cannot be known at compilation time +error[E0277]: the size for values of type `str` cannot be known at compilation time --> $DIR/sized-yield.rs:17:26 | LL | let mut gen = move || { | __________________________^ -LL | | //~^ ERROR the size for value values of type +LL | | //~^ ERROR the size for values of type LL | | yield s[..]; LL | | }; | |____^ doesn't have a size known at compile-time @@ -12,7 +12,7 @@ LL | | }; = note: to learn more, visit = note: the yield type of a generator must have a statically known size -error[E0277]: the size for value values of type `str` cannot be known at compilation time +error[E0277]: the size for values of type `str` cannot be known at compilation time --> $DIR/sized-yield.rs:21:17 | LL | unsafe { gen.resume(); } diff --git a/src/test/ui/mismatched_types/cast-rfc0401.rs b/src/test/ui/mismatched_types/cast-rfc0401.rs index d76c4a015a2..6be6bb4391a 100644 --- a/src/test/ui/mismatched_types/cast-rfc0401.rs +++ b/src/test/ui/mismatched_types/cast-rfc0401.rs @@ -60,7 +60,7 @@ fn main() let _ = 42usize as *const [u8]; //~ ERROR is invalid let _ = v as *const [u8]; //~ ERROR cannot cast - let _ = fat_v as *const Foo; //~ ERROR the size for value values of type + let _ = fat_v as *const Foo; //~ ERROR the size for values of type let _ = foo as *const str; //~ ERROR is invalid let _ = foo as *mut str; //~ ERROR is invalid let _ = main as *mut str; //~ ERROR is invalid @@ -69,7 +69,7 @@ fn main() let _ = fat_sv as usize; //~ ERROR is invalid let a : *const str = "hello"; - let _ = a as *const Foo; //~ ERROR the size for value values of type + let _ = a as *const Foo; //~ ERROR the size for values of type // check no error cascade let _ = main.f as *const u32; //~ ERROR no field diff --git a/src/test/ui/mismatched_types/cast-rfc0401.stderr b/src/test/ui/mismatched_types/cast-rfc0401.stderr index 9335795f6b8..ef877d6e04e 100644 --- a/src/test/ui/mismatched_types/cast-rfc0401.stderr +++ b/src/test/ui/mismatched_types/cast-rfc0401.stderr @@ -216,20 +216,20 @@ LL | let _ = cf as *const Bar; //~ ERROR is invalid | = note: vtable kinds may not match -error[E0277]: the size for value values of type `[u8]` cannot be known at compilation time +error[E0277]: the size for values of type `[u8]` cannot be known at compilation time --> $DIR/cast-rfc0401.rs:63:13 | -LL | let _ = fat_v as *const Foo; //~ ERROR the size for value values of type +LL | let _ = fat_v as *const Foo; //~ ERROR the size for values of type | ^^^^^ doesn't have a size known at compile-time | = help: the trait `std::marker::Sized` is not implemented for `[u8]` = note: to learn more, visit = note: required for the cast to the object type `dyn Foo` -error[E0277]: the size for value values of type `str` cannot be known at compilation time +error[E0277]: the size for values of type `str` cannot be known at compilation time --> $DIR/cast-rfc0401.rs:72:13 | -LL | let _ = a as *const Foo; //~ ERROR the size for value values of type +LL | let _ = a as *const Foo; //~ ERROR the size for values of type | ^ doesn't have a size known at compile-time | = help: the trait `std::marker::Sized` is not implemented for `str` diff --git a/src/test/ui/resolve/issue-5035-2.rs b/src/test/ui/resolve/issue-5035-2.rs index ca854f9f701..5e465ca18f4 100644 --- a/src/test/ui/resolve/issue-5035-2.rs +++ b/src/test/ui/resolve/issue-5035-2.rs @@ -12,6 +12,6 @@ trait I {} type K = I+'static; fn foo(_x: K) {} -//~^ ERROR the size for value values of type +//~^ ERROR the size for values of type fn main() {} diff --git a/src/test/ui/resolve/issue-5035-2.stderr b/src/test/ui/resolve/issue-5035-2.stderr index 72bd270165f..7c1ebc353ac 100644 --- a/src/test/ui/resolve/issue-5035-2.stderr +++ b/src/test/ui/resolve/issue-5035-2.stderr @@ -1,4 +1,4 @@ -error[E0277]: the size for value values of type `(dyn I + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `(dyn I + 'static)` cannot be known at compilation time --> $DIR/issue-5035-2.rs:14:8 | LL | fn foo(_x: K) {} diff --git a/src/test/ui/suggestions/str-array-assignment.rs b/src/test/ui/suggestions/str-array-assignment.rs index 8fbab402232..9d6cf5fe598 100644 --- a/src/test/ui/suggestions/str-array-assignment.rs +++ b/src/test/ui/suggestions/str-array-assignment.rs @@ -15,7 +15,7 @@ fn main() { let u: &str = if true { s[..2] } else { s }; //~^ ERROR mismatched types let v = s[..2]; - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type let w: &str = s[..2]; //~^ ERROR mismatched types } diff --git a/src/test/ui/suggestions/str-array-assignment.stderr b/src/test/ui/suggestions/str-array-assignment.stderr index 5af936eec5b..e0576cee8f5 100644 --- a/src/test/ui/suggestions/str-array-assignment.stderr +++ b/src/test/ui/suggestions/str-array-assignment.stderr @@ -19,7 +19,7 @@ LL | let u: &str = if true { s[..2] } else { s }; = note: expected type `&str` found type `str` -error[E0277]: the size for value values of type `str` cannot be known at compilation time +error[E0277]: the size for values of type `str` cannot be known at compilation time --> $DIR/str-array-assignment.rs:17:7 | LL | let v = s[..2]; diff --git a/src/test/ui/trait-suggest-where-clause.rs b/src/test/ui/trait-suggest-where-clause.rs index dd74f4f4797..a43b75d2fe8 100644 --- a/src/test/ui/trait-suggest-where-clause.rs +++ b/src/test/ui/trait-suggest-where-clause.rs @@ -15,10 +15,10 @@ struct Misc(T); fn check() { // suggest a where-clause, if needed mem::size_of::(); - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type mem::size_of::>(); - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type // ... even if T occurs as a type parameter @@ -36,10 +36,10 @@ fn check() { // ... and also not if the error is not related to the type mem::size_of::<[T]>(); - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type mem::size_of::<[&U]>(); - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type } fn main() { diff --git a/src/test/ui/trait-suggest-where-clause.stderr b/src/test/ui/trait-suggest-where-clause.stderr index feb31ae22d8..f62e43e2a46 100644 --- a/src/test/ui/trait-suggest-where-clause.stderr +++ b/src/test/ui/trait-suggest-where-clause.stderr @@ -1,4 +1,4 @@ -error[E0277]: the size for value values of type `U` cannot be known at compilation time +error[E0277]: the size for values of type `U` cannot be known at compilation time --> $DIR/trait-suggest-where-clause.rs:17:5 | LL | mem::size_of::(); @@ -9,7 +9,7 @@ LL | mem::size_of::(); = help: consider adding a `where U: std::marker::Sized` bound = note: required by `std::mem::size_of` -error[E0277]: the size for value values of type `U` cannot be known at compilation time +error[E0277]: the size for values of type `U` cannot be known at compilation time --> $DIR/trait-suggest-where-clause.rs:20:5 | LL | mem::size_of::>(); @@ -47,7 +47,7 @@ LL | as From>::from; | = note: required by `std::convert::From::from` -error[E0277]: the size for value values of type `[T]` cannot be known at compilation time +error[E0277]: the size for values of type `[T]` cannot be known at compilation time --> $DIR/trait-suggest-where-clause.rs:38:5 | LL | mem::size_of::<[T]>(); @@ -57,7 +57,7 @@ LL | mem::size_of::<[T]>(); = note: to learn more, visit = note: required by `std::mem::size_of` -error[E0277]: the size for value values of type `[&U]` cannot be known at compilation time +error[E0277]: the size for values of type `[&U]` cannot be known at compilation time --> $DIR/trait-suggest-where-clause.rs:41:5 | LL | mem::size_of::<[&U]>(); diff --git a/src/test/ui/trivial-bounds-leak.stderr b/src/test/ui/trivial-bounds-leak.stderr index d08574c3d87..960123b5d3a 100644 --- a/src/test/ui/trivial-bounds-leak.stderr +++ b/src/test/ui/trivial-bounds-leak.stderr @@ -1,4 +1,4 @@ -error[E0277]: the size for value values of type `str` cannot be known at compilation time +error[E0277]: the size for values of type `str` cannot be known at compilation time --> $DIR/trivial-bounds-leak.rs:22:25 | LL | fn cant_return_str() -> str { //~ ERROR diff --git a/src/test/ui/union/union-sized-field.rs b/src/test/ui/union/union-sized-field.rs index 15822ae4299..66d6632ff5a 100644 --- a/src/test/ui/union/union-sized-field.rs +++ b/src/test/ui/union/union-sized-field.rs @@ -12,18 +12,18 @@ union Foo { value: T, - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type } struct Foo2 { value: T, - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type t: u32, } enum Foo3 { Value(T), - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type } fn main() {} diff --git a/src/test/ui/union/union-sized-field.stderr b/src/test/ui/union/union-sized-field.stderr index c6b7cf4e078..2b1f4b4e8f3 100644 --- a/src/test/ui/union/union-sized-field.stderr +++ b/src/test/ui/union/union-sized-field.stderr @@ -1,4 +1,4 @@ -error[E0277]: the size for value values of type `T` cannot be known at compilation time +error[E0277]: the size for values of type `T` cannot be known at compilation time --> $DIR/union-sized-field.rs:14:5 | LL | value: T, @@ -9,7 +9,7 @@ LL | value: T, = help: consider adding a `where T: std::marker::Sized` bound = note: no field of a union may have a dynamically sized type -error[E0277]: the size for value values of type `T` cannot be known at compilation time +error[E0277]: the size for values of type `T` cannot be known at compilation time --> $DIR/union-sized-field.rs:19:5 | LL | value: T, @@ -20,7 +20,7 @@ LL | value: T, = help: consider adding a `where T: std::marker::Sized` bound = note: only the last field of a struct may have a dynamically sized type -error[E0277]: the size for value values of type `T` cannot be known at compilation time +error[E0277]: the size for values of type `T` cannot be known at compilation time --> $DIR/union-sized-field.rs:25:11 | LL | Value(T), diff --git a/src/test/ui/unsized-enum2.rs b/src/test/ui/unsized-enum2.rs index 9082ea4abdd..dadcc4206c3 100644 --- a/src/test/ui/unsized-enum2.rs +++ b/src/test/ui/unsized-enum2.rs @@ -31,53 +31,53 @@ struct Path4(PathHelper4); enum E { // parameter VA(W), - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type VB{x: X}, - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type VC(isize, Y), - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type VD{u: isize, x: Z}, - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type // slice / str VE([u8]), - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type VF{x: str}, - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type VG(isize, [f32]), - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type VH{u: isize, x: [u32]}, - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type // unsized struct VI(Path1), - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type VJ{x: Path2}, - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type VK(isize, Path3), - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type VL{u: isize, x: Path4}, - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type // plain trait VM(Foo), - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type VN{x: Bar}, - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type VO(isize, FooBar), - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type VP{u: isize, x: BarFoo}, - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type // projected VQ(<&'static [i8] as Deref>::Target), - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type VR{x: <&'static [char] as Deref>::Target}, - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type VS(isize, <&'static [f64] as Deref>::Target), - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type VT{u: isize, x: <&'static [i32] as Deref>::Target}, - //~^ ERROR the size for value values of type + //~^ ERROR the size for values of type } diff --git a/src/test/ui/unsized-enum2.stderr b/src/test/ui/unsized-enum2.stderr index 1f30c815d30..47d75f33851 100644 --- a/src/test/ui/unsized-enum2.stderr +++ b/src/test/ui/unsized-enum2.stderr @@ -1,4 +1,4 @@ -error[E0277]: the size for value values of type `W` cannot be known at compilation time +error[E0277]: the size for values of type `W` cannot be known at compilation time --> $DIR/unsized-enum2.rs:33:8 | LL | VA(W), @@ -9,7 +9,7 @@ LL | VA(W), = help: consider adding a `where W: std::marker::Sized` bound = note: no field of an enum variant may have a dynamically sized type -error[E0277]: the size for value values of type `X` cannot be known at compilation time +error[E0277]: the size for values of type `X` cannot be known at compilation time --> $DIR/unsized-enum2.rs:35:8 | LL | VB{x: X}, @@ -20,7 +20,7 @@ LL | VB{x: X}, = help: consider adding a `where X: std::marker::Sized` bound = note: no field of an enum variant may have a dynamically sized type -error[E0277]: the size for value values of type `Y` cannot be known at compilation time +error[E0277]: the size for values of type `Y` cannot be known at compilation time --> $DIR/unsized-enum2.rs:37:15 | LL | VC(isize, Y), @@ -31,7 +31,7 @@ LL | VC(isize, Y), = help: consider adding a `where Y: std::marker::Sized` bound = note: no field of an enum variant may have a dynamically sized type -error[E0277]: the size for value values of type `Z` cannot be known at compilation time +error[E0277]: the size for values of type `Z` cannot be known at compilation time --> $DIR/unsized-enum2.rs:39:18 | LL | VD{u: isize, x: Z}, @@ -42,7 +42,7 @@ LL | VD{u: isize, x: Z}, = help: consider adding a `where Z: std::marker::Sized` bound = note: no field of an enum variant may have a dynamically sized type -error[E0277]: the size for value values of type `[u8]` cannot be known at compilation time +error[E0277]: the size for values of type `[u8]` cannot be known at compilation time --> $DIR/unsized-enum2.rs:43:8 | LL | VE([u8]), @@ -52,7 +52,7 @@ LL | VE([u8]), = note: to learn more, visit = note: no field of an enum variant may have a dynamically sized type -error[E0277]: the size for value values of type `str` cannot be known at compilation time +error[E0277]: the size for values of type `str` cannot be known at compilation time --> $DIR/unsized-enum2.rs:45:8 | LL | VF{x: str}, @@ -62,7 +62,7 @@ LL | VF{x: str}, = note: to learn more, visit = note: no field of an enum variant may have a dynamically sized type -error[E0277]: the size for value values of type `[f32]` cannot be known at compilation time +error[E0277]: the size for values of type `[f32]` cannot be known at compilation time --> $DIR/unsized-enum2.rs:47:15 | LL | VG(isize, [f32]), @@ -72,7 +72,7 @@ LL | VG(isize, [f32]), = note: to learn more, visit = note: no field of an enum variant may have a dynamically sized type -error[E0277]: the size for value values of type `[u32]` cannot be known at compilation time +error[E0277]: the size for values of type `[u32]` cannot be known at compilation time --> $DIR/unsized-enum2.rs:49:18 | LL | VH{u: isize, x: [u32]}, @@ -82,7 +82,7 @@ LL | VH{u: isize, x: [u32]}, = note: to learn more, visit = note: no field of an enum variant may have a dynamically sized type -error[E0277]: the size for value values of type `(dyn Foo + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `(dyn Foo + 'static)` cannot be known at compilation time --> $DIR/unsized-enum2.rs:63:8 | LL | VM(Foo), @@ -92,7 +92,7 @@ LL | VM(Foo), = note: to learn more, visit = note: no field of an enum variant may have a dynamically sized type -error[E0277]: the size for value values of type `(dyn Bar + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `(dyn Bar + 'static)` cannot be known at compilation time --> $DIR/unsized-enum2.rs:65:8 | LL | VN{x: Bar}, @@ -102,7 +102,7 @@ LL | VN{x: Bar}, = note: to learn more, visit = note: no field of an enum variant may have a dynamically sized type -error[E0277]: the size for value values of type `(dyn FooBar + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `(dyn FooBar + 'static)` cannot be known at compilation time --> $DIR/unsized-enum2.rs:67:15 | LL | VO(isize, FooBar), @@ -112,7 +112,7 @@ LL | VO(isize, FooBar), = note: to learn more, visit = note: no field of an enum variant may have a dynamically sized type -error[E0277]: the size for value values of type `(dyn BarFoo + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `(dyn BarFoo + 'static)` cannot be known at compilation time --> $DIR/unsized-enum2.rs:69:18 | LL | VP{u: isize, x: BarFoo}, @@ -122,7 +122,7 @@ LL | VP{u: isize, x: BarFoo}, = note: to learn more, visit = note: no field of an enum variant may have a dynamically sized type -error[E0277]: the size for value values of type `[i8]` cannot be known at compilation time +error[E0277]: the size for values of type `[i8]` cannot be known at compilation time --> $DIR/unsized-enum2.rs:73:8 | LL | VQ(<&'static [i8] as Deref>::Target), @@ -132,7 +132,7 @@ LL | VQ(<&'static [i8] as Deref>::Target), = note: to learn more, visit = note: no field of an enum variant may have a dynamically sized type -error[E0277]: the size for value values of type `[char]` cannot be known at compilation time +error[E0277]: the size for values of type `[char]` cannot be known at compilation time --> $DIR/unsized-enum2.rs:75:8 | LL | VR{x: <&'static [char] as Deref>::Target}, @@ -142,7 +142,7 @@ LL | VR{x: <&'static [char] as Deref>::Target}, = note: to learn more, visit = note: no field of an enum variant may have a dynamically sized type -error[E0277]: the size for value values of type `[f64]` cannot be known at compilation time +error[E0277]: the size for values of type `[f64]` cannot be known at compilation time --> $DIR/unsized-enum2.rs:77:15 | LL | VS(isize, <&'static [f64] as Deref>::Target), @@ -152,7 +152,7 @@ LL | VS(isize, <&'static [f64] as Deref>::Target), = note: to learn more, visit = note: no field of an enum variant may have a dynamically sized type -error[E0277]: the size for value values of type `[i32]` cannot be known at compilation time +error[E0277]: the size for values of type `[i32]` cannot be known at compilation time --> $DIR/unsized-enum2.rs:79:18 | LL | VT{u: isize, x: <&'static [i32] as Deref>::Target}, @@ -162,7 +162,7 @@ LL | VT{u: isize, x: <&'static [i32] as Deref>::Target}, = note: to learn more, visit = note: no field of an enum variant may have a dynamically sized type -error[E0277]: the size for value values of type `(dyn PathHelper1 + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `(dyn PathHelper1 + 'static)` cannot be known at compilation time --> $DIR/unsized-enum2.rs:53:8 | LL | VI(Path1), @@ -173,7 +173,7 @@ LL | VI(Path1), = note: required because it appears within the type `Path1` = note: no field of an enum variant may have a dynamically sized type -error[E0277]: the size for value values of type `(dyn PathHelper2 + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `(dyn PathHelper2 + 'static)` cannot be known at compilation time --> $DIR/unsized-enum2.rs:55:8 | LL | VJ{x: Path2}, @@ -184,7 +184,7 @@ LL | VJ{x: Path2}, = note: required because it appears within the type `Path2` = note: no field of an enum variant may have a dynamically sized type -error[E0277]: the size for value values of type `(dyn PathHelper3 + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `(dyn PathHelper3 + 'static)` cannot be known at compilation time --> $DIR/unsized-enum2.rs:57:15 | LL | VK(isize, Path3), @@ -195,7 +195,7 @@ LL | VK(isize, Path3), = note: required because it appears within the type `Path3` = note: no field of an enum variant may have a dynamically sized type -error[E0277]: the size for value values of type `(dyn PathHelper4 + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `(dyn PathHelper4 + 'static)` cannot be known at compilation time --> $DIR/unsized-enum2.rs:59:18 | LL | VL{u: isize, x: Path4}, From 90b3e2c1c8117965a6f7175987409b2ab4de8453 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 11 Jul 2018 00:36:31 +0200 Subject: [PATCH 7/9] Improve lint handling in rustdoc --- src/librustdoc/core.rs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/librustdoc/core.rs b/src/librustdoc/core.rs index 417a78b2a3a..0a56c639220 100644 --- a/src/librustdoc/core.rs +++ b/src/librustdoc/core.rs @@ -193,6 +193,17 @@ pub fn run_core(search_paths: SearchPaths, let intra_link_resolution_failure_name = lint::builtin::INTRA_DOC_LINK_RESOLUTION_FAILURE.name; let warnings_lint_name = lint::builtin::WARNINGS.name; let missing_docs = rustc_lint::builtin::MISSING_DOCS.name; + + // In addition to those specific lints, we also need to whitelist those given through + // command line, otherwise they'll get ignored and we don't want that. + let mut whitelisted_lints = vec![warnings_lint_name.to_owned(), + intra_link_resolution_failure_name.to_owned(), + missing_docs.to_owned()]; + + for (lint, _) in &cmd_lints { + whitelisted_lints.push(lint.clone()); + } + let lints = lint::builtin::HardwiredLints.get_lints() .into_iter() .chain(rustc_lint::SoftLints.get_lints().into_iter()) @@ -248,9 +259,7 @@ pub fn run_core(search_paths: SearchPaths, .filter_map(|lint| { // We don't want to whitelist *all* lints so let's // ignore those ones. - if lint.name == warnings_lint_name || - lint.name == intra_link_resolution_failure_name || - lint.name == missing_docs { + if whitelisted_lints.iter().any(|l| &lint.name == l) { None } else { Some(lint) From d2fb2fb2a5f58839eda54e5f347e0959ed6eec7c Mon Sep 17 00:00:00 2001 From: Corey Farwell Date: Tue, 10 Jul 2018 22:25:38 -0400 Subject: [PATCH 8/9] Avoid unwrapping in PanicInfo doc example. Fixes https://github.com/rust-lang/rust/issues/51768. --- src/libcore/panic.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/libcore/panic.rs b/src/libcore/panic.rs index 1b4129b99fc..10f02ca2fdc 100644 --- a/src/libcore/panic.rs +++ b/src/libcore/panic.rs @@ -30,7 +30,11 @@ use fmt; /// use std::panic; /// /// panic::set_hook(Box::new(|panic_info| { -/// println!("panic occurred: {:?}", panic_info.payload().downcast_ref::<&str>().unwrap()); +/// if let Some(s) = panic_info.payload().downcast_ref::<&str>() { +/// println!("panic occurred: {:?}", s); +/// } else { +/// println!("panic occurred"); +/// } /// })); /// /// panic!("Normal panic"); From 299ee4798cdb0f8a68879b9db097d743533f88f0 Mon Sep 17 00:00:00 2001 From: Felix Rabe Date: Wed, 11 Jul 2018 07:43:10 +0200 Subject: [PATCH 9/9] Fix typo in E0433 docs --- src/librustc_resolve/diagnostics.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustc_resolve/diagnostics.rs b/src/librustc_resolve/diagnostics.rs index 537333380fa..6593e239bc3 100644 --- a/src/librustc_resolve/diagnostics.rs +++ b/src/librustc_resolve/diagnostics.rs @@ -1256,7 +1256,7 @@ let map = HashMap::new(); ``` Please verify you didn't misspell the type/module's name or that you didn't -forgot to import it: +forget to import it: ```