rust icon indicating copy to clipboard operation
rust copied to clipboard

[WIP] Add support for custom allocator for `String`

Open zachs18 opened this issue 3 years ago • 9 comments
trafficstars

Roadmap for allocator support.

API Change Proposal: https://github.com/rust-lang/libs-team/issues/101

A subset/bring-to-current of #79500 utilizing a workaround(?) to the issue (#79499) that was blocking it. (Note: I previously tried rebasing that (2 year old) PR onto current master, which was not my best idea).

Necessary Todo:

  • [x] ~~Fix UI tests.~~ Done? (see my question below)
  • [x] Gdb/Lldb pretty-printing of String<A>.
  • [ ] Should impl StructuralEq for String<_> be re-added? This PR removes it (because it no longer derive(Eq)), but it may not be observable because String: !StructuralPartialEq
    • [ ] Also for FromUtf8Error<_>, but that derived both PartialEq and Eq so it had both StructuralPartialEq and StructuralEq.
    • (Future: This will also will apply to CString, which derives PartialEq and Eq.)
  • [ ] impl<A: Allocator> From<String<A>> to Box<str, A> breaks orphan rules? (because Box and str are fundamental?)
  • [ ] Add better ways to make a new non-empty String<A>?
    • fn String<A>::from_str_in(s: &str, alloc: A) -> String<A>?
    • Likewise fn str::to_string_in(alloc: A) -> String<A> (parallels slice::to_vec_in)
    • Or maybe add to_string_in to ToString? (Probably a non-starter, since that would make ToString not object-safe, unless we put a where Self: Sized, which would preclude str)
  • [ ] Other FIXMEs (implement or remove comments)
    • [ ] From<&String<A>> for String<A> where A: Clone or From<&String<A>> for String<B> where B: Default (I don't think both can exist).
    • [ ] FromIterator<_> for String, FromStr for String, and From<&str-like> for String could be for String<A> where A: Default.
    • [ ] impl const Default for String could be impl<A: _ + ~const Default> Default for String<A>, except that Global doesn't implement const Default currently (but I don't see any reason it couldn't).

Possible Todo

  • How to handle from_utf8_lossy, which returns a non-allocator-aware Cow<str>?
  • How to handle from_utf16(_lossy), which return String and Result<String, _>?
    • Could have them return String<A> where A: Default
    • Could add from_utf16(_lossy)_in, (#79500 only added from_utf16_in, not the lossy version)
  • (If specialization like this is sound), From<Cow<str>> for String<A> where A: Default could be implemented as from_str_in(&*cow, A::default()) , and specialized for A = Global to the current implementation cow.into_owned().

zachs18 avatar Sep 07 '22 23:09 zachs18

r? @Mark-Simulacrum

(rust-highfive has picked a reviewer for you, use r? to override)

rust-highfive avatar Sep 07 '22 23:09 rust-highfive

The job x86_64-gnu-llvm-13 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
..........................................................................iiiiiiiiiiiiii 176/13491
.....................i..................i............................................... 264/13491
........................................................................................ 352/13491
........................................................................................ 440/13491
.......................................FF.FF.....FF..................................... 528/13491
........................................................................................ 704/13491
.................................................................i...................... 792/13491
........................................................................i............... 880/13491
........................................................................................ 968/13491
........................................................................................ 968/13491
.........................................F.....F........................................ 1056/13491
........................................................................................ 1232/13491
.................................................................i...................... 1320/13491
........................................................................................ 1408/13491
....................................i................................................... 1496/13491
---
........................................................................................ 4840/13491
........................................................................................ 4928/13491
........................................................................................ 5016/13491
........................................................................................ 5104/13491
............................................................F.F......................... 5192/13491
.......F....i....................................................................i...... 5280/13491
........................................................................................ 5456/13491
........................................................................................ 5544/13491
........................................................................................ 5632/13491
........................................................................................ 5720/13491
---
........................................................................................ 6248/13491
........................................................................................ 6336/13491
......................................................................i................. 6424/13491
........................................................................................ 6512/13491
.F................................................................i................F.... 6600/13491
...........................................i............................................ 6776/13491
...........................................i............................................ 6776/13491
............ii.ii........i....i..................................F.....F................ 6864/13491
......i.....................................................................F........... 6952/13491
...........................i..................i.............i........................... 7128/13491
...............................i........................................................ 7216/13491
....................................................i................................... 7304/13491
........................................................................................ 7392/13491
---
........................i............................................................... 10912/13491
..................................iiiiii.i..iiiiii.i.................................... 11000/13491
........................................................................................ 11088/13491
........................................................................................ 11176/13491
..........................................F......FF..................................... 11264/13491
...F.................................................................................... 11352/13491
...................................F.................................................... 11440/13491
........................................................................................ 11616/13491
........................................................................................ 11616/13491
................F.....F................F...............F...................F............ 11704/13491
F...F..F.............F.................................................................. 11792/13491
.....................................F...........................................F...... 11880/13491
........................................................................................ 12056/13491
........................................................................................ 12056/13491
................................F....F.........F........................................ 12144/13491
..........................F............................................................. 12320/13491
........................................................................................ 12408/13491
........................................................................................ 12496/13491
........................................................................................ 12584/13491
........................................................................................ 12584/13491
...........................................i............................................ 12672/13491
........................................................................................ 12760/13491
.....................................F......F........................................... 12848/13491
........................................................................................ 13024/13491
........................................................................................ 13112/13491
........................................................................................ 13200/13491
........................................................................................ 13288/13491
---
10    |


The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/associated-types/hr-associated-type-bound-1/hr-associated-type-bound-1.stderr
To only update this specific test, also pass `--test-args associated-types/hr-associated-type-bound-1.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/associated-types/hr-associated-type-bound-1.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/associated-types/hr-associated-type-bound-1" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/associated-types/hr-associated-type-bound-1/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0277]: the trait bound `str: Clone` is not satisfied
   |
LL |     type U = str;
   |              ^^^ the trait `Clone` is not implemented for `str`
   |
   |
   = help: the trait `Clone` is implemented for `String<A>`
note: required by a bound in `X`
  --> /checkout/src/test/ui/associated-types/hr-associated-type-bound-1.rs:3:33
   |
LL | trait X<'a>
LL | where
LL | where
LL |     for<'b> <Self as X<'b>>::U: Clone,
   |                                 ^^^^^ required by this bound in `X`
error: aborting due to previous error

For more information about this error, try `rustc --explain E0277`.
------------------------------------------
---
10    |


The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/associated-types/hr-associated-type-bound-param-1/hr-associated-type-bound-param-1.stderr
To only update this specific test, also pass `--test-args associated-types/hr-associated-type-bound-param-1.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/associated-types/hr-associated-type-bound-param-1.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/associated-types/hr-associated-type-bound-param-1" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/associated-types/hr-associated-type-bound-param-1/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0277]: the trait bound `str: Clone` is not satisfied
   |
LL |     type V = str;
   |              ^^^ the trait `Clone` is not implemented for `str`
   |
   |
   = help: the trait `Clone` is implemented for `String<A>`
note: required by a bound in `Y`
  --> /checkout/src/test/ui/associated-types/hr-associated-type-bound-param-1.rs:4:36
   |
LL | trait Y<'a, T: ?Sized>
...
...
LL |     for<'b> <Self as Y<'b, T>>::V: Clone,
   |                                    ^^^^^ required by this bound in `Y`
error: aborting due to previous error

For more information about this error, try `rustc --explain E0277`.
------------------------------------------
------------------------------------------


---- [ui] src/test/ui/associated-types/hr-associated-type-bound-param-2.rs stdout ----
diff of stderr:

4 LL |     T: Z<'a, u16>,
5    |        ^^^^^^^^^^ the trait `Clone` is not implemented for `str`
-    = help: the trait `Clone` is implemented for `String`
+    = help: the trait `Clone` is implemented for `String<A>`
8 note: required by a bound in `Z`
9   --> $DIR/hr-associated-type-bound-param-2.rs:6:35
---
24 note: required by a bound in `Z`
25   --> $DIR/hr-associated-type-bound-param-2.rs:6:35
26    |

36 LL |     T: Z<'a, u16>,
37    |        ^^^^^^^^^^ the trait `Clone` is not implemented for `str`
-    = help: the trait `Clone` is implemented for `String`
+    = help: the trait `Clone` is implemented for `String<A>`
40 note: required by a bound in `Z`
41   --> $DIR/hr-associated-type-bound-param-2.rs:6:35
41   --> $DIR/hr-associated-type-bound-param-2.rs:6:35
42    |


The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/associated-types/hr-associated-type-bound-param-2/hr-associated-type-bound-param-2.stderr
To only update this specific test, also pass `--test-args associated-types/hr-associated-type-bound-param-2.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/associated-types/hr-associated-type-bound-param-2.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/associated-types/hr-associated-type-bound-param-2" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/associated-types/hr-associated-type-bound-param-2/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0277]: the trait bound `str: Clone` is not satisfied
   |
   |
LL |     T: Z<'a, u16>,
   |        ^^^^^^^^^^ the trait `Clone` is not implemented for `str`
   = help: the trait `Clone` is implemented for `String<A>`
note: required by a bound in `Z`
  --> /checkout/src/test/ui/associated-types/hr-associated-type-bound-param-2.rs:6:35
   |
   |
LL | trait Z<'a, T: ?Sized>
...
...
LL |     for<'b> <T as Z<'b, u16>>::W: Clone,
   |                                   ^^^^^ required by this bound in `Z`
error[E0277]: the trait bound `str: Clone` is not satisfied
  --> /checkout/src/test/ui/associated-types/hr-associated-type-bound-param-2.rs:15:14
   |
LL |     type W = str;
LL |     type W = str;
   |              ^^^ the trait `Clone` is not implemented for `str`
   |
   = help: the trait `Clone` is implemented for `String<A>`
note: required by a bound in `Z`
  --> /checkout/src/test/ui/associated-types/hr-associated-type-bound-param-2.rs:6:35
   |
LL | trait Z<'a, T: ?Sized>
...
...
LL |     for<'b> <T as Z<'b, u16>>::W: Clone,
   |                                   ^^^^^ required by this bound in `Z`
error[E0277]: the trait bound `str: Clone` is not satisfied
  --> /checkout/src/test/ui/associated-types/hr-associated-type-bound-param-2.rs:3:8
   |
   |
LL |     T: Z<'a, u16>,
   |        ^^^^^^^^^^ the trait `Clone` is not implemented for `str`
   = help: the trait `Clone` is implemented for `String<A>`
note: required by a bound in `Z`
  --> /checkout/src/test/ui/associated-types/hr-associated-type-bound-param-2.rs:6:35
   |
   |
LL | trait Z<'a, T: ?Sized>
...
...
LL |     for<'b> <T as Z<'b, u16>>::W: Clone,
   |                                   ^^^^^ required by this bound in `Z`
error: aborting due to 3 previous errors

For more information about this error, try `rustc --explain E0277`.
------------------------------------------
---
10    |


The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/associated-types/hr-associated-type-bound-param-3/hr-associated-type-bound-param-3.stderr
To only update this specific test, also pass `--test-args associated-types/hr-associated-type-bound-param-3.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/associated-types/hr-associated-type-bound-param-3.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/associated-types/hr-associated-type-bound-param-3" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/associated-types/hr-associated-type-bound-param-3/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0277]: the trait bound `str: Clone` is not satisfied
   |
LL |     type U = str;
   |              ^^^ the trait `Clone` is not implemented for `str`
   |
   |
   = help: the trait `Clone` is implemented for `String<A>`
note: required by a bound in `X`
  --> /checkout/src/test/ui/associated-types/hr-associated-type-bound-param-3.rs:4:33
   |
LL | trait X<'a, T>
...
...
LL |     for<'b> <T as X<'b, T>>::U: Clone,
   |                                 ^^^^^ required by this bound in `X`
error: aborting due to previous error

For more information about this error, try `rustc --explain E0277`.
------------------------------------------
---
26    |


The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/associated-types/hr-associated-type-bound-param-5/hr-associated-type-bound-param-5.stderr
To only update this specific test, also pass `--test-args associated-types/hr-associated-type-bound-param-5.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/associated-types/hr-associated-type-bound-param-5.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/associated-types/hr-associated-type-bound-param-5" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/associated-types/hr-associated-type-bound-param-5/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0277]: the trait bound `str: Clone` is not satisfied
   |
LL |     type U = str;
   |              ^^^ the trait `Clone` is not implemented for `str`
   |
   |
   = help: the trait `Clone` is implemented for `String<A>`
note: required by a bound in `X`
  --> /checkout/src/test/ui/associated-types/hr-associated-type-bound-param-5.rs:17:45
   |
LL | trait X<'a, T: Cycle + for<'b> X<'b, T>>
...
...
LL |     for<'b> <T::Next as X<'b, T::Next>>::U: Clone,
   |                                             ^^^^^ required by this bound in `X`
error[E0277]: the trait bound `str: Clone` is not satisfied
  --> /checkout/src/test/ui/associated-types/hr-associated-type-bound-param-5.rs:31:14
   |
LL |     type U = str;
LL |     type U = str;
   |              ^^^ the trait `Clone` is not implemented for `str`
   |
   = help: the trait `Clone` is implemented for `String<A>`
note: required by a bound in `X`
  --> /checkout/src/test/ui/associated-types/hr-associated-type-bound-param-5.rs:17:45
   |
LL | trait X<'a, T: Cycle + for<'b> X<'b, T>>
...
...
LL |     for<'b> <T::Next as X<'b, T::Next>>::U: Clone,
   |                                             ^^^^^ required by this bound in `X`
error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0277`.
------------------------------------------
---
10    |


The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/associated-types/hr-associated-type-bound-param-4/hr-associated-type-bound-param-4.stderr
To only update this specific test, also pass `--test-args associated-types/hr-associated-type-bound-param-4.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/associated-types/hr-associated-type-bound-param-4.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/associated-types/hr-associated-type-bound-param-4" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/associated-types/hr-associated-type-bound-param-4/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0277]: the trait bound `str: Clone` is not satisfied
   |
LL |     type U = str;
   |              ^^^ the trait `Clone` is not implemented for `str`
   |
   |
   = help: the trait `Clone` is implemented for `String<A>`
note: required by a bound in `X`
  --> /checkout/src/test/ui/associated-types/hr-associated-type-bound-param-4.rs:4:36
   |
LL | trait X<'a, T>
...
...
LL |     for<'b> <(T,) as X<'b, T>>::U: Clone,
   |                                    ^^^^^ required by this bound in `X`
error: aborting due to previous error

For more information about this error, try `rustc --explain E0277`.
------------------------------------------
------------------------------------------


---- [ui] src/test/ui/block-result/consider-removing-last-semi.rs stdout ----
diff of stderr:

8 LL |     0u8;
9 LL |     "bla".to_string();
+    |
+    = note: expected struct `String`
+            found unit type `()`
11 
11 
12 error[E0308]: mismatched types
13   --> $DIR/consider-removing-last-semi.rs:8:15

19 LL |     "this won't work".to_string();
20 LL |     "removeme".to_string();
+    |
+    = note: expected struct `String`
+            found unit type `()`
22 
---
To only update this specific test, also pass `--test-args block-result/consider-removing-last-semi.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/block-result/consider-removing-last-semi.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/block-result/consider-removing-last-semi" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/block-result/consider-removing-last-semi/auxiliary"
stdout: none
--- stderr -------------------------------
  --> /checkout/src/test/ui/block-result/consider-removing-last-semi.rs:3:15
   |
   |
LL | pub fn f() -> String {  //~ ERROR mismatched types
   |        -      ^^^^^^ expected struct `String`, found `()`
   |        |
   |        implicitly returns `()` as its body has no tail or `return` expression
LL |     0u8;
LL |     "bla".to_string();
   |
   = note: expected struct `String`
           found unit type `()`


error[E0308]: mismatched types
  --> /checkout/src/test/ui/block-result/consider-removing-last-semi.rs:8:15
   |
LL | pub fn g() -> String {  //~ ERROR mismatched types
   |        -      ^^^^^^ expected struct `String`, found `()`
   |        |
   |        implicitly returns `()` as its body has no tail or `return` expression
LL |     "this won't work".to_string();
LL |     "removeme".to_string();
   |
   = note: expected struct `String`
           found unit type `()`


error[E0308]: mismatched types
  --> /checkout/src/test/ui/block-result/consider-removing-last-semi.rs:13:25
   |
LL | pub fn macro_tests() -> u32 {  //~ ERROR mismatched types
   |        -----------      ^^^ expected `u32`, found `()`
   |        |
   |        implicitly returns `()` as its body has no tail or `return` expression
LL |     mac!();
   |           - help: remove this semicolon

error: aborting due to 3 previous errors
---
diff of stderr:

5    |    ---      ^^^^^^ expected struct `String`, found `()`
6    |    |
7    |    implicitly returns `()` as its body has no tail or `return` expression
+    = note: expected struct `String`
+            found unit type `()`
8 
9 error[E0308]: mismatched types
9 error[E0308]: mismatched types
10   --> $DIR/issue-13428.rs:11:13

16 LL |     "foobar".to_string()
17 LL |     ;
+    |
+    = note: expected struct `String`
+            found unit type `()`
19 
---
To only update this specific test, also pass `--test-args block-result/issue-13428.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/block-result/issue-13428.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/block-result/issue-13428" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/block-result/issue-13428/auxiliary"
stdout: none
--- stderr -------------------------------
  --> /checkout/src/test/ui/block-result/issue-13428.rs:3:13
   |
   |
LL | fn foo() -> String {  //~ ERROR mismatched types
   |    ---      ^^^^^^ expected struct `String`, found `()`
   |    |
   |    implicitly returns `()` as its body has no tail or `return` expression
   = note: expected struct `String`
           found unit type `()`

error[E0308]: mismatched types
error[E0308]: mismatched types
  --> /checkout/src/test/ui/block-result/issue-13428.rs:11:13
   |
LL | fn bar() -> String {  //~ ERROR mismatched types
   |    ---      ^^^^^^ expected struct `String`, found `()`
   |    |
   |    implicitly returns `()` as its body has no tail or `return` expression
LL |     "foobar".to_string()
LL |     ;
   |
   = note: expected struct `String`
           found unit type `()`

---
diff of stderr:

7    |                              type must be known at this point
8    |
9    = note: multiple `impl`s satisfying `String: PartialEq<_>` found in the `alloc` crate:
-            - impl PartialEq for String;
-            - impl<'a, 'b> PartialEq<&'a str> for String;
-            - impl<'a, 'b> PartialEq<Cow<'a, str>> for String;
-            - impl<'a, 'b> PartialEq<str> for String;
+            - impl<'a, 'b, A> PartialEq<&'a str> for String<A>
+              where A: Allocator;
+            - impl<'a, 'b, A> PartialEq<Cow<'a, str>> for String<A>
+              where A: Allocator;
+            - impl<'a, 'b, A> PartialEq<str> for String<A>
+              where A: Allocator;
+            - impl<A, B> PartialEq<String<B>> for String<A>
+              where A: Allocator, B: Allocator;
14 help: try using a fully qualified path to specify the expected types
15    |
16 LL |         if String::from("a") == <&str as TryInto<T>>::try_into("a").unwrap() {}

The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/inference/issue-72616/issue-72616.stderr
To update references, rerun the tests and pass the `--bless` flag
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args inference/issue-72616.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/inference/issue-72616.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/inference/issue-72616" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/inference/issue-72616/auxiliary"
stdout: none
--- stderr -------------------------------
  --> /checkout/src/test/ui/inference/issue-72616.rs:20:37
   |
   |
LL |         if String::from("a") == "a".try_into().unwrap() {}
   |                              |
   |                              type must be known at this point
   |
   |
   = note: multiple `impl`s satisfying `String: PartialEq<_>` found in the `alloc` crate:
           - impl<'a, 'b, A> PartialEq<&'a str> for String<A>
             where A: Allocator;
           - impl<'a, 'b, A> PartialEq<Cow<'a, str>> for String<A>
             where A: Allocator;
           - impl<'a, 'b, A> PartialEq<str> for String<A>
             where A: Allocator;
           - impl<A, B> PartialEq<String<B>> for String<A>
             where A: Allocator, B: Allocator;
help: try using a fully qualified path to specify the expected types
   |
LL |         if String::from("a") == <&str as TryInto<T>>::try_into("a").unwrap() {}
   |                                 +++++++++++++++++++++++++++++++   ~
error: aborting due to previous error

For more information about this error, try `rustc --explain E0283`.
------------------------------------------
------------------------------------------


---- [ui] src/test/ui/inference/issue-72690.rs stdout ----
diff of stderr:

2   --> $DIR/issue-72690.rs:7:5
3    |
4 LL |     String::from("x".as_ref());
-    |     ^^^^^^^^^^^^ cannot infer type for reference `&_`
+    |     ^^^^^^^^^^^^ cannot infer type for struct `String<_>`
6    |
-    = note: multiple `impl`s satisfying `String: From<&_>` found in the `alloc` crate:
+    = note: multiple `impl`s satisfying `String<_>: From<&_>` found in the `alloc` crate:
8            - impl<> From<&String> for String;
9            - impl<> From<&str> for String;

71   --> $DIR/issue-72690.rs:21:5
72    |
72    |
73 LL |     String::from("x".as_ref());
-    |     ^^^^^^^^^^^^ cannot infer type for reference `&_`
+    |     ^^^^^^^^^^^^ cannot infer type for struct `String<_>`
75    |
-    = note: multiple `impl`s satisfying `String: From<&_>` found in the `alloc` crate:
+    = note: multiple `impl`s satisfying `String<_>: From<&_>` found in the `alloc` crate:
77            - impl<> From<&String> for String;
78            - impl<> From<&str> for String;

97   --> $DIR/issue-72690.rs:28:5
98    |
98    |
99 LL |     String::from("x".as_ref());
-    |     ^^^^^^^^^^^^ cannot infer type for reference `&_`
+    |     ^^^^^^^^^^^^ cannot infer type for struct `String<_>`
101    |
-    = note: multiple `impl`s satisfying `String: From<&_>` found in the `alloc` crate:
+    = note: multiple `impl`s satisfying `String<_>: From<&_>` found in the `alloc` crate:
103            - impl<> From<&String> for String;
104            - impl<> From<&str> for String;

123   --> $DIR/issue-72690.rs:37:5
124    |
124    |
125 LL |     String::from("x".as_ref());
-    |     ^^^^^^^^^^^^ cannot infer type for reference `&_`
+    |     ^^^^^^^^^^^^ cannot infer type for struct `String<_>`
127    |
-    = note: multiple `impl`s satisfying `String: From<&_>` found in the `alloc` crate:
+    = note: multiple `impl`s satisfying `String<_>: From<&_>` found in the `alloc` crate:
129            - impl<> From<&String> for String;
130            - impl<> From<&str> for String;

149   --> $DIR/issue-72690.rs:46:5
150    |
150    |
151 LL |     String::from("x".as_ref());
-    |     ^^^^^^^^^^^^ cannot infer type for reference `&_`
+    |     ^^^^^^^^^^^^ cannot infer type for struct `String<_>`
153    |
-    = note: multiple `impl`s satisfying `String: From<&_>` found in the `alloc` crate:
+    = note: multiple `impl`s satisfying `String<_>: From<&_>` found in the `alloc` crate:
155            - impl<> From<&String> for String;
156            - impl<> From<&str> for String;

175   --> $DIR/issue-72690.rs:53:5
176    |
176    |
177 LL |     String::from("x".as_ref());
-    |     ^^^^^^^^^^^^ cannot infer type for reference `&_`
+    |     ^^^^^^^^^^^^ cannot infer type for struct `String<_>`
179    |
-    = note: multiple `impl`s satisfying `String: From<&_>` found in the `alloc` crate:
+    = note: multiple `impl`s satisfying `String<_>: From<&_>` found in the `alloc` crate:
181            - impl<> From<&String> for String;
182            - impl<> From<&str> for String;

201   --> $DIR/issue-72690.rs:62:5
202    |
202    |
203 LL |     String::from("x".as_ref());
-    |     ^^^^^^^^^^^^ cannot infer type for reference `&_`
+    |     ^^^^^^^^^^^^ cannot infer type for struct `String<_>`
205    |
-    = note: multiple `impl`s satisfying `String: From<&_>` found in the `alloc` crate:
+    = note: multiple `impl`s satisfying `String<_>: From<&_>` found in the `alloc` crate:
207            - impl<> From<&String> for String;
208            - impl<> From<&str> for String;


The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/inference/issue-72690/issue-72690.stderr
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/inference/issue-72690/issue-72690.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args inference/issue-72690.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/inference/issue-72690.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/inference/issue-72690" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/inference/issue-72690/auxiliary"
stdout: none
--- stderr -------------------------------
  --> /checkout/src/test/ui/inference/issue-72690.rs:7:5
   |
   |
LL |     String::from("x".as_ref()); //~ ERROR type annotations needed
   |     ^^^^^^^^^^^^ cannot infer type for struct `String<_>`
   |
   = note: multiple `impl`s satisfying `String<_>: From<&_>` found in the `alloc` crate:
           - impl<> From<&String> for String;
           - impl<> From<&str> for String;
error[E0283]: type annotations needed
  --> /checkout/src/test/ui/inference/issue-72690.rs:7:22
   |
   |
LL |     String::from("x".as_ref()); //~ ERROR type annotations needed
   |
   |
   = note: multiple `impl`s satisfying `str: AsRef<_>` found in the following crates: `core`, `std`:
           - impl AsRef<OsStr> for str;
           - impl AsRef<Path> for str;
           - impl AsRef<[u8]> for str;
           - impl AsRef<str> for str;
help: try using a fully qualified path to specify the expected types
   |
LL |     String::from(<str as AsRef<T>>::as_ref("x")); //~ ERROR type annotations needed
   |                  ++++++++++++++++++++++++++   ~
error[E0282]: type annotations needed
  --> /checkout/src/test/ui/inference/issue-72690.rs:12:6
   |
   |
LL |     |x| String::from("x".as_ref()); //~ ERROR type annotations needed
   |
   |
help: consider giving this closure parameter an explicit type
   |
LL |     |x: _| String::from("x".as_ref()); //~ ERROR type annotations needed

error[E0283]: type annotations needed
  --> /checkout/src/test/ui/inference/issue-72690.rs:12:26
   |
   |
LL |     |x| String::from("x".as_ref()); //~ ERROR type annotations needed
   |
   |
   = note: multiple `impl`s satisfying `str: AsRef<_>` found in the following crates: `core`, `std`:
           - impl AsRef<OsStr> for str;
           - impl AsRef<Path> for str;
           - impl AsRef<[u8]> for str;
           - impl AsRef<str> for str;
help: try using a fully qualified path to specify the expected types
   |
LL |     |x| String::from(<str as AsRef<T>>::as_ref("x")); //~ ERROR type annotations needed
   |                      ++++++++++++++++++++++++++   ~
error[E0283]: type annotations needed for `&T`
  --> /checkout/src/test/ui/inference/issue-72690.rs:17:9
   |
   |
LL |     let _ = "x".as_ref(); //~ ERROR type annotations needed
   |         ^       ------ type must be known at this point
   |
   = note: multiple `impl`s satisfying `str: AsRef<_>` found in the following crates: `core`, `std`:
           - impl AsRef<OsStr> for str;
           - impl AsRef<Path> for str;
           - impl AsRef<[u8]> for str;
           - impl AsRef<str> for str;
help: consider giving this pattern a type, where the type for type parameter `T` is specified
   |
LL |     let _: &T = "x".as_ref(); //~ ERROR type annotations needed

error[E0283]: type annotations needed
  --> /checkout/src/test/ui/inference/issue-72690.rs:21:5
   |
   |
LL |     String::from("x".as_ref()); //~ ERROR type annotations needed
   |     ^^^^^^^^^^^^ cannot infer type for struct `String<_>`
   |
   = note: multiple `impl`s satisfying `String<_>: From<&_>` found in the `alloc` crate:
           - impl<> From<&String> for String;
           - impl<> From<&str> for String;
error[E0283]: type annotations needed
  --> /checkout/src/test/ui/inference/issue-72690.rs:21:22
   |
   |
LL |     String::from("x".as_ref()); //~ ERROR type annotations needed
   |
   |
   = note: multiple `impl`s satisfying `str: AsRef<_>` found in the following crates: `core`, `std`:
           - impl AsRef<OsStr> for str;
           - impl AsRef<Path> for str;
           - impl AsRef<[u8]> for str;
           - impl AsRef<str> for str;
help: try using a fully qualified path to specify the expected types
   |
LL |     String::from(<str as AsRef<T>>::as_ref("x")); //~ ERROR type annotations needed
   |                  ++++++++++++++++++++++++++   ~
error[E0283]: type annotations needed
  --> /checkout/src/test/ui/inference/issue-72690.rs:28:5
   |
   |
LL |     String::from("x".as_ref()); //~ ERROR type annotations needed
   |     ^^^^^^^^^^^^ cannot infer type for struct `String<_>`
   |
   = note: multiple `impl`s satisfying `String<_>: From<&_>` found in the `alloc` crate:
           - impl<> From<&String> for String;
           - impl<> From<&str> for String;
error[E0283]: type annotations needed
  --> /checkout/src/test/ui/inference/issue-72690.rs:28:22
   |
   |
LL |     String::from("x".as_ref()); //~ ERROR type annotations needed
   |
   |
   = note: multiple `impl`s satisfying `str: AsRef<_>` found in the following crates: `core`, `std`:
           - impl AsRef<OsStr> for str;
           - impl AsRef<Path> for str;
           - impl AsRef<[u8]> for str;
           - impl AsRef<str> for str;
help: try using a fully qualified path to specify the expected types
   |
LL |     String::from(<str as AsRef<T>>::as_ref("x")); //~ ERROR type annotations needed
   |                  ++++++++++++++++++++++++++   ~
error[E0283]: type annotations needed
  --> /checkout/src/test/ui/inference/issue-72690.rs:37:5
   |
   |
LL |     String::from("x".as_ref()); //~ ERROR type annotations needed
   |     ^^^^^^^^^^^^ cannot infer type for struct `String<_>`
   |
   = note: multiple `impl`s satisfying `String<_>: From<&_>` found in the `alloc` crate:
           - impl<> From<&String> for String;
           - impl<> From<&str> for String;
error[E0283]: type annotations needed
  --> /checkout/src/test/ui/inference/issue-72690.rs:37:22
   |
   |
LL |     String::from("x".as_ref()); //~ ERROR type annotations needed
   |
   |
   = note: multiple `impl`s satisfying `str: AsRef<_>` found in the following crates: `core`, `std`:
           - impl AsRef<OsStr> for str;
           - impl AsRef<Path> for str;
           - impl AsRef<[u8]> for str;
           - impl AsRef<str> for str;
help: try using a fully qualified path to specify the expected types
   |
LL |     String::from(<str as AsRef<T>>::as_ref("x")); //~ ERROR type annotations needed
   |                  ++++++++++++++++++++++++++   ~
error[E0283]: type annotations needed
  --> /checkout/src/test/ui/inference/issue-72690.rs:46:5
   |
   |
LL |     String::from("x".as_ref()); //~ ERROR type annotations needed
   |     ^^^^^^^^^^^^ cannot infer type for struct `String<_>`
   |
   = note: multiple `impl`s satisfying `String<_>: From<&_>` found in the `alloc` crate:
           - impl<> From<&String> for String;
           - impl<> From<&str> for String;
error[E0283]: type annotations needed
  --> /checkout/src/test/ui/inference/issue-72690.rs:46:22
   |
   |
LL |     String::from("x".as_ref()); //~ ERROR type annotations needed
   |
   |
   = note: multiple `impl`s satisfying `str: AsRef<_>` found in the following crates: `core`, `std`:
           - impl AsRef<OsStr> for str;
           - impl AsRef<Path> for str;
           - impl AsRef<[u8]> for str;
           - impl AsRef<str> for str;
help: try using a fully qualified path to specify the expected types
   |
LL |     String::from(<str as AsRef<T>>::as_ref("x")); //~ ERROR type annotations needed
   |                  ++++++++++++++++++++++++++   ~
error[E0283]: type annotations needed
  --> /checkout/src/test/ui/inference/issue-72690.rs:53:5
   |
   |
LL |     String::from("x".as_ref()); //~ ERROR type annotations needed
   |     ^^^^^^^^^^^^ cannot infer type for struct `String<_>`
   |
   = note: multiple `impl`s satisfying `String<_>: From<&_>` found in the `alloc` crate:
           - impl<> From<&String> for String;
           - impl<> From<&str> for String;
error[E0283]: type annotations needed
  --> /checkout/src/test/ui/inference/issue-72690.rs:53:22
   |
   |
LL |     String::from("x".as_ref()); //~ ERROR type annotations needed
   |
   |
   = note: multiple `impl`s satisfying `str: AsRef<_>` found in the following crates: `core`, `std`:
           - impl AsRef<OsStr> for str;
           - impl AsRef<Path> for str;
           - impl AsRef<[u8]> for str;
           - impl AsRef<str> for str;
help: try using a fully qualified path to specify the expected types
   |
LL |     String::from(<str as AsRef<T>>::as_ref("x")); //~ ERROR type annotations needed
   |                  ++++++++++++++++++++++++++   ~
error[E0283]: type annotations needed
  --> /checkout/src/test/ui/inference/issue-72690.rs:62:5
   |
   |
LL |     String::from("x".as_ref()); //~ ERROR type annotations needed
   |     ^^^^^^^^^^^^ cannot infer type for struct `String<_>`
   |
   = note: multiple `impl`s satisfying `String<_>: From<&_>` found in the `alloc` crate:
           - impl<> From<&String> for String;
           - impl<> From<&str> for String;
error[E0283]: type annotations needed
  --> /checkout/src/test/ui/inference/issue-72690.rs:62:22
   |
   |
LL |     String::from("x".as_ref()); //~ ERROR type annotations needed
   |
   |
   = note: multiple `impl`s satisfying `str: AsRef<_>` found in the following crates: `core`, `std`:
           - impl AsRef<OsStr> for str;
           - impl AsRef<Path> for str;
           - impl AsRef<[u8]> for str;
           - impl AsRef<str> for str;
help: try using a fully qualified path to specify the expected types
   |
LL |     String::from(<str as AsRef<T>>::as_ref("x")); //~ ERROR type annotations needed
   |                  ++++++++++++++++++++++++++   ~
error: aborting due to 17 previous errors

Some errors have detailed explanations: E0282, E0283.
For more information about an error, try `rustc --explain E0282`.
---
To only update this specific test, also pass `--test-args inference/deref-suggestion.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/inference/deref-suggestion.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/inference/deref-suggestion" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/inference/deref-suggestion/auxiliary"
stdout: none
--- stderr -------------------------------
  --> /checkout/src/test/ui/inference/deref-suggestion.rs:8:9
   |
LL |     foo(s);
LL |     foo(s);
   |     --- ^- help: try using a conversion method: `.to_string()`
   |     |   |
   |     |   expected struct `String`, found `&String`
   |
   = note: expected struct `String`
           found reference `&String`
note: function defined here
note: function defined here
  --> /checkout/src/test/ui/inference/deref-suggestion.rs:5:4
   |
LL | fn foo(_: String) {}

error[E0308]: mismatched types
  --> /checkout/src/test/ui/inference/deref-suggestion.rs:14:10
   |
   |
LL |     foo3(u);
   |     ---- ^ expected `u32`, found `&u32`
   |     arguments to this function are incorrect
   |
note: function defined here
  --> /checkout/src/test/ui/inference/deref-suggestion.rs:12:4
  --> /checkout/src/test/ui/inference/deref-suggestion.rs:12:4
   |
LL | fn foo3(_: u32) {}
help: consider dereferencing the borrow
   |
LL |     foo3(*u);
   |          +
   |          +

error[E0308]: mismatched types
  --> /checkout/src/test/ui/inference/deref-suggestion.rs:30:9
   |
LL |     foo(&"aaa".to_owned());
   |     --- ^^^^^^^^^^^^^^^^^ expected struct `String`, found `&String`
   |     arguments to this function are incorrect
   |
   = note: expected struct `String`
           found reference `&String`
           found reference `&String`
note: function defined here
  --> /checkout/src/test/ui/inference/deref-suggestion.rs:5:4
   |
LL | fn foo(_: String) {}
help: consider removing the borrow
   |
   |
LL -     foo(&"aaa".to_owned());
LL +     foo("aaa".to_owned());

error[E0308]: mismatched types
  --> /checkout/src/test/ui/inference/deref-suggestion.rs:32:9
   |
   |
LL |     foo(&mut "aaa".to_owned());
   |     --- ^^^^^^^^^^^^^^^^^^^^^ expected struct `String`, found `&mut String`
   |     arguments to this function are incorrect
   |
   = note:         expected struct `String`
           found mutable reference `&mut String`
           found mutable reference `&mut String`
note: function defined here
  --> /checkout/src/test/ui/inference/deref-suggestion.rs:5:4
   |
LL | fn foo(_: String) {}
help: consider removing the borrow
   |
   |
LL -     foo(&mut "aaa".to_owned());
LL +     foo("aaa".to_owned());

error[E0308]: mismatched types
  --> /checkout/src/test/ui/inference/deref-suggestion.rs:34:10
   |
   |
LL |     foo3(borrow!(0));
   |     ---- ^^^^^^^^^^ expected `u32`, found `&{integer}`
   |     arguments to this function are incorrect
   |
note: function defined here
  --> /checkout/src/test/ui/inference/deref-suggestion.rs:12:4
  --> /checkout/src/test/ui/inference/deref-suggestion.rs:12:4
   |
LL | fn foo3(_: u32) {}

error[E0308]: mismatched types
  --> /checkout/src/test/ui/inference/deref-suggestion.rs:37:5
   |
   |
LL |     assert_eq!(3i32, &3i32);
   |     ^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `&i32`
   |
   = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0308]: mismatched types
  --> /checkout/src/test/ui/inference/deref-suggestion.rs:40:17
   |
   |
LL |     let s = S { u };
   |                 |
   |                 |
   |                 expected `&u32`, found integer
   |                 help: consider borrowing here: `u: &u`
error[E0308]: mismatched types
  --> /checkout/src/test/ui/inference/deref-suggestion.rs:42:20
   |
   |
LL |     let s = S { u: u };
   |                    |
   |                    |
   |                    expected `&u32`, found integer
   |                    help: consider borrowing here: `&u`
error[E0308]: mismatched types
  --> /checkout/src/test/ui/inference/deref-suggestion.rs:45:17
   |
   |
LL |     let r = R { i };
   |                 ^ expected `u32`, found `&{integer}`
help: consider dereferencing the borrow
   |
   |
LL |     let r = R { i: *i };

error[E0308]: mismatched types
  --> /checkout/src/test/ui/inference/deref-suggestion.rs:47:20
   |
   |
LL |     let r = R { i: i };
   |                    ^ expected `u32`, found `&{integer}`
help: consider dereferencing the borrow
   |
   |
LL |     let r = R { i: *i };

error[E0308]: mismatched types
  --> /checkout/src/test/ui/inference/deref-suggestion.rs:56:9
   |
   |
LL |         b
   |         ^ expected `i32`, found `&{integer}`
help: consider dereferencing the borrow
   |
LL |         *b
   |         +
   |         +

error[E0308]: mismatched types
  --> /checkout/src/test/ui/inference/deref-suggestion.rs:64:9
   |
LL |         b
   |         ^ expected `i32`, found `&{integer}`
help: consider dereferencing the borrow
   |
LL |         *b
   |         +
   |         +

error[E0308]: `if` and `else` have incompatible types
   |
LL |        let val = if true {
   |   _______________-
LL |  |         *a
LL |  |         *a
   |  |         -- expected because of this
LL |  |     } else if true {
   |  |____________^
LL | ||     //~^ ERROR incompatible types
LL | ||         b
LL | ||     } else {
LL | ||         &0
LL | ||     };
   | ||_____|
   | ||_____|
   | |______`if` and `else` have incompatible types
   |        expected `i32`, found `&{integer}`
error: aborting due to 13 previous errors

For more information about this error, try `rustc --explain E0308`.
------------------------------------------
------------------------------------------


---- [ui] src/test/ui/issues/issue-53348.rs stdout ----
diff of stderr:

6 LL |     for i in v {
7 LL |         a = *i.to_string();
8    |             ^^^^^^^^^^^^^^ expected struct `String`, found `str`
+    = note: expected struct `String`
+                 found type `str`
9 
10 error: aborting due to previous error
---
To only update this specific test, also pass `--test-args issues/issue-53348.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/issues/issue-53348.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-53348" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-53348/auxiliary"
stdout: none
--- stderr -------------------------------
  --> /checkout/src/test/ui/issues/issue-53348.rs:10:13
   |
LL |     let mut a = String::new(); //~ NOTE expected due to this value
   |                 ------------- expected due to this value
   |                 ------------- expected due to this value
LL |     for i in v {
LL |         a = *i.to_string();
   |             ^^^^^^^^^^^^^^ expected struct `String`, found `str`
   = note: expected struct `String`
                found type `str`

error: aborting due to previous error
---
To only update this specific test, also pass `--test-args issues/issue-61106.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/issues/issue-61106.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-61106" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-61106/auxiliary"
stdout: none
--- stderr -------------------------------
  --> /checkout/src/test/ui/issues/issue-61106.rs:3:9
   |
   |
LL |     foo(x.clone()); //~ ERROR mismatched types
   |     |   |
   |     |   expected `&str`, found struct `String`
   |     |   help: consider borrowing here: `&x`
   |     arguments to this function are incorrect
---

24 expected an expression of a different type. It can occur in several cases, the
25 most common being when calling a function and passing an argument which has a
26 different type than the matching type in the function declaration.
- "},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":621,"byte_end":622,"line_start":17,"line_end":17,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1;  // Error in the middle of line.","highlight_start":22,"highlight_end":23}],"label":"expected struct `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":612,"byte_end":618,"line_start":17,"line_end":17,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String = 1;  // Error in the middle of line.","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":622,"byte_end":622,"line_start":17,"line_end":17,"column_start":23,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1;  // Error in the middle of line.","highlight_start":23,"highlight_end":23}],"label":null,"suggested_replacement":".to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:17:22: error[E0308]: mismatched types
+ "},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":621,"byte_end":622,"line_start":17,"line_end":17,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1;  // Error in the middle of line.","highlight_start":22,"highlight_end":23}],"label":"expected struct `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":612,"byte_end":618,"line_start":17,"line_end":17,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String = 1;  // Error in the middle of line.","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected struct `String`
+      found type `{integer}`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":622,"byte_end":622,"line_start":17,"line_end":17,"column_start":23,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1;  // Error in the middle of line.","highlight_start":23,"highlight_end":23}],"label":null,"suggested_replacement":".to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:17:22: error[E0308]: mismatched types
29 {"message":"mismatched types","code":{"code":"E0308","explanation":"Expected type did not match the received type.
30 

52 expected an expression of a different type. It can occur in several cases, the
52 expected an expression of a different type. It can occur in several cases, the
53 most common being when calling a function and passing an argument which has a
54 different type than the matching type in the function declaration.
- "},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":681,"byte_end":682,"line_start":19,"line_end":19,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1","highlight_start":22,"highlight_end":23}],"label":"expected struct `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":672,"byte_end":678,"line_start":19,"line_end":19,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String = 1","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":682,"byte_end":682,"line_start":19,"line_end":19,"column_start":23,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1","highlight_start":23,"highlight_end":23}],"label":null,"suggested_replacement":".to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:19:22: error[E0308]: mismatched types
+ "},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":681,"byte_end":682,"line_start":19,"line_end":19,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1","highlight_start":22,"highlight_end":23}],"label":"expected struct `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":672,"byte_end":678,"line_start":19,"line_end":19,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String = 1","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected struct `String`
+      found type `{integer}`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":682,"byte_end":682,"line_start":19,"line_end":19,"column_start":23,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1","highlight_start":23,"highlight_end":23}],"label":null,"suggested_replacement":".to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:19:22: error[E0308]: mismatched types
57 {"message":"mismatched types","code":{"code":"E0308","explanation":"Expected type did not match the received type.
58 

80 expected an expression of a different type. It can occur in several cases, the
80 expected an expression of a different type. It can occur in several cases, the
81 most common being when calling a function and passing an argument which has a
82 different type than the matching type in the function declaration.
- "},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":745,"byte_end":746,"line_start":23,"line_end":23,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"1;  // Error after the newline.","highlight_start":1,"highlight_end":2}],"label":"expected struct `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":735,"byte_end":741,"line_start":22,"line_end":22,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String =","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":746,"byte_end":746,"line_start":23,"line_end":23,"column_start":2,"column_end":2,"is_primary":true,"text":[{"text":"1;  // Error after the newline.","highlight_start":2,"highlight_end":2}],"label":null,"suggested_replacement":".to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:23:1: error[E0308]: mismatched types
Some tests failed in compiletest suite=ui mode=ui host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu
+ "},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":745,"byte_end":746,"line_start":23,"line_end":23,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"1;  // Error after the newline.","highlight_start":1,"highlight_end":2}],"label":"expected struct `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":735,"byte_end":741,"line_start":22,"line_end":22,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String =","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected struct `String`
+      found type `{integer}`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":746,"byte_end":746,"line_start":23,"line_end":23,"column_start":2,"column_end":2,"is_primary":true,"text":[{"text":"1;  // Error after the newline.","highlight_start":2,"highlight_end":2}],"label":null,"suggested_replacement":".to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:23:1: error[E0308]: mismatched types
85 {"message":"mismatched types","code":{"code":"E0308","explanation":"Expected type did not match the received type.
86 

108 expected an expression of a different type. It can occur in several cases, the
108 expected an expression of a different type. It can occur in several cases, the
109 most common being when calling a function and passing an argument which has a
110 different type than the matching type in the function declaration.
- "},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":801,"byte_end":809,"line_start":25,"line_end":26,"column_start":22,"column_end":6,"is_primary":true,"text":[{"text":"    let s : String = (","highlight_start":22,"highlight_end":23},{"text":"    );  // Error spanning the newline.","highlight_start":1,"highlight_end":6}],"label":"expected struct `String`, found `()`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":792,"byte_end":798,"line_start":25,"line_end":25,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String = (","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:25:22: error[E0308]: mismatched types
+ "},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":801,"byte_end":809,"line_start":25,"line_end":26,"column_start":22,"column_end":6,"is_primary":true,"text":[{"text":"    let s : String = (","highlight_start":22,"highlight_end":23},{"text":"    );  // Error spanning the newline.","highlight_start":1,"highlight_end":6}],"label":"expected struct `String`, found `()`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":792,"byte_end":798,"line_start":25,"line_end":25,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String = (","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected struct `String`
+ found unit type `()`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:25:22: error[E0308]: mismatched types
113 {"message":"aborting due to 4 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 4 previous errors
114 "}



The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/json/json-bom-plus-crlf-multifile/json-bom-plus-crlf-multifile.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args json/json-bom-plus-crlf-multifile.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/json/json-bom-plus-crlf-multifile.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/json/json-bom-plus-crlf-multifile" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--json=diagnostic-short" "--error-format=json" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/json/json-bom-plus-crlf-multifile/auxiliary"
stdout: none
--- stderr -------------------------------
/checkout/src/test/ui/json/json-bom-plus-crlf-multifile-aux.rs:17:22: error[E0308]: mismatched types
/checkout/src/test/ui/json/json-bom-plus-crlf-multifile-aux.rs:19:22: error[E0308]: mismatched types
/checkout/src/test/ui/json/json-bom-plus-crlf-multifile-aux.rs:23:1: error[E0308]: mismatched types
/checkout/src/test/ui/json/json-bom-plus-crlf-multifile-aux.rs:25:22: error[E0308]: mismatched types
------------------------------------------


---- [ui] src/test/ui/json/json-bom-plus-crlf.rs stdout ----
---- [ui] src/test/ui/json/json-bom-plus-crlf.rs stdout ----
diff of stderr:

24 expected an expression of a different type. It can occur in several cases, the
25 most common being when calling a function and passing an argument which has a
26 different type than the matching type in the function declaration.
- "},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":606,"byte_end":607,"line_start":16,"line_end":16,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1;  // Error in the middle of line.","highlight_start":22,"highlight_end":23}],"label":"expected struct `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":597,"byte_end":603,"line_start":16,"line_end":16,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String = 1;  // Error in the middle of line.","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":607,"byte_end":607,"line_start":16,"line_end":16,"column_start":23,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1;  // Error in the middle of line.","highlight_start":23,"highlight_end":23}],"label":null,"suggested_replacement":".to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:16:22: error[E0308]: mismatched types
+ "},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":606,"byte_end":607,"line_start":16,"line_end":16,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1;  // Error in the middle of line.","highlight_start":22,"highlight_end":23}],"label":"expected struct `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":597,"byte_end":603,"line_start":16,"line_end":16,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String = 1;  // Error in the middle of line.","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected struct `String`
+      found type `{integer}`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":607,"byte_end":607,"line_start":16,"line_end":16,"column_start":23,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1;  // Error in the middle of line.","highlight_start":23,"highlight_end":23}],"label":null,"suggested_replacement":".to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:16:22: error[E0308]: mismatched types
29 {"message":"mismatched types","code":{"code":"E0308","explanation":"Expected type did not match the received type.
30 

52 expected an expression of a different type. It can occur in several cases, the
52 expected an expression of a different type. It can occur in several cases, the
53 most common being when calling a function and passing an argument which has a
54 different type than the matching type in the function declaration.
- "},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":666,"byte_end":667,"line_start":18,"line_end":18,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1","highlight_start":22,"highlight_end":23}],"label":"expected struct `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":657,"byte_end":663,"line_start":18,"line_end":18,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String = 1","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":667,"byte_end":667,"line_start":18,"line_end":18,"column_start":23,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1","highlight_start":23,"highlight_end":23}],"label":null,"suggested_replacement":".to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:18:22: error[E0308]: mismatched types
+ "},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":666,"byte_end":667,"line_start":18,"line_end":18,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1","highlight_start":22,"highlight_end":23}],"label":"expected struct `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":657,"byte_end":663,"line_start":18,"line_end":18,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String = 1","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected struct `String`
+      found type `{integer}`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":667,"byte_end":667,"line_start":18,"line_end":18,"column_start":23,"column_end":23,"is_primary":true,"text":[{"text":"    let s : String = 1","highlight_start":23,"highlight_end":23}],"label":null,"suggested_replacement":".to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:18:22: error[E0308]: mismatched types
57 {"message":"mismatched types","code":{"code":"E0308","explanation":"Expected type did not match the received type.
58 

80 expected an expression of a different type. It can occur in several cases, the
80 expected an expression of a different type. It can occur in several cases, the
81 most common being when calling a function and passing an argument which has a
82 different type than the matching type in the function declaration.
- "},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":730,"byte_end":731,"line_start":22,"line_end":22,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"1;  // Error after the newline.","highlight_start":1,"highlight_end":2}],"label":"expected struct `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":720,"byte_end":726,"line_start":21,"line_end":21,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String =","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":731,"byte_end":731,"line_start":22,"line_end":22,"column_start":2,"column_end":2,"is_primary":true,"text":[{"text":"1;  // Error after the newline.","highlight_start":2,"highlight_end":2}],"label":null,"suggested_replacement":".to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:22:1: error[E0308]: mismatched types
+ "},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":730,"byte_end":731,"line_start":22,"line_end":22,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"1;  // Error after the newline.","highlight_start":1,"highlight_end":2}],"label":"expected struct `String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":720,"byte_end":726,"line_start":21,"line_end":21,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String =","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected struct `String`
+      found type `{integer}`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":731,"byte_end":731,"line_start":22,"line_end":22,"column_start":2,"column_end":2,"is_primary":true,"text":[{"text":"1;  // Error after the newline.","highlight_start":2,"highlight_end":2}],"label":null,"suggested_replacement":".to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:22:1: error[E0308]: mismatched types
85 {"message":"mismatched types","code":{"code":"E0308","explanation":"Expected type did not match the received type.
86 

108 expected an expression of a different type. It can occur in several cases, the
108 expected an expression of a different type. It can occur in several cases, the
109 most common being when calling a function and passing an argument which has a
110 different type than the matching type in the function declaration.
- "},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":786,"byte_end":794,"line_start":24,"line_end":25,"column_start":22,"column_end":6,"is_primary":true,"text":[{"text":"    let s : String = (","highlight_start":22,"highlight_end":23},{"text":"    );  // Error spanning the newline.","highlight_start":1,"highlight_end":6}],"label":"expected struct `String`, found `()`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":777,"byte_end":783,"line_start":24,"line_end":24,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String = (","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"$DIR/json-bom-plus-crlf.rs:24:22: error[E0308]: mismatched types
+ "},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":786,"byte_end":794,"line_start":24,"line_end":25,"column_start":22,"column_end":6,"is_primary":true,"text":[{"text":"    let s : String = (","highlight_start":22,"highlight_end":23},{"text":"    );  // Error spanning the newline.","highlight_start":1,"highlight_end":6}],"label":"expected struct `String`, found `()`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":777,"byte_end":783,"line_start":24,"line_end":24,"column_start":13,"column_end":19,"is_primary":false,"text":[{"text":"    let s : String = (","highlight_start":13,"highlight_end":19}],"label":"expected due to this","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected struct `String`
+ found unit type `()`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:24:22: error[E0308]: mismatched types
113 {"message":"aborting due to 4 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 4 previous errors
114 "}



The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/json/json-bom-plus-crlf/json-bom-plus-crlf.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args json/json-bom-plus-crlf.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/json/json-bom-plus-crlf.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/json/json-bom-plus-crlf" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--json=diagnostic-short" "--error-format=json" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/json/json-bom-plus-crlf/auxiliary"
stdout: none
--- stderr -------------------------------
/checkout/src/test/ui/json/json-bom-plus-crlf.rs:16:22: error[E0308]: mismatched types
/checkout/src/test/ui/json/json-bom-plus-crlf.rs:18:22: error[E0308]: mismatched types
/checkout/src/test/ui/json/json-bom-plus-crlf.rs:22:1: error[E0308]: mismatched types
/checkout/src/test/ui/json/json-bom-plus-crlf.rs:24:22: error[E0308]: mismatched types
------------------------------------------


---- [ui] src/test/ui/lexer/lex-bad-char-literals-6.rs stdout ----
---- [ui] src/test/ui/lexer/lex-bad-char-literals-6.rs stdout ----
diff of stderr:

40    = help: the trait `PartialEq<char>` is not implemented for `&str`
41    = help: the following other types implement trait `PartialEq<Rhs>`:
42              <&'a str as PartialEq<OsString>>
-              <&'a str as PartialEq<String>>
+              <&'a str as PartialEq<String<A>>>
44              <&'b str as PartialEq<Cow<'a, str>>>
-              <String as PartialEq<&'a str>>
-              <String as PartialEq<Cow<'a, str>>>
-              <String as PartialEq<str>>
-              <String as PartialEq>
+              <String<A> as PartialEq<&'a str>>
+              <String<A> as PartialEq<Cow<'a, str>>>
+              <String<A> as PartialEq<String<B>>>
+              <String<A> as PartialEq<str>>
49              <str as PartialEq<Cow<'a, str>>>
51 


66    = help: the trait `PartialEq<char>` is not implemented for `&str`
67    = help: the following other types implement trait `PartialEq<Rhs>`:
68              <&'a str as PartialEq<OsString>>
-              <&'a str as PartialEq<String>>
+              <&'a str as PartialEq<String<A>>>
70              <&'b str as PartialEq<Cow<'a, str>>>
-              <String as PartialEq<&'a str>>
-              <String as PartialEq<Cow<'a, str>>>
-              <String as PartialEq<str>>
-              <String as PartialEq>
+              <String<A> as PartialEq<&'a str>>
+              <String<A> as PartialEq<Cow<'a, str>>>
+              <String<A> as PartialEq<String<B>>>
+              <String<A> as PartialEq<str>>
75              <str as PartialEq<Cow<'a, str>>>
77 


The actual stderr differed from the expected stderr.
The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/lexer/lex-bad-char-literals-6/lex-bad-char-literals-6.stderr
To only update this specific test, also pass `--test-args lexer/lex-bad-char-literals-6.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/lexer/lex-bad-char-literals-6.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/lexer/lex-bad-char-literals-6" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/lexer/lex-bad-char-literals-6/auxiliary"
stdout: none
--- stderr -------------------------------
error: character literal may only contain one codepoint
   |
   |
LL |     let x: &str = 'ab';
   |
   |
help: if you meant to write a `str` literal, use double quotes
   |
LL |     let x: &str = "ab";

error: character literal may only contain one codepoint
  --> /checkout/src/test/ui/lexer/lex-bad-char-literals-6.rs:4:19
   |
   |
LL |     let y: char = 'cd';
   |
   |
help: if you meant to write a `str` literal, use double quotes
   |
LL |     let y: char = "cd";

error: character literal may only contain one codepoint
  --> /checkout/src/test/ui/lexer/lex-bad-char-literals-6.rs:6:13
   |
   |
LL |     let z = 'ef';
   |
   |
help: if you meant to write a `str` literal, use double quotes
   |
LL |     let z = "ef";


error[E0277]: can't compare `&str` with `char`
   |
   |
LL |     if x == y {}
   |          ^^ no implementation for `&str == char`
   |
   = help: the trait `PartialEq<char>` is not implemented for `&str`
   = help: the following other types implement trait `PartialEq<Rhs>`:
             <&'a str as PartialEq<OsString>>
             <&'a str as PartialEq<String<A>>>
             <&'b str as PartialEq<Cow<'a, str>>>
             <String<A> as PartialEq<&'a str>>
             <String<A> as PartialEq<Cow<'a, str>>>
             <String<A> as PartialEq<String<B>>>
             <String<A> as PartialEq<str>>
             <str as PartialEq<Cow<'a, str>>>

error[E0308]: mismatched types
  --> /checkout/src/test/ui/lexer/lex-bad-char-literals-6.rs:15:20
   |
   |
LL |     let a: usize = "";
   |            -----   ^^ expected `usize`, found `&str`
   |            expected due to this


error[E0277]: can't compare `&str` with `char`
   |
   |
LL |     if x == z {}
   |          ^^ no implementation for `&str == char`
   |
   = help: the trait `PartialEq<char>` is not implemented for `&str`
   = help: the following other types implement trait `PartialEq<Rhs>`:
             <&'a str as PartialEq<OsString>>
             <&'a str as PartialEq<String<A>>>
             <&'b str as PartialEq<Cow<'a, str>>>
             <String<A> as PartialEq<&'a str>>
             <String<A> as PartialEq<Cow<'a, str>>>
             <String<A> as PartialEq<String<B>>>
             <String<A> as PartialEq<str>>
             <str as PartialEq<Cow<'a, str>>>

error: aborting due to 6 previous errors

Some errors have detailed explanations: E0277, E0308.
---
+    = note: expected struct `String`
+                 found type `{integer}`
85 help: try using a conversion method
86    |
87 LL |     (1+2).to_string()
95 LL |     -2
96    |     ^^ expected struct `String`, found integer
97    |
+    = note: expected struct `String`
+    = note: expected struct `String`
+                 found type `{integer}`
98 help: try using a conversion method
99    |
100 LL |     (-2).to_string()

The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/mismatched_types/abridged/abridged.stderr
To update references, rerun the tests and pass the `--bless` flag
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args mismatched_types/abridged.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/mismatched_types/abridged.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/mismatched_types/abridged" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/mismatched_types/abridged/auxiliary"
stdout: none
--- stderr -------------------------------
  --> /checkout/src/test/ui/mismatched_types/abridged.rs:16:5
   |
   |
LL | fn a() -> Foo {
   |           --- expected `Foo` because of return type
LL |     Some(Foo { bar: 1 }) //~ ERROR mismatched types
   |     ^^^^^^^^^^^^^^^^^^^^ expected struct `Foo`, found enum `Option`
   = note: expected struct `Foo`
                found enum `Option<Foo>`

error[E0308]: mismatched types
error[E0308]: mismatched types
  --> /checkout/src/test/ui/mismatched_types/abridged.rs:20:5
   |
LL | fn a2() -> Foo {
   |            --- expected `Foo` because of return type
LL |     Ok(Foo { bar: 1}) //~ ERROR mismatched types
   |     ^^^^^^^^^^^^^^^^^ expected struct `Foo`, found enum `Result`
   = note: expected struct `Foo`
   = note: expected struct `Foo`
                found enum `Result<Foo, _>`
error[E0308]: mismatched types
  --> /checkout/src/test/ui/mismatched_types/abridged.rs:24:5
   |
   |
LL | fn b() -> Option<Foo> {
   |           ----------- expected `Option<Foo>` because of return type
LL |     Foo { bar: 1 } //~ ERROR mismatched types
   |
   = note: expected enum `Option<Foo>`
            found struct `Foo`
help: try wrapping the expression in `Some`
help: try wrapping the expression in `Some`
   |
LL |     Some(Foo { bar: 1 }) //~ ERROR mismatched types

error[E0308]: mismatched types
  --> /checkout/src/test/ui/mismatched_types/abridged.rs:28:5
   |
   |
LL | fn c() -> Result<Foo, Bar> {
   |           ---------------- expected `Result<Foo, Bar>` because of return type
LL |     Foo { bar: 1 } //~ ERROR mismatched types
   |
   |
   = note: expected enum `Result<Foo, Bar>`
help: try wrapping the expression in `Ok`
   |
   |
LL |     Ok(Foo { bar: 1 }) //~ ERROR mismatched types

error[E0308]: mismatched types
  --> /checkout/src/test/ui/mismatched_types/abridged.rs:39:5
   |
   |
LL | fn d() -> X<X<String, String>, String> {
   |           ---------------------------- expected `X<X<String, String>, String>` because of return type
...
LL |     x //~ ERROR mismatched types
   |     ^ expected struct `String`, found integer
   |
   = note: expected struct `X<X<_, String>, String>`
              found struct `X<X<_, {integer}>, {integer}>`
error[E0308]: mismatched types
  --> /checkout/src/test/ui/mismatched_types/abridged.rs:50:5
   |
   |
LL | fn e() -> X<X<String, String>, String> {
   |           ---------------------------- expected `X<X<String, String>, String>` because of return type
...
LL |     x //~ ERROR mismatched types
   |     ^ expected struct `String`, found integer
   |
   = note: expected struct `X<X<_, String>, _>`
              found struct `X<X<_, {integer}>, _>`
error[E0308]: mismatched types
  --> /checkout/src/test/ui/mismatched_types/abridged.rs:54:5
   |
   |
LL | fn f() -> String {
   |           ------ expected `String` because of return type
LL |     1+2 //~ ERROR mismatched types
   |     ^^^ expected struct `String`, found integer
   = note: expected struct `String`
                found type `{integer}`
help: try using a conversion method
   |
   |
LL |     (1+2).to_string() //~ ERROR mismatched types
   |     +   +++++++++++++
error[E0308]: mismatched types
  --> /checkout/src/test/ui/mismatched_types/abridged.rs:59:5
   |
   |
LL | fn g() -> String {
   |           ------ expected `String` because of return type
LL |     -2 //~ ERROR mismatched types
   |     ^^ expected struct `String`, found integer
   = note: expected struct `String`
                found type `{integer}`
help: try using a conversion method
   |
   |
LL |     (-2).to_string() //~ ERROR mismatched types
   |     +  +++++++++++++
error: aborting due to 8 previous errors

For more information about this error, try `rustc --explain E0308`.
------------------------------------------
------------------------------------------


---- [ui] src/test/ui/pattern/pat-type-err-formal-param.rs stdout ----
diff of stderr:

5    |        ^^^^^^^^  ------ expected due to this
6    |        |
7    |        expected struct `String`, found struct `Tuple`
+    = note: expected struct `String`
+               found struct `Tuple`
8 
9 error: aborting due to previous error
---
To only update this specific test, also pass `--test-args pattern/pat-type-err-formal-param.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/pattern/pat-type-err-formal-param.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/pattern/pat-type-err-formal-param" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/pattern/pat-type-err-formal-param/auxiliary"
stdout: none
--- stderr -------------------------------
  --> /checkout/src/test/ui/pattern/pat-type-err-formal-param.rs:8:8
   |
   |
LL | fn foo(Tuple(_): String) {} //~ ERROR mismatched types
   |        ^^^^^^^^  ------ expected due to this
   |        |
   |        expected struct `String`, found struct `Tuple`
   = note: expected struct `String`
              found struct `Tuple`

error: aborting due to previous error
---
+    |
+    = note: expected reference `&str`
+                  found struct `String`
88 
89 error[E0369]: cannot add `String` to `&String`


The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/span/issue-39018/issue-39018.stderr
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/span/issue-39018/issue-39018.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args span/issue-39018.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/span/issue-39018.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/span/issue-39018" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/span/issue-39018/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0369]: cannot add `&str` to `&str`
   |
   |
LL |     let x = "Hello " + "World!";
   |             -------- ^ -------- &str
   |             |        |
   |             |        `+` cannot be used to concatenate two `&str` strings
   |             &str
   |
   = note: string concatenation requires an owned `String` on the left
help: create an owned `String` from a string reference
   |
LL |     let x = "Hello ".to_owned() + "World!";


error[E0369]: cannot add `World` to `World`
   |
   |
LL |     let y = World::Hello + World::Goodbye;
   |             ------------ ^ -------------- World
   |             World
   |
   |
note: an implementation of `Add<_>` might be missing for `World`
   |
   |
LL | enum World {
   | ^^^^^^^^^^ must implement `Add<_>`
  --> /checkout/library/core/src/ops/arith.rs:100:1
   |
   |
LL | pub trait Add<Rhs = Self> {


error[E0369]: cannot add `String` to `&str`
   |
   |
LL |     let x = "Hello " + "World!".to_owned();
   |             -------- ^ ------------------- String
   |             |        |
   |             |        `+` cannot be used to concatenate a `&str` with a `String`
   |             &str
   |
help: create an owned `String` on the left and add a borrow on the right
   |
LL |     let x = "Hello ".to_owned() + &"World!".to_owned();
   |                     +++++++++++   +

error[E0369]: cannot add `&String` to `&String`
   |
   |
LL |     let _ = &a + &b; //~ ERROR cannot add
   |             -- ^ -- &String
   |             |  |
   |             |  `+` cannot be used to concatenate two `&str` strings
   |             &String
   |
   = note: string concatenation requires an owned `String` on the left
help: remove the borrow to obtain an owned `String`
   |
LL -     let _ = &a + &b; //~ ERROR cannot add
LL +     let _ = a + &b; //~ ERROR cannot add


error[E0369]: cannot add `String` to `&String`
   |
   |
LL |     let _ = &a + b; //~ ERROR cannot add
   |             -- ^ - String
   |             |  |
   |             |  `+` cannot be used to concatenate a `&str` with a `String`
   |             &String
help: remove the borrow on the left and add one on the right
   |
   |
LL -     let _ = &a + b; //~ ERROR cannot add
LL +     let _ = a + &b; //~ ERROR cannot add

error[E0308]: mismatched types
  --> /checkout/src/test/ui/span/issue-39018.rs:29:17
   |
   |
LL |     let _ = a + b; //~ ERROR mismatched types
   |                 |
   |                 expected `&str`, found struct `String`
   |                 help: consider borrowing here: `&b`
   |
   |
   = note: expected reference `&str`
                 found struct `String`

error[E0369]: cannot add `String` to `&String`
   |
   |
LL |     let _ = e + b; //~ ERROR cannot add
   |             - ^ - String
   |             | |
   |             | `+` cannot be used to concatenate a `&str` with a `String`
   |             &String
   |
help: create an owned `String` on the left and add a borrow on the right
   |
LL |     let _ = e.to_owned() + &b; //~ ERROR cannot add
   |              +++++++++++   +

error[E0369]: cannot add `&String` to `&String`
   |
   |
LL |     let _ = e + &b; //~ ERROR cannot add
   |             - ^ -- &String
   |             | |
   |             | `+` cannot be used to concatenate two `&str` strings
   |             &String
   |
   = note: string concatenation requires an owned `String` on the left
help: create an owned `String` from a string reference
   |
LL |     let _ = e.to_owned() + &b; //~ ERROR cannot add

error[E0369]: cannot add `&str` to `&String`
  --> /checkout/src/test/ui/span/issue-39018.rs:32:15
   |
   |
LL |     let _ = e + d; //~ ERROR cannot add
   |             - ^ - &str
   |             | |
   |             | `+` cannot be used to concatenate two `&str` strings
   |             &String
   |
   = note: string concatenation requires an owned `String` on the left
help: create an owned `String` from a string reference
   |
LL |     let _ = e.to_owned() + d; //~ ERROR cannot add


error[E0369]: cannot add `&&str` to `&String`
   |
   |
LL |     let _ = e + &d; //~ ERROR cannot add
   |             - ^ -- &&str
   |             | |
   |             | `+` cannot be used to concatenate two `&str` strings
   |             &String
   |
   = note: string concatenation requires an owned `String` on the left
help: create an owned `String` from a string reference
   |
LL |     let _ = e.to_owned() + &d; //~ ERROR cannot add


error[E0369]: cannot add `&&str` to `&&str`
   |
   |
LL |     let _ = &c + &d; //~ ERROR cannot add
   |             -- ^ -- &&str
   |             &&str


error[E0369]: cannot add `&str` to `&&str`
   |
   |
LL |     let _ = &c + d; //~ ERROR cannot add
   |             -- ^ - &str
   |             &&str


error[E0369]: cannot add `&&str` to `&str`
   |
   |
LL |     let _ = c + &d; //~ ERROR cannot add
   |             - ^ -- &&str
   |             | |
   |             | `+` cannot be used to concatenate two `&str` strings
   |             &str
   |
   = note: string concatenation requires an owned `String` on the left
help: create an owned `String` from a string reference
   |
LL |     let _ = c.to_owned() + &d; //~ ERROR cannot add

error[E0369]: cannot add `&str` to `&str`
  --> /checkout/src/test/ui/span/issue-39018.rs:37:15
   |
   |
LL |     let _ = c + d; //~ ERROR cannot add
   |             - ^ - &str
   |             | |
   |             | `+` cannot be used to concatenate two `&str` strings
   |             &str
   |
   = note: string concatenation requires an owned `String` on the left
help: create an owned `String` from a string reference
   |
LL |     let _ = c.to_owned() + d; //~ ERROR cannot add

error: aborting due to 14 previous errors

Some errors have detailed explanations: E0308, E0369.
---
To only update this specific test, also pass `--test-args span/coerce-suggestions.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/span/coerce-suggestions.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/span/coerce-suggestions" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/span/coerce-suggestions/auxiliary"
stdout: none
--- stderr -------------------------------
  --> /checkout/src/test/ui/span/coerce-suggestions.rs:7:20
   |
LL |     let x: usize = String::new();
   |            -----   ^^^^^^^^^^^^^ expected `usize`, found struct `String`
---
                      found reference `&String`
note: function defined here
  --> /checkout/src/test/ui/span/coerce-suggestions.rs:1:4
   |
LL | fn test(_x: &mut String) {}

error[E0308]: mismatched types
  --> /checkout/src/test/ui/span/coerce-suggestions.rs:14:11
   |
---
                      found reference `&String`
note: function defined here
  --> /checkout/src/test/ui/span/coerce-suggestions.rs:3:4
   |
LL | fn test2(_x: &mut i32) {}

error[E0308]: mismatched types
  --> /checkout/src/test/ui/span/coerce-suggestions.rs:17:9
   |
   |
LL |     f = Box::new(f);
   |         ^^^^^^^^^^^ cyclic type of infinite size
help: consider unboxing the value
   |
   |
LL |     f = *Box::new(f);

error[E0308]: mismatched types
  --> /checkout/src/test/ui/span/coerce-suggestions.rs:21:9
   |
---

---- [ui] src/test/ui/span/issue-33884.rs stdout ----
diff of stderr:

4 LL |     stream.write_fmt(format!("message received"))
5    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `Arguments`, found struct `String`
+    = note: expected struct `Arguments<'_>`
+               found struct `String`
7    = note: this error originates in the macro `format` (in Nightly builds, run with -Z macro-backtrace for more info)
8 
---
To only update this specific test, also pass `--test-args span/issue-33884.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/span/issue-33884.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/span/issue-33884" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/span/issue-33884/auxiliary"
stdout: none
--- stderr -------------------------------
  --> /checkout/src/test/ui/span/issue-33884.rs:6:22
   |
   |
LL |     stream.write_fmt(format!("message received"))
   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `Arguments`, found struct `String`
   = note: expected struct `Arguments<'_>`
              found struct `String`
   = note: this error originates in the macro `format` (in Nightly builds, run with -Z macro-backtrace for more info)

---

14 LL |     default type U = str;
15    |                      ^^^ the trait `Clone` is not implemented for `str`
16    |
-    = help: the trait `Clone` is implemented for `String`
+    = help: the trait `Clone` is implemented for `String<A>`
18 note: required by a bound in `X::U`
20    |


The actual stderr differed from the expected stderr.
The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/specialization/default-associated-type-bound-1/default-associated-type-bound-1.stderr
To only update this specific test, also pass `--test-args specialization/default-associated-type-bound-1.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/specialization/default-associated-type-bound-1.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/specialization/default-associated-type-bound-1" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/specialization/default-associated-type-bound-1/auxiliary"
stdout: none
--- stderr -------------------------------
warning: the feature `specialization` is incomplete and may not be safe to use and/or cause compiler crashes
   |
LL | #![feature(specialization)]
   |            ^^^^^^^^^^^^^^
   |
---
   |
LL |     default type U = str;
   |                      ^^^ the trait `Clone` is not implemented for `str`
   |
   = help: the trait `Clone` is implemented for `String<A>`
note: required by a bound in `X::U`
   |
   |
LL |     type U: Clone;
   |             ^^^^^ required by this bound in `X::U`
error: aborting due to previous error; 1 warning emitted

For more information about this error, try `rustc --explain E0277`.
------------------------------------------
------------------------------------------


---- [ui] src/test/ui/static/bad-const-type.rs stdout ----
diff of stderr:

5    |                    ^^- help: try using a conversion method: `.to_string()`
7    |                    expected struct `String`, found integer
+    |
+    = note: expected struct `String`
+                 found type `{integer}`
---
To only update this specific test, also pass `--test-args static/bad-const-type.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/static/bad-const-type.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/static/bad-const-type" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/static/bad-const-type/auxiliary"
stdout: none
--- stderr -------------------------------
  --> /checkout/src/test/ui/static/bad-const-type.rs:1:20
   |
   |
LL | static i: String = 10;
   |                    ^^- help: try using a conversion method: `.to_string()`
   |                    expected struct `String`, found integer
   |
   = note: expected struct `String`
                found type `{integer}`
---

---- [ui] src/test/ui/suggestions/const-in-struct-pat.rs stdout ----
diff of stderr:

10    |                 expected struct `String`, found struct `foo`
11    |                 `foo` is interpreted as a unit struct, not a new binding
+    = note: expected struct `String`
+               found struct `foo`
13 help: bind the struct field to a different name instead
14    |
14    |
15 LL |     let Thing { foo: other_foo } = t;

The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/const-in-struct-pat/const-in-struct-pat.stderr
To update references, rerun the tests and pass the `--bless` flag
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args suggestions/const-in-struct-pat.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/suggestions/const-in-struct-pat.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/const-in-struct-pat" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/const-in-struct-pat/auxiliary"
stdout: none
--- stderr -------------------------------
  --> /checkout/src/test/ui/suggestions/const-in-struct-pat.rs:8:17
   |
LL | struct foo;
   | ---------- unit struct defined here
   | ---------- unit struct defined here
...
LL |     let Thing { foo } = t; //~ ERROR mismatched types
   |                 ^^^     - this expression has type `Thing`
   |                 expected struct `String`, found struct `foo`
   |                 expected struct `String`, found struct `foo`
   |                 `foo` is interpreted as a unit struct, not a new binding
   = note: expected struct `String`
              found struct `foo`
help: bind the struct field to a different name instead
   |
   |
LL |     let Thing { foo: other_foo } = t; //~ ERROR mismatched types

error: aborting due to previous error

For more information about this error, try `rustc --explain E0308`.
For more information about this error, try `rustc --explain E0308`.
------------------------------------------


---- [ui] src/test/ui/suggestions/chain-method-call-mutation-in-place.rs stdout ----
diff of stderr:

6 LL |     s.push_str("asdf")
7    |     ^^^^^^^^^^^^^^^^^^ expected struct `String`, found `()`
+    = note: expected struct `String`
+            found unit type `()`
+            found unit type `()`
9 note: method `push_str` modifies its receiver in-place
11    |


The actual stderr differed from the expected stderr.
The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/chain-method-call-mutation-in-place/chain-method-call-mutation-in-place.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args suggestions/chain-method-call-mutation-in-place.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/suggestions/chain-method-call-mutation-in-place.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/chain-method-call-mutation-in-place" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/chain-method-call-mutation-in-place/auxiliary"
stdout: none
--- stderr -------------------------------
  --> /checkout/src/test/ui/suggestions/chain-method-call-mutation-in-place.rs:3:5
   |
   |
LL | fn foo(mut s: String) -> String {
   |                          ------ expected `String` because of return type
LL |     s.push_str("asdf") //~ ERROR mismatched types
   |     ^^^^^^^^^^^^^^^^^^ expected struct `String`, found `()`
   = note: expected struct `String`
           found unit type `()`
           found unit type `()`
note: method `push_str` modifies its receiver in-place
   |
   |
LL |     s.push_str("asdf") //~ ERROR mismatched types
   |     - ^^^^^^^^ this call modifies `s` in-place
   |     you probably want to use this value after calling the method...
   |     you probably want to use this value after calling the method...
   = note: ...instead of the `()` output of method `push_str`
error: aborting due to previous error

For more information about this error, try `rustc --explain E0308`.
------------------------------------------
---
To only update this specific test, also pass `--test-args suggestions/dont-suggest-deref-inside-macro-issue-58298.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/suggestions/dont-suggest-deref-inside-macro-issue-58298.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/dont-suggest-deref-inside-macro-issue-58298" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/dont-suggest-deref-inside-macro-issue-58298/auxiliary"
stdout: none
--- stderr -------------------------------
  --> /checkout/src/test/ui/suggestions/dont-suggest-deref-inside-macro-issue-58298.rs:11:5
   |
   |
LL | /     intrinsic_match! {
LL | |         "abc"
LL | |     };
   | |_____^ expected `&str`, found struct `String`
   = note: expected reference `&str`
                 found struct `String`
   = note: this error originates in the macro `format` which comes from the expansion of the macro `intrinsic_match` (in Nightly builds, run with -Z macro-backtrace for more info)

---
+    = note: expected struct `String`
+            found reference `&String`
9 help: consider removing the borrow
10    |
11 LL -     let a: String = &String::from("a");
20    |            |
21    |            expected due to this
22    |
+    = note: expected struct `String`
+    = note: expected struct `String`
+            found reference `&String`
23 help: consider removing the borrow
24    |
25 LL -     let b: String = &format!("b");
34    |            |
35    |            expected due to this
36    |
+    = note:         expected struct `String`
+    = note:         expected struct `String`
+            found mutable reference `&mut String`
37 help: consider removing the borrow
38    |
39 LL -     let c: String = &mut format!("c");
48    |            |
49    |            expected due to this
50    |
+    = note:         expected struct `String`
+    = note:         expected struct `String`
+            found mutable reference `&mut String`
51 help: consider removing the borrow
52    |
53 LL -     let d: String = &mut (format!("d"));

The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/format-borrow/format-borrow.stderr
To update references, rerun the tests and pass the `--bless` flag
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args suggestions/format-borrow.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/suggestions/format-borrow.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/format-borrow" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/format-borrow/auxiliary"
stdout: none
--- stderr -------------------------------
  --> /checkout/src/test/ui/suggestions/format-borrow.rs:2:21
   |
   |
LL |     let a: String = &String::from("a");
   |            ------   ^^^^^^^^^^^^^^^^^^ expected struct `String`, found `&String`
   |            expected due to this
   |
   = note: expected struct `String`
           found reference `&String`
           found reference `&String`
help: consider removing the borrow
   |
LL -     let a: String = &String::from("a");
LL +     let a: String = String::from("a");

error[E0308]: mismatched types
  --> /checkout/src/test/ui/suggestions/format-borrow.rs:4:21
   |
   |
LL |     let b: String = &format!("b");
   |            ------   ^^^^^^^^^^^^^ expected struct `String`, found `&String`
   |            expected due to this
   |
   = note: expected struct `String`
           found reference `&String`
           found reference `&String`
help: consider removing the borrow
   |
LL -     let b: String = &format!("b");
LL +     let b: String = format!("b");

error[E0308]: mismatched types
  --> /checkout/src/test/ui/suggestions/format-borrow.rs:6:21
   |
   |
LL |     let c: String = &mut format!("c");
   |            ------   ^^^^^^^^^^^^^^^^^ expected struct `String`, found `&mut String`
   |            expected due to this
   |
   = note:         expected struct `String`
           found mutable reference `&mut String`
           found mutable reference `&mut String`
help: consider removing the borrow
   |
LL -     let c: String = &mut format!("c");
LL +     let c: String = format!("c");

error[E0308]: mismatched types
  --> /checkout/src/test/ui/suggestions/format-borrow.rs:8:21
   |
   |
LL |     let d: String = &mut (format!("d"));
   |            ------   ^^^^^^^^^^^^^^^^^^^ expected struct `String`, found `&mut String`
   |            expected due to this
   |
   = note:         expected struct `String`
           found mutable reference `&mut String`
           found mutable reference `&mut String`
help: consider removing the borrow
   |
LL -     let d: String = &mut (format!("d"));
LL +     let d: String = format!("d"));

error: aborting due to 4 previous errors

For more information about this error, try `rustc --explain E0308`.
For more information about this error, try `rustc --explain E0308`.
------------------------------------------


---- [ui] src/test/ui/suggestions/into-str.rs stdout ----
diff of stderr:

11              <String as From<&String>>
12              <String as From<&mut str>>
13              <String as From<&str>>
-              <String as From<Box<str>>>
15              <String as From<Cow<'a, str>>>
16              <String as From<char>>
+              <String<A> as From<Box<str, A>>>
17    = note: required for `String` to implement `Into<&str>`
18 note: required by a bound in `foo`


The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/into-str/into-str.stderr
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/into-str/into-str.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args suggestions/into-str.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/suggestions/into-str.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/into-str" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/into-str/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0277]: the trait bound `&str: From<String>` is not satisfied
   |
LL |     foo(String::new());
LL |     foo(String::new());
   |     --- ^^^^^^^^^^^^^ the trait `From<String>` is not implemented for `&str`
   |     required by a bound introduced by this call
   |
   |
   = note: to coerce a `String` into a `&str`, use `&*` as a prefix
   = help: the following other types implement trait `From<T>`:
             <String as From<&String>>
             <String as From<&mut str>>
             <String as From<&str>>
             <String as From<Cow<'a, str>>>
             <String as From<char>>
             <String<A> as From<Box<str, A>>>
   = note: required for `String` to implement `Into<&str>`
note: required by a bound in `foo`
   |
   |
LL | fn foo<'a, T>(_t: T) where T: Into<&'a str> {}
   |                               ^^^^^^^^^^^^^ required by this bound in `foo`
error: aborting due to previous error

For more information about this error, try `rustc --explain E0277`.
------------------------------------------
------------------------------------------


---- [ui] src/test/ui/suggestions/issue-59819.rs stdout ----
diff of stderr:

32    |            |        |
33    |            |        expected struct `String`, found struct `Bar`
+    |
+    = note: expected struct `String`
+               found struct `Bar`
35 
---
To only update this specific test, also pass `--test-args suggestions/issue-59819.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/suggestions/issue-59819.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/issue-59819" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/issue-59819/auxiliary"
stdout: none
--- stderr -------------------------------
  --> /checkout/src/test/ui/suggestions/issue-59819.rs:28:18
   |
   |
LL |     let y: i32 = x; //~ ERROR mismatched types
   |            ---   ^ expected `i32`, found struct `Foo`
   |            expected due to this
   |
help: consider dereferencing the type
   |
   |
LL |     let y: i32 = *x; //~ ERROR mismatched types

error[E0308]: mismatched types
  --> /checkout/src/test/ui/suggestions/issue-59819.rs:30:18
   |
   |
LL |     let b: i32 = a; //~ ERROR mismatched types
   |            ---   ^ expected `i32`, found `&{integer}`
   |            expected due to this
   |
help: consider dereferencing the borrow
   |
   |
LL |     let b: i32 = *a; //~ ERROR mismatched types

error[E0308]: mismatched types
  --> /checkout/src/test/ui/suggestions/issue-59819.rs:34:21
   |
   |
LL |     let g: String = f; //~ ERROR mismatched types
   |            ------   ^- help: try using a conversion method: `.to_string()`
   |            |        |
   |            |        expected struct `String`, found struct `Bar`
   |
   = note: expected struct `String`
              found struct `Bar`

---
+    = note: expected struct `String`
+            found reference `&str`
7 help: try using a conversion method
8    |
9 LL |         guts: guts.to_string(),
17    |                 |    |
18    |                 |    help: try using a conversion method: `to_string`
19    |                 expected struct `String`, found `&str`
+    |
---
To only update this specific test, also pass `--test-args suggestions/issue-52820.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/suggestions/issue-52820.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/issue-52820" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/issue-52820/auxiliary"
stdout: none
--- stderr -------------------------------
  --> /checkout/src/test/ui/suggestions/issue-52820.rs:12:9
   |
   |
LL |         guts, //~ ERROR mismatched types
   |         ^^^^ expected struct `String`, found `&str`
   = note: expected struct `String`
           found reference `&str`
help: try using a conversion method
   |
   |
LL |         guts: guts.to_string(), //~ ERROR mismatched types

error[E0308]: mismatched types
  --> /checkout/src/test/ui/suggestions/issue-52820.rs:13:17
   |
   |
LL |         brains: guts.clone(), //~ ERROR mismatched types
   |                 |    |
   |                 |    help: try using a conversion method: `to_string`
   |                 expected struct `String`, found `&str`
   |
---

---- [ui] src/test/ui/suggestions/issue-53692.rs stdout ----
diff of stderr:

20    |                 |        | help: try using a conversion method: `to_string`
21    |                 |        expected struct `String`, found `&str`
+    |
+    = note: expected struct `String`
+            found reference `&str`
23 
---
To only update this specific test, also pass `--test-args suggestions/issue-53692.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/suggestions/issue-53692.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/issue-53692" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/issue-53692/auxiliary"
stdout: none
--- stderr -------------------------------
  --> /checkout/src/test/ui/suggestions/issue-53692.rs:7:33
   |
   |
LL |     let items_clone: Vec<i32> = ref_items.clone();
   |                      |          |         |
   |                      |          |         help: try using a conversion method: `to_vec`
   |                      |          |         help: try using a conversion method: `to_vec`
   |                      |          expected struct `Vec`, found `&[i32]`
   |
   = note: expected struct `Vec<i32>`
           found reference `&[i32]`


error[E0308]: mismatched types
  --> /checkout/src/test/ui/suggestions/issue-53692.rs:14:26
   |
LL |     let string: String = s.clone();
   |                 ------   ^^-----^^
   |                 |        | |
   |                 |        | help: try using a conversion method: `to_string`
   |                 |        expected struct `String`, found `&str`
   |
   = note: expected struct `String`
           found reference `&str`

---

---- [ui] src/test/ui/suggestions/issue-83943.rs stdout ----
diff of stderr:

11    | |         expected struct `String`, found `&str`
12 LL | |     };
13    | |_____- `if` and `else` have incompatible types
+    = note: expected struct `String`
+            found reference `&str`
14 
15 error: aborting due to previous error
---
To only update this specific test, also pass `--test-args suggestions/issue-83943.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/suggestions/issue-83943.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/issue-83943" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/issue-83943/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0308]: `if` and `else` have incompatible types
   |
LL | /     if true {
LL | /     if true {
LL | |         "A".to_string()
LL | |     } else {
LL | |     } else {
LL | |         "B" //~ ERROR `if` and `else` have incompatible types
   | |         ^^^- help: try using a conversion method: `.to_string()`
   | |         expected struct `String`, found `&str`
LL | |     };
LL | |     };
   | |_____- `if` and `else` have incompatible types
   = note: expected struct `String`
           found reference `&str`

error: aborting due to previous error
---
+    = note: expected struct `String`
+            found unit type `()`
23 help: consider returning the local binding `s`
24    |
25 LL ~     let s: String = if let Some(s) = opt_str {
52 LL | |     } else {
53    | |_____^ expected struct `String`, found `()`
54    |
+    = note: expected struct `String`
+    = note: expected struct `String`
+            found unit type `()`
55 help: consider returning the local binding `s`
56    |
57 LL ~     let s: String = if let Some(s) = opt_str {
69 LL |           String::new()
70    |           ^^^^^^^^^^^^^ expected `()`, found struct `String`
71    |
+    = note: expected unit type `()`
+    = note: expected unit type `()`
+                  found struct `String`
72 help: consider returning the local binding `s`
73    |
74 LL ~     let s = if let Some(s) = opt_str {
82 LL |         Some(s) => {}
83    |                    ^^ expected struct `String`, found `()`
84    |
+    = note: expected struct `String`
+    = note: expected struct `String`
+            found unit type `()`
85 help: consider returning the local binding `s`
86    |
87 LL |         Some(s) => { s }
100 LL | |     };
101    | |_____- `match` arms have incompatible types
102    |
+    = note: expected unit type `()`
+    = note: expected unit type `()`
+                  found struct `String`
103 help: consider returning the local binding `s`
104    |
105 LL |         Some(s) => { s }

The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/return-bindings/return-bindings.stderr
To update references, rerun the tests and pass the `--bless` flag
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args suggestions/return-bindings.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/suggestions/return-bindings.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/return-bindings" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/return-bindings/auxiliary"
stdout: none
--- stderr -------------------------------
  --> /checkout/src/test/ui/suggestions/return-bindings.rs:3:17
   |
   |
LL | fn a(i: i32) -> i32 {}
   |    -            ^^^ expected `i32`, found `()`
   |    |
   |    implicitly returns `()` as its body has no tail or `return` expression
help: consider returning the local binding `i`
   |
   |
LL | fn a(i: i32) -> i32 { i }

error[E0308]: mismatched types
  --> /checkout/src/test/ui/suggestions/return-bindings.rs:7:46
   |
   |
LL |       let s: String = if let Some(s) = opt_str {
   |  ______________________________________________^
LL | |         //~^ ERROR mismatched types
LL | |     } else {
   | |_____^ expected struct `String`, found `()`
   = note: expected struct `String`
           found unit type `()`
help: consider returning the local binding `s`
   |
   |
LL ~     let s: String = if let Some(s) = opt_str {
LL +         s
LL ~     //~^ ERROR mismatched types

error[E0308]: mismatched types
  --> /checkout/src/test/ui/suggestions/return-bindings.rs:14:11
   |
   |
LL | fn c() -> Option<i32> {
   |    |
   |    |
   |    implicitly returns `()` as its body has no tail or `return` expression
   = note:   expected enum `Option<i32>`
           found unit type `()`
help: consider returning the local binding `x`
   |
   |
LL ~     let x = Some(1);
LL +     x
   |

error[E0308]: mismatched types
  --> /checkout/src/test/ui/suggestions/return-bindings.rs:20:46
   |
LL |       let s: String = if let Some(s) = opt_str {
   |  ______________________________________________^
LL | |         //~^ ERROR mismatched types
LL | |     } else {
   | |_____^ expected struct `String`, found `()`
   = note: expected struct `String`
           found unit type `()`
help: consider returning the local binding `s`
   |
   |
LL ~     let s: String = if let Some(s) = opt_str {
LL +         s
LL ~     //~^ ERROR mismatched types


error[E0308]: `if` and `else` have incompatible types
   |
   |
LL |       let s = if let Some(s) = opt_str {
LL | |     } else {
   | |_____- expected because of this
LL |           String::new()
   |           ^^^^^^^^^^^^^ expected `()`, found struct `String`
   |           ^^^^^^^^^^^^^ expected `()`, found struct `String`
   |
   = note: expected unit type `()`
                 found struct `String`
help: consider returning the local binding `s`
   |
LL ~     let s = if let Some(s) = opt_str {
LL +         s
LL ~     } else {

error[E0308]: mismatched types
  --> /checkout/src/test/ui/suggestions/return-bindings.rs:37:20
   |
   |
LL |         Some(s) => {}
   |                    ^^ expected struct `String`, found `()`
   |
   = note: expected struct `String`
           found unit type `()`
help: consider returning the local binding `s`
   |
LL |         Some(s) => { s }

error[E0308]: `match` arms have incompatible types
  --> /checkout/src/test/ui/suggestions/return-bindings.rs:46:17
   |
   |
LL |       let s = match opt_str {
   |  _____________-
LL | |         Some(s) => {}
LL | |         None => String::new(),
   | |                 ^^^^^^^^^^^^^ expected `()`, found struct `String`
   | |                 ^^^^^^^^^^^^^ expected `()`, found struct `String`
LL | |         //~^ ERROR `match` arms have incompatible types
LL | |     };
   |
   = note: expected unit type `()`
                 found struct `String`
help: consider returning the local binding `s`
help: consider returning the local binding `s`
   |
LL |         Some(s) => { s }

error: aborting due to 7 previous errors

For more information about this error, try `rustc --explain E0308`.
---
To only update this specific test, also pass `--test-args switched-expectations.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/switched-expectations.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/switched-expectations" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/switched-expectations/auxiliary"
stdout: none
--- stderr -------------------------------
  --> /checkout/src/test/ui/switched-expectations.rs:3:30
   |
   |
LL |     let ref string: String = var; //~ ERROR mismatched types [E0308]
   |                              ^^^ expected struct `String`, found `i32`
   = note: expected struct `String`
                found type `i32`

error: aborting due to previous error
---

---- [ui] src/test/ui/traits/associated_type_bound/check-trait-object-bounds-1.rs stdout ----
diff of stderr:

4 LL |     f::<dyn X<Y = str>>();
5    |         ^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `str`
-    = help: the trait `Clone` is implemented for `String`
+    = help: the trait `Clone` is implemented for `String<A>`
8 note: required by a bound in `f`
9   --> $DIR/check-trait-object-bounds-1.rs:7:9
9   --> $DIR/check-trait-object-bounds-1.rs:7:9
10    |


The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/traits/associated_type_bound/check-trait-object-bounds-1/check-trait-object-bounds-1.stderr
To only update this specific test, also pass `--test-args traits/associated_type_bound/check-trait-object-bounds-1.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-1.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/traits/associated_type_bound/check-trait-object-bounds-1" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/traits/associated_type_bound/check-trait-object-bounds-1/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0277]: the trait bound `str: Clone` is not satisfied
   |
   |
LL |     f::<dyn X<Y = str>>();
   |         ^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `str`
   = help: the trait `Clone` is implemented for `String<A>`
note: required by a bound in `f`
  --> /checkout/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-1.rs:7:9
   |
   |
LL | fn f<T: X + ?Sized>() {
   |         ^ required by this bound in `f`
error: aborting due to previous error

For more information about this error, try `rustc --explain E0277`.
------------------------------------------
------------------------------------------


---- [ui] src/test/ui/traits/associated_type_bound/check-trait-object-bounds-4.rs stdout ----
diff of stderr:

4 LL |     f::<dyn X<Y = str>>();
5    |         ^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `str`
-    = help: the trait `Clone` is implemented for `String`
+    = help: the trait `Clone` is implemented for `String<A>`
8 note: required by a bound in `f`
9   --> $DIR/check-trait-object-bounds-4.rs:10:9
9   --> $DIR/check-trait-object-bounds-4.rs:10:9
10    |


The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/traits/associated_type_bound/check-trait-object-bounds-4/check-trait-object-bounds-4.stderr
To only update this specific test, also pass `--test-args traits/associated_type_bound/check-trait-object-bounds-4.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-4.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/traits/associated_type_bound/check-trait-object-bounds-4" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/traits/associated_type_bound/check-trait-object-bounds-4/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0277]: the trait bound `str: Clone` is not satisfied
   |
   |
LL |     f::<dyn X<Y = str>>();
   |         ^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `str`
   = help: the trait `Clone` is implemented for `String<A>`
note: required by a bound in `f`
  --> /checkout/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-4.rs:10:9
   |
   |
LL | fn f<T: X + ?Sized>() {
   |         ^ required by this bound in `f`
error: aborting due to previous error

For more information about this error, try `rustc --explain E0277`.
------------------------------------------
------------------------------------------


---- [ui] src/test/ui/traits/bound/assoc-fn-bound-root-obligation.rs stdout ----
diff of stderr:

6    |
7    = help: the trait `FnMut<(char,)>` is not implemented for `u8`
8    = help: the following other types implement trait `Pattern<'a>`:
-              &'b String
+              &'b String<A>
10              &'b [char; N]
11              &'b [char]
12              &'b str

The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/traits/bound/assoc-fn-bound-root-obligation/assoc-fn-bound-root-obligation.stderr
To update references, rerun the tests and pass the `--bless` flag
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args traits/bound/assoc-fn-bound-root-obligation.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/traits/bound/assoc-fn-bound-root-obligation.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/traits/bound/assoc-fn-bound-root-obligation" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/traits/bound/assoc-fn-bound-root-obligation/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0277]: expected a `FnMut<(char,)>` closure, found `u8`
   |
   |
LL |     s.strip_suffix(b'\n').unwrap_or(s)
   |       ^^^^^^^^^^^^ expected an `FnMut<(char,)>` closure, found `u8`
   |
   = help: the trait `FnMut<(char,)>` is not implemented for `u8`
   = help: the following other types implement trait `Pattern<'a>`:
             &'b String<A>
             &'b [char; N]
             &'b [char]
             &'b str
             &'c &'b str
             [char; N]
             char
   = note: required for `u8` to implement `Pattern<'_>`
error: aborting due to previous error

For more information about this error, try `rustc --explain E0277`.
------------------------------------------
------------------------------------------


---- [ui] src/test/ui/traits/issue-77982.rs stdout ----
diff of stderr:

31    = note: multiple `impl`s satisfying `String: AsRef<_>` found in the following crates: `alloc`, `std`:
32            - impl AsRef<OsStr> for String;
33            - impl AsRef<Path> for String;
-            - impl AsRef<[u8]> for String;
-            - impl AsRef<str> for String;
+            - impl<A> AsRef<[u8]> for String<A>
+              where A: Allocator;
+            - impl<A> AsRef<str> for String<A>
+              where A: Allocator;
36 help: consider specifying the generic argument
37    |
38 LL |     opts.get::<Q>(opt.as_ref());

The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/traits/issue-77982/issue-77982.stderr
To update references, rerun the tests and pass the `--bless` flag
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args traits/issue-77982.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/traits/issue-77982.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/traits/issue-77982" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/traits/issue-77982/auxiliary"
stdout: none
--- stderr -------------------------------
  --> /checkout/src/test/ui/traits/issue-77982.rs:8:10
   |
   |
LL |     opts.get(opt.as_ref()); //~ ERROR type annotations needed
   |          ^^^ ------------ type must be known at this point
   |          |
   |          cannot infer type of the type parameter `Q` declared on the associated function `get`
   |
   = note: multiple `impl`s satisfying `String: Borrow<_>` found in the following crates: `alloc`, `core`:
           - impl Borrow<str> for String;
           - impl<T> Borrow<T> for T
             where T: ?Sized;
note: required by a bound in `HashMap::<K, V, S>::get`
   |
   |
LL |         K: Borrow<Q>,
   |            ^^^^^^^^^ required by this bound in `HashMap::<K, V, S>::get`
help: consider specifying the generic argument
   |
LL |     opts.get::<Q>(opt.as_ref()); //~ ERROR type annotations needed

error[E0283]: type annotations needed
  --> /checkout/src/test/ui/traits/issue-77982.rs:8:10
   |
   |
LL |     opts.get(opt.as_ref()); //~ ERROR type annotations needed
   |          ^^^     ------ type must be known at this point
   |          |
   |          cannot infer type of the type parameter `Q` declared on the associated function `get`
   |
   = note: multiple `impl`s satisfying `String: AsRef<_>` found in the following crates: `alloc`, `std`:
           - impl AsRef<OsStr> for String;
           - impl AsRef<Path> for String;
           - impl<A> AsRef<[u8]> for String<A>
             where A: Allocator;
           - impl<A> AsRef<str> for String<A>
             where A: Allocator;
help: consider specifying the generic argument
   |
LL |     opts.get::<Q>(opt.as_ref()); //~ ERROR type annotations needed

error[E0283]: type annotations needed
  --> /checkout/src/test/ui/traits/issue-77982.rs:13:59
   |
   |
LL |     let ips: Vec<_> = (0..100_000).map(|_| u32::from(0u32.into())).collect();
   |                                            |
   |                                            required by a bound introduced by this call
   |
   |
   = note: multiple `impl`s satisfying `u32: From<_>` found in the following crates: `core`, `std`:
           - impl From<Ipv4Addr> for u32;
           - impl From<NonZeroU32> for u32;
           - impl From<bool> for u32;
           - impl From<char> for u32;
           and 3 more
help: try using a fully qualified path to specify the expected types
   |
LL |     let ips: Vec<_> = (0..100_000).map(|_| u32::from(<u32 as Into<T>>::into(0u32))).collect();

error[E0283]: type annotations needed for `Box<T>`
  --> /checkout/src/test/ui/traits/issue-77982.rs:36:9
   |
   |
LL |     let _ = ().foo(); //~ ERROR type annotations needed
   |         ^      --- type must be known at this point
   |
note: multiple `impl`s satisfying `(): Foo<'_, _>` found
   |
   |
LL | impl Foo<'static, u32> for () {}
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | impl<'a> Foo<'a, i16> for () {}
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: consider giving this pattern a type, where the type for type parameter `T` is specified
   |
LL |     let _: Box<T> = ().foo(); //~ ERROR type annotations needed

error[E0283]: type annotations needed for `Box<T>`
  --> /checkout/src/test/ui/traits/issue-77982.rs:40:9
   |
   |
LL |     let _ = (&()).bar(); //~ ERROR type annotations needed
   |         ^         --- type must be known at this point
   |
note: multiple `impl`s satisfying `&(): Bar<'_, _>` found
   |
   |
LL | impl<'a> Bar<'static, u32> for &'a () {}
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | impl<'a> Bar<'a, i16> for &'a () {}
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: consider giving this pattern a type, where the type for type parameter `T` is specified
   |
LL |     let _: Box<T> = (&()).bar(); //~ ERROR type annotations needed

error: aborting due to 5 previous errors

For more information about this error, try `rustc --explain E0283`.
---
diff of stderr:

11    |    ---                 ^^^^^^ expected struct `String`, found `()`
12    |    |
13    |    implicitly returns `()` as its body has no tail or `return` expression
+    = note: expected struct `String`
+            found unit type `()`
14 
15 error: aborting due to 2 previous errors
---
To only update this specific test, also pass `--test-args typeck/issue-67971.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/typeck/issue-67971.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/typeck/issue-67971" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/typeck/issue-67971/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0609]: no field `sleep` on type `&mut S`
   |
   |
LL |     ctx.sleep = 0;

error[E0308]: mismatched types
  --> /checkout/src/test/ui/typeck/issue-67971.rs:3:24
   |
   |
LL | fn foo(ctx: &mut S) -> String { //~ ERROR mismatched types
   |    ---                 ^^^^^^ expected struct `String`, found `()`
   |    |
   |    implicitly returns `()` as its body has no tail or `return` expression
   = note: expected struct `String`
           found unit type `()`

error: aborting due to 2 previous errors
---
To only update this specific test, also pass `--test-args typeck/conversion-methods.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/typeck/conversion-methods.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/typeck/conversion-methods" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/typeck/conversion-methods/auxiliary"
stdout: none
--- stderr -------------------------------
  --> /checkout/src/test/ui/typeck/conversion-methods.rs:5:41
   |
   |
LL |     let _tis_an_instants_play: String = "'Tis a fond Ambush—"; //~ ERROR mismatched types
   |                                ------   ^^^^^^^^^^^^^^^^^^^^^- help: try using a conversion method: `.to_string()`
   |                                |        expected struct `String`, found `&str`
   |                                expected due to this
   |
   = note: expected struct `String`
   = note: expected struct `String`
           found reference `&'static str`

error[E0308]: mismatched types
  --> /checkout/src/test/ui/typeck/conversion-methods.rs:6:40
   |
LL |     let _just_to_make_bliss: PathBuf = Path::new("/ern/her/own/surprise");
   |                              -------   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- help: try using a conversion method: `.to_path_buf()`
   |                              |         expected struct `PathBuf`, found `&Path`
   |                              expected due to this

error[E0308]: mismatched types
error[E0308]: mismatched types
  --> /checkout/src/test/ui/typeck/conversion-methods.rs:9:40
   |
LL |     let _but_should_the_play: String = 2; // Perhaps surprisingly, we suggest .to_string() here
   |                               ------   ^- help: try using a conversion method: `.to_string()`
   |                               |        expected struct `String`, found integer
   |                               expected due to this
   |
   = note: expected struct `String`
   = note: expected struct `String`
                found type `{integer}`

error[E0308]: mismatched types
  --> /checkout/src/test/ui/typeck/conversion-methods.rs:12:47
   |
LL |     let _prove_piercing_earnest: Vec<usize> = &[1, 2, 3]; //~ ERROR mismatched types
   |                                  ----------   ^^^^^^^^^^ expected struct `Vec`, found `&[{integer}; 3]`
   |                                  expected due to this
   |
   = note: expected struct `Vec<usize>`
   = note: expected struct `Vec<usize>`
           found reference `&[{integer}; 3]`
help: try using a conversion method
   |
LL |     let _prove_piercing_earnest: Vec<usize> = (&[1, 2, 3]).to_vec(); //~ ERROR mismatched types

error: aborting due to 4 previous errors

For more information about this error, try `rustc --explain E0308`.

rust-log-analyzer avatar Sep 08 '22 04:09 rust-log-analyzer

The job x86_64-gnu-llvm-13 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
error: /checkout/src/test/ui/issues/issue-53348.rs:10: unexpected note: '10:13: 10:27: expected struct `String`'

error: 1 unexpected errors found, 0 expected errors not found
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/issues/issue-53348.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-53348" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-53348/auxiliary"
    Error {
        line_num: 10,
        kind: Some(
            Note,

rust-log-analyzer avatar Sep 08 '22 21:09 rust-log-analyzer

The job x86_64-gnu-llvm-13 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
 finished in 14.082 seconds
Check compiletest suite=debuginfo mode=debuginfo (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)

running 141 tests
iiiiii...i...iii.......i..i........F....F..i............iiiii....ii.........i......i.... 88/141
Some tests failed in compiletest suite=debuginfo mode=debuginfo host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu
failures:

---- [debuginfo-gdb] src/test/debuginfo/empty-string.rs stdout ----
---- [debuginfo-gdb] src/test/debuginfo/empty-string.rs stdout ----
NOTE: compiletest thinks it is using GDB with native rust support
NOTE: compiletest thinks it is using GDB version 12000090

error: line not found in debugger output: $1 = ""
status: exit status: 0
command: "/usr/bin/gdb" "-quiet" "-batch" "-nx" "-command=/checkout/obj/build/x86_64-unknown-linux-gnu/test/debuginfo/empty-string.gdb/empty-string.debugger.script"
GNU gdb (Ubuntu 12.0.90-0ubuntu1) 12.0.90
Copyright (C) 2022 Free Software Foundation, Inc.
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
Breakpoint 1 at 0x1b21: file /checkout/src/test/debuginfo/empty-string.rs, line 33.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Breakpoint 1, empty_string::main () at /checkout/src/test/debuginfo/empty-string.rs:33
33     zzz(); // #break
$1 = alloc::string::String<alloc::alloc::Global> {vec: Vec(size=0)}
$2 = ""
A debugging session is active.

 Inferior 1 [process 126824] will be killed.

Quit anyway? (y or n) [answered Y; input not from terminal]
stderr: none


---- [debuginfo-gdb] src/test/debuginfo/embedded-visualizer.rs stdout ----
---- [debuginfo-gdb] src/test/debuginfo/embedded-visualizer.rs stdout ----
NOTE: compiletest thinks it is using GDB with native rust support
NOTE: compiletest thinks it is using GDB version 12000090

error: line not found in debugger output: $4 = "Person A" is 10 years old.
status: exit status: 0
command: "/usr/bin/gdb" "-quiet" "-batch" "-nx" "-command=/checkout/obj/build/x86_64-unknown-linux-gnu/test/debuginfo/embedded-visualizer.gdb/embedded-visualizer.debugger.script"
GNU gdb (Ubuntu 12.0.90-0ubuntu1) 12.0.90
Copyright (C) 2022 Free Software Foundation, Inc.
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
Breakpoint 1 at 0x1ec9: file /checkout/src/test/debuginfo/embedded-visualizer.rs, line 107.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Breakpoint 1, embedded_visualizer::main () at /checkout/src/test/debuginfo/embedded-visualizer.rs:107
107     zzz(); // #break
Loaded  Script                                                                 
Yes     gdb_load_rust_pretty_printers.py                                       
 full name: /checkout/src/etc/gdb_load_rust_pretty_printers.py
Yes     pretty-printer-embedded_visualizer-0                                   
Yes     pretty-printer-embedded_visualizer-1                                   
Yes     pretty-printer-embedded_visualizer-2                                   
$1 = (0, 0)
$2 = (5, 8)
$3 = ((0, 0), (5, 8))
$4 = alloc::string::String<alloc::alloc::Global> {vec: Vec(size=8) = {80, 101, 114, 115, 111, 110, 32, 65}} is 10 years old.
A debugging session is active.

 Inferior 1 [process 126918] will be killed.

Quit anyway? (y or n) [answered Y; input not from terminal]
stderr: none



rust-log-analyzer avatar Sep 09 '22 23:09 rust-log-analyzer

Things that are the same as 79500:

The following were made allocator-aware (or added) in the same way as in 79500:

  • alloc::str::from_boxed_utf8_unchecked
  • alloc::string::String<A>
    • from_utf8(_unchecked), alloc::string::FromUtf8Error and all impls.
    • add from_raw_parts_in/into_raw_parts_with_alloc (from_raw_parts/into_raw_parts stay in String<Global>, unlike for Vec::into_raw_parts currently)
    • add new_in/with_capacity_in
    • into_bytes/as_mut_vec
    • split_off where A: Clone
    • drain, alloc::string::Drain and all impls,
    • Display/Debug/Hash
    • Clone where A: Clone
    • Extend<.*>/fmt::Write
    • Pattern
    • PartialEq to other string-like types (Cow<str>, str, &str)
    • Add(Assign)<&str>
    • Index(Mut)/Deref(Mut)
    • From<Box<str, A>> for String<A>
    • From<String<A>> for Vec<u8, A>

DIfferences from 79500 :

  • This does not add String::from_utf16_in.
  • This implements PartialEq and PartialOrd between Strings of different allocators.
  • This manually implements PartialOrd, Eq, Ord (where 79500 derived these) to avoid an A: Eq (etc) bound.
    • This does not implement StructuralEq anymore.
    • (79500 made deriving work by implementing (Partial){Eq,Ord} for Global. This does not add or require those implementations.)
  • This does not currently implement From<&String<A>> for String<A> where A: Clone in case we would want From<&String<A2>> for String<A1> where A1: Default.
  • This does not currently implement From<String<A>> for Box<str, A> (because of orphan rules? A is an uncovered type parameter, because Box is fundamental?).

Additions from 79500:

  • This adds String::allocator à la Vec::allocator
  • This makes AsRef<str>/AsMut<str>/AsRef<[u8]> for String allocator-generic.
  • This implements ToString for String<A> (using <str as ToOwned>::to_owned instead of the current <String as ToOwned>::to_owned, which clones the String)

zachs18 avatar Sep 10 '22 19:09 zachs18

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

rustbot avatar Sep 10 '22 20:09 rustbot

It passes the checks now, so I'm marking this as ready for review. Feedback is appreciated! (especially on the unresolved questions in the Todos).

(CC'ing people from 79500) cc @Amanieu , @TimDiekmann

zachs18 avatar Sep 10 '22 20:09 zachs18

(I think this is right?) @rustbot label +T-libs-api -T-libs ~~(I don't know if this needs an API change proposal since it has a tracking issue?)~~ ACP: https://github.com/rust-lang/libs-team/issues/101

zachs18 avatar Sep 10 '22 20:09 zachs18

A few notes:

String no longer implementing StructuralEq

I think this is not observable on stable, though I'm not entirely confident. The primary area where it matters that I know of is pattern matching with a const value, but that requires StructuralPartialEq too.

FromUtf8Error<_>, but that derived both PartialEq and Eq so it had both StructuralPartialEq and StructuralEq.

In order to check whether this is a breaking change we need to know whether any const context on stable can get the value -- I think the answer may be no, but I'm not confident.


Also left some comments inline, going to @rustbot author for now but please mark it as ready for review if the ACP goes through and you have addressed comments (or posted back with questions).

Mark-Simulacrum avatar Sep 17 '22 15:09 Mark-Simulacrum

The job mingw-check failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
configure: rust.debug-assertions := True
configure: rust.overflow-checks := True
configure: llvm.assertions      := True
configure: dist.missing-tools   := True
configure: build.configure-args := ['--enable-sccache', '--disable-manage-submodu ...
configure: writing `config.toml` in current directory
configure: 
configure: run `python /checkout/x.py --help`
Attempting with retry: make prepare
---
skip untracked path src/doc/rust-by-example/ during rustfmt invocations
skip untracked path src/llvm-project/ during rustfmt invocations
Diff in /checkout/library/alloc/src/boxed.rs at line 1338:
 
     fn clone_from(&mut self, other: &Self) {
         if self.len() == other.len() {
-            unsafe {
-                self.as_bytes_mut().copy_from_slice(other.as_bytes())
-            }
+            unsafe { self.as_bytes_mut().copy_from_slice(other.as_bytes()) }
         } else {
             *self = other.clone();
         }
Running `"/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/rustfmt" "--config-path" "/checkout" "--edition" "2021" "--unstable-features" "--skip-children" "--check" "/checkout/library/alloc/src/fmt.rs" "/checkout/library/alloc/src/tests.rs" "/checkout/library/alloc/src/boxed.rs" "/checkout/library/test/src/types.rs" "/checkout/library/alloc/src/slice.rs" "/checkout/library/test/src/stats/tests.rs" "/checkout/library/test/src/term/win.rs" "/checkout/library/alloc/src/vec/in_place_collect.rs"` failed.
If you're running `tidy`, try again with `--bless`. Or, if you just want to format code, run `./x.py fmt` instead.

rust-log-analyzer avatar Sep 20 '22 03:09 rust-log-analyzer

:umbrella: The latest upstream changes (presumably #102051) made this pull request unmergeable. Please resolve the merge conflicts.

bors avatar Sep 26 '22 17:09 bors

The job mingw-check failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
configure: rust.debug-assertions := True
configure: rust.overflow-checks := True
configure: llvm.assertions      := True
configure: dist.missing-tools   := True
configure: build.configure-args := ['--enable-sccache', '--disable-manage-submodu ...
configure: writing `config.toml` in current directory
configure: 
configure: run `python /checkout/x.py --help`
Attempting with retry: make prepare
---
---- src/mem/mod.rs - mem::SizedTypeProperties::IS_ZST (line 1195) stdout ----
error[E0282]: type annotations needed
  --> src/mem/mod.rs:1213:10
   |
21 | assert!(!String::IS_ZST);
   |          ^^^^^^ cannot infer type for type parameter `A` declared on the struct `String`
error: aborting due to previous error

For more information about this error, try `rustc --explain E0282`.
Couldn't compile the test.
Couldn't compile the test.

failures:
    src/mem/mod.rs - mem::SizedTypeProperties::IS_ZST (line 1195)

test result: FAILED. 3872 passed; 1 failed; 36 ignored; 0 measured; 0 filtered out; finished in 45.85s

error: doctest failed, to rerun pass `-p core --doc`

rust-log-analyzer avatar Sep 27 '22 12:09 rust-log-analyzer

:umbrella: The latest upstream changes (presumably #102691) made this pull request unmergeable. Please resolve the merge conflicts.

bors avatar Oct 05 '22 11:10 bors

@zachs18 Ping from triage - can you please post your status on this PR

FYI: when a PR is ready for review, send a message containing @rustbot ready to switch to S-waiting-on-review so the PR is in the reviewer's backlog.

JohnCSimon avatar Jan 01 '23 18:01 JohnCSimon

This is still (somewhat) blocked on the duplicate diagnostic issue (#101992).

Also, unless the semantics around how generic defaults affect inference are changed (e.g. to allow String to default to String::<Global> in paths), it may be a problem that things like this (playground link) with let _ = String::ASSOC_CONST_FROM_TRAIT; or let _ = String::assoc_fn_nonmethod(); don't compile. I don't think this can actually break any existing code, because it would only break if the trait(/associated function) is implemented for String<A> for multiple allocators A (not just A = Global), but I think there are no such impls (String::new/Default/FromStr/FromIterator/From/etc should still only be implemented for String<Global> in this PR). (I vaguely remember some UI test failing because of this, but it's not happening locally in my rebase; maybe it'll pop up in CI). (related: #101319 and #98931)

Edit: Yup, the test failure i half-remembered was library/core/src/mem/mod.rs:1271. Anything like this, with a blanket implementation that applies to String<A> for multiple A will cause problems.

trait MySized { const SIZE: usize; }
impl<T: Sized> MySized for T {
  const SIZE: usize = std::mem::size_of::<Self>();
}
fn main() {
  dbg!(String::SIZE); // Fails under this PR
}

So this PR is a breaking change unless the default generic parameter issue is resolved.

I just rebased today, and there are some UI test changes that I have questions about: (see later inline comments).

zachs18 avatar Jan 02 '23 01:01 zachs18

Since this is blocked on some hypothetical successor to https://github.com/rust-lang/rust/issues/27336, I guess it should be marked as S-blocked? It's also blocked on the ACP. @rustbot label -S-waiting-on-author +S-blocked +S-waiting-on-ACP

zachs18 avatar Jan 02 '23 02:01 zachs18

The job mingw-check failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
configure: rust.debug-assertions := True
configure: rust.overflow-checks := True
configure: llvm.assertions      := True
configure: dist.missing-tools   := True
configure: build.configure-args := ['--enable-sccache', '--disable-manage-submodu ...
configure: writing `config.toml` in current directory
configure: 
configure: run `python /checkout/x.py --help`
Attempting with retry: make prepare
---
---- src/mem/mod.rs - mem::SizedTypeProperties::IS_ZST (line 1249) stdout ----
error[E0282]: type annotations needed
  --> src/mem/mod.rs:1267:10
   |
21 | assert!(!String::IS_ZST);
   |          ^^^^^^ cannot infer type for type parameter `A` declared on the struct `String`
error: aborting due to previous error

For more information about this error, try `rustc --explain E0282`.
Couldn't compile the test.
Couldn't compile the test.

failures:
    src/mem/mod.rs - mem::SizedTypeProperties::IS_ZST (line 1249)

test result: FAILED. 3950 passed; 1 failed; 36 ignored; 0 measured; 0 filtered out; finished in 56.17s

error: doctest failed, to rerun pass `-p core --doc`

rust-log-analyzer avatar Jan 02 '23 03:01 rust-log-analyzer

Because of the "defaults-don't-affect-type-inference" issue, alloc::string::String currently must be a concrete non-generic type (or things like String::ASSOC_CONST fail). The latest push moves String to alloc::string::string::String (where alloc::string::string is an unstable module under the (new) string_allocator_api unstable feature), and makes alloc::string::String a type alias to alloc::string::string::String<Global>. Similar for Drain, and FromUtf8Error.

FromUtf16Error is not made generic by this PR, so I just used a pub use. ToString only works with Global anyway, so I left it in alloc::string.

"defaults-don't-affect-type-inference" will probably still block stabilizing allocator_api support for String, but with this it can now be used on nightly at least.

(Waiting for CI before marking as ready)

zachs18 avatar Jan 19 '24 04:01 zachs18

The job mingw-check failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
GITHUB_ACTION=__run_7
GITHUB_ACTIONS=true
GITHUB_ACTION_REF=
GITHUB_ACTION_REPOSITORY=
GITHUB_ACTOR=zachs18
GITHUB_API_URL=https://api.github.com
GITHUB_BASE_REF=master
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_5e15ab6e-4ae0-4b0c-96be-a96778fe62de
GITHUB_EVENT_NAME=pull_request
---
GITHUB_SERVER_URL=https://github.com
GITHUB_SHA=f28c7bf507e0438e75fad621c1721ef40d2beaf7
GITHUB_STATE=/home/runner/work/_temp/_runner_file_commands/save_state_5e15ab6e-4ae0-4b0c-96be-a96778fe62de
GITHUB_STEP_SUMMARY=/home/runner/work/_temp/_runner_file_commands/step_summary_5e15ab6e-4ae0-4b0c-96be-a96778fe62de
GITHUB_TRIGGERING_ACTOR=zachs18
GITHUB_WORKFLOW_REF=rust-lang/rust/.github/workflows/ci.yml@refs/pull/101551/merge
GITHUB_WORKFLOW_SHA=f28c7bf507e0438e75fad621c1721ef40d2beaf7
GITHUB_WORKSPACE=/home/runner/work/rust/rust
GOROOT_1_19_X64=/opt/hostedtoolcache/go/1.19.13/x64
---
........................................................................................ 176/746
........................................................................................ 264/746
.....................................i...i.........i..................i................. 352/746
........................................................................................ 440/746
......................................................................................F. 528/746
......F...F...................F......................................................... 616/746
..........................................

failures:


---- library/alloc/src/string/string.rs - string::string::String<A>::from_raw_parts_in (line 701) stdout ----
##[error]   --> library/alloc/src/string/string.rs:708:32
    |
    |
10  |     let mut s = String::new_in(System);
    |                 -------------- ^^^^^^ expected `Global`, found `System`
    |                 arguments to this function are incorrect
    |
note: associated function defined here
   --> /checkout/library/alloc/src/string/string.rs:519:18
   --> /checkout/library/alloc/src/string/string.rs:519:18
    |
519 |     pub const fn new_in(alloc: A) -> String<A> {

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0308`.
For more information about this error, try `rustc --explain E0308`.
Couldn't compile the test.
---- library/alloc/src/string/string.rs - string::string::String<A>::into_raw_parts_with_alloc (line 654) stdout ----
##[error]   --> library/alloc/src/string/string.rs:658:28
    |
    |
7   | let mut s = String::new_in(System);
    |             -------------- ^^^^^^ expected `Global`, found `System`
    |             arguments to this function are incorrect
    |
note: associated function defined here
   --> /checkout/library/alloc/src/string/string.rs:519:18
   --> /checkout/library/alloc/src/string/string.rs:519:18
    |
519 |     pub const fn new_in(alloc: A) -> String<A> {

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0308`.
For more information about this error, try `rustc --explain E0308`.
Couldn't compile the test.
---- library/alloc/src/string/string.rs - string::string::String<A>::new_in (line 509) stdout ----
##[error]   --> library/alloc/src/string/string.rs:514:24
    |
    |
8   | let s = String::new_in(System);
    |         -------------- ^^^^^^ expected `Global`, found `System`
    |         arguments to this function are incorrect
    |
note: associated function defined here
   --> /checkout/library/alloc/src/string/string.rs:519:18
   --> /checkout/library/alloc/src/string/string.rs:519:18
    |
519 |     pub const fn new_in(alloc: A) -> String<A> {

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0308`.
For more information about this error, try `rustc --explain E0308`.
Couldn't compile the test.
---- library/alloc/src/string/string.rs - string::string::String<A>::with_capacity_in (line 543) stdout ----
##[error]   --> library/alloc/src/string/string.rs:548:42
    |
    |
8   | let mut s = String::with_capacity_in(10, System);
    |             ------------------------     ^^^^^^ expected `Global`, found `System`
    |             arguments to this function are incorrect
    |
note: associated function defined here
   --> /checkout/library/alloc/src/string/string.rs:568:12
   --> /checkout/library/alloc/src/string/string.rs:568:12
    |
568 |     pub fn with_capacity_in(capacity: usize, alloc: A) -> String<A> {

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0308`.
---
    library/alloc/src/string/string.rs - string::string::String<A>::with_capacity_in (line 543)

test result: FAILED. 738 passed; 4 failed; 4 ignored; 0 measured; 0 filtered out; finished in 28.90s

error: doctest failed, to rerun pass `-p alloc --doc`
  local time: Fri Jan 19 04:23:27 UTC 2024
  network time: Fri, 19 Jan 2024 04:23:28 GMT
##[error]Process completed with exit code 1.
Post job cleanup.

rust-log-analyzer avatar Jan 19 '24 04:01 rust-log-analyzer

The job x86_64-gnu-tools failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
GITHUB_ACTION=__run_7
GITHUB_ACTIONS=true
GITHUB_ACTION_REF=
GITHUB_ACTION_REPOSITORY=
GITHUB_ACTOR=zachs18
GITHUB_API_URL=https://api.github.com
GITHUB_BASE_REF=master
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_783fdefb-3d93-47c5-8498-d3eb3dd5a371
GITHUB_EVENT_NAME=pull_request
---
GITHUB_SERVER_URL=https://github.com
GITHUB_SHA=0ba061eb7a70db7d0b61b28b1f2a28425e6fc605
GITHUB_STATE=/home/runner/work/_temp/_runner_file_commands/save_state_783fdefb-3d93-47c5-8498-d3eb3dd5a371
GITHUB_STEP_SUMMARY=/home/runner/work/_temp/_runner_file_commands/step_summary_783fdefb-3d93-47c5-8498-d3eb3dd5a371
GITHUB_TRIGGERING_ACTOR=zachs18
GITHUB_WORKFLOW_REF=rust-lang/rust/.github/workflows/ci.yml@refs/pull/101551/merge
GITHUB_WORKFLOW_SHA=0ba061eb7a70db7d0b61b28b1f2a28425e6fc605
GITHUB_WORKSPACE=/home/runner/work/rust/rust
GOROOT_1_19_X64=/opt/hostedtoolcache/go/1.19.13/x64
---

     Running tests/compile-test.rs (obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/compile_test-b64dd5970b05eb25)

FAILED TEST: tests/ui/box_collection.rs
command: CLIPPY_CONF_DIR="tests" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/clippy-driver" "--error-format=json" "--emit=metadata" "-Aunused" "-Ainternal_features" "-Zui-testing" "-Dwarnings" "-Ldependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps" "--extern=clippy_config=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_config-88cd92e38577594d.rlib" "--extern=clippy_lints=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_lints-5233f2f9ab0a885d.rlib" "--extern=clippy_utils=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_utils-c555dfce7b7b4482.rlib" "--extern=futures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libfutures-9cfde403f4813861.rlib" "--extern=if_chain=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libif_chain-ae846d6788d6a9f1.rlib" "--extern=itertools=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libitertools-7f737c8175775d48.rlib" "--extern=parking_lot=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libparking_lot-5a42172620baa7f7.rlib" "--extern=quote=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libquote-067e61b28e8c0ae8.rlib" "--extern=regex=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libregex-56de3874fe91412c.rlib" "--extern=serde=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libserde-67f57c9d74692487.rlib" "--extern=serde_derive=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps/libserde_derive-1ddd9d5371e89c55.so" "--extern=syn=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libsyn-0080dad30daeaebf.rlib" "--extern=tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libtokio-95373de42170edbf.rlib" "-Ldependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui_test/tests/ui" "tests/ui/box_collection.rs" "--edition" "2021"
error: actual output differed from expected
Execute `cargo uibless` to update `tests/ui/box_collection.stderr` to the actual output
--- tests/ui/box_collection.stderr
+++ <stderr output>
+++ <stderr output>
 error: you seem to be trying to use `Box<Vec<..>>`. Consider using just `Vec<..>`
... 6 lines skipped ...
    = help: to override `-D warnings` add `#[allow(clippy::box_collection)]`
 
 
-error: you seem to be trying to use `Box<String>`. Consider using just `String`
-   |
-LL | fn test3(foo: Box<String>) {}
-   |               ^^^^^^^^^^^
-   |
-   |
-   = help: `String` is already on the heap, `Box<String>` makes an extra allocation
-
 error: you seem to be trying to use `Box<HashMap<..>>`. Consider using just `HashMap<..>`
... 52 lines skipped ...
... 52 lines skipped ...
    = help: `BinaryHeap<..>` is already on the heap, `Box<BinaryHeap<..>>` makes an extra allocation
-error: aborting due to 9 previous errors
+error: aborting due to 8 previous errors
 



error: `you seem to be trying to use `Box<String>`. Consider using just `String`` not found in diagnostics on line 29
   |
   |
30 | //~^ ERROR: you seem to be trying to use `Box<String>`. Consider using just `String`
   |

full stderr:
full stderr:
error: you seem to be trying to use `Box<Vec<..>>`. Consider using just `Vec<..>`
   |
   |
LL | fn test1(foo: Box<Vec<bool>>) {}
   |
   |
   = help: `Vec<..>` is already on the heap, `Box<Vec<..>>` makes an extra allocation
   = note: `-D clippy::box-collection` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::box_collection)]`

error: you seem to be trying to use `Box<HashMap<..>>`. Consider using just `HashMap<..>`
   |
   |
LL | fn test4(foo: Box<HashMap<String, String>>) {}
   |
   |
   = help: `HashMap<..>` is already on the heap, `Box<HashMap<..>>` makes an extra allocation

error: you seem to be trying to use `Box<HashSet<..>>`. Consider using just `HashSet<..>`
   |
   |
LL | fn test5(foo: Box<HashSet<i64>>) {}
   |
   |
   = help: `HashSet<..>` is already on the heap, `Box<HashSet<..>>` makes an extra allocation

error: you seem to be trying to use `Box<VecDeque<..>>`. Consider using just `VecDeque<..>`
   |
   |
LL | fn test6(foo: Box<VecDeque<i32>>) {}
   |
   |
   = help: `VecDeque<..>` is already on the heap, `Box<VecDeque<..>>` makes an extra allocation

error: you seem to be trying to use `Box<LinkedList<..>>`. Consider using just `LinkedList<..>`
   |
   |
LL | fn test7(foo: Box<LinkedList<i16>>) {}
   |
   |
   = help: `LinkedList<..>` is already on the heap, `Box<LinkedList<..>>` makes an extra allocation

error: you seem to be trying to use `Box<BTreeMap<..>>`. Consider using just `BTreeMap<..>`
   |
   |
LL | fn test8(foo: Box<BTreeMap<i8, String>>) {}
   |
   |
   = help: `BTreeMap<..>` is already on the heap, `Box<BTreeMap<..>>` makes an extra allocation

error: you seem to be trying to use `Box<BTreeSet<..>>`. Consider using just `BTreeSet<..>`
   |
   |
LL | fn test9(foo: Box<BTreeSet<u64>>) {}
   |
   |
   = help: `BTreeSet<..>` is already on the heap, `Box<BTreeSet<..>>` makes an extra allocation

error: you seem to be trying to use `Box<BinaryHeap<..>>`. Consider using just `BinaryHeap<..>`
   |
   |
LL | fn test10(foo: Box<BinaryHeap<u32>>) {}
   |
   |
   = help: `BinaryHeap<..>` is already on the heap, `Box<BinaryHeap<..>>` makes an extra allocation
error: aborting due to 8 previous errors


full stdout:
full stdout:



FAILED TEST: tests/ui/box_default.rs
command: CLIPPY_CONF_DIR="tests" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/clippy-driver" "--error-format=json" "--emit=metadata" "-Aunused" "-Ainternal_features" "-Zui-testing" "-Dwarnings" "-Ldependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps" "--extern=clippy_config=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_config-88cd92e38577594d.rlib" "--extern=clippy_lints=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_lints-5233f2f9ab0a885d.rlib" "--extern=clippy_utils=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_utils-c555dfce7b7b4482.rlib" "--extern=futures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libfutures-9cfde403f4813861.rlib" "--extern=if_chain=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libif_chain-ae846d6788d6a9f1.rlib" "--extern=itertools=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libitertools-7f737c8175775d48.rlib" "--extern=parking_lot=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libparking_lot-5a42172620baa7f7.rlib" "--extern=quote=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libquote-067e61b28e8c0ae8.rlib" "--extern=regex=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libregex-56de3874fe91412c.rlib" "--extern=serde=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libserde-67f57c9d74692487.rlib" "--extern=serde_derive=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps/libserde_derive-1ddd9d5371e89c55.so" "--extern=syn=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libsyn-0080dad30daeaebf.rlib" "--extern=tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libtokio-95373de42170edbf.rlib" "-Ldependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui_test/tests/ui" "tests/ui/box_default.rs" "--edition" "2021"
error: actual output differed from expected
Execute `cargo uibless` to update `tests/ui/box_default.stderr` to the actual output
--- tests/ui/box_default.stderr
+++ <stderr output>
+++ <stderr output>
 error: `Box::new(_)` of default value
... 42 lines skipped ...
 
 
 error: `Box::new(_)` of default value
-   |
-   |
-LL |     let _string_default = outer!(Box::new(String::from("")));
-   |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Box::<String>::default()`
-
-error: `Box::new(_)` of default value
    |
... 43 lines skipped ...
... 43 lines skipped ...
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Box::<Foo>::default()`
-error: aborting due to 16 previous errors
+error: aborting due to 15 previous errors
 



full stderr:
error: `Box::new(_)` of default value
   |
LL |     let _string: Box<String> = Box::new(Default::default());
   |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Box::default()`
   |
   |
   = note: `-D clippy::box-default` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::box_default)]`

error: `Box::new(_)` of default value
   |
   |
LL |     let _byte = Box::new(u8::default());
   |                 ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Box::<u8>::default()`

error: `Box::new(_)` of default value
   |
   |
LL |     let _vec = Box::new(Vec::<u8>::new());
   |                ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Box::<Vec<u8>>::default()`

error: `Box::new(_)` of default value
   |
   |
LL |     let _impl = Box::new(ImplementsDefault::default());
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Box::<ImplementsDefault>::default()`

error: `Box::new(_)` of default value
   |
   |
LL |     let _impl2 = Box::new(<ImplementsDefault as Default>::default());
   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Box::<ImplementsDefault>::default()`

error: `Box::new(_)` of default value
   |
   |
LL |     let _impl3: Box<ImplementsDefault> = Box::new(Default::default());
   |                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Box::default()`

error: `Box::new(_)` of default value
   |
   |
LL |     let _in_macro = outer!(Box::new(String::new()));
   |                            ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Box::<String>::default()`

error: `Box::new(_)` of default value
   |
   |
LL |     let _vec2: Box<Vec<ImplementsDefault>> = Box::new(vec![]);
   |                                              ^^^^^^^^^^^^^^^^ help: try: `Box::default()`

error: `Box::new(_)` of default value
   |
   |
LL |     let _vec3: Box<Vec<bool>> = Box::new(Vec::from([]));
   |                                 ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Box::default()`

error: `Box::new(_)` of default value
   |
   |
LL |     let _vec4: Box<_> = Box::new(Vec::from([false; 0]));
   |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Box::<Vec<bool>>::default()`

error: `Box::new(_)` of default value
   |
   |
LL |     call_ty_fn(Box::new(u8::default()));
   |                ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Box::default()`

error: `Box::new(_)` of default value
   |
LL |     Box::new(bool::default())
LL |     Box::new(bool::default())
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Box::<bool>::default()`

error: `Box::new(_)` of default value
   |
   |
LL |     let _: Box<dyn Read> = Box::new(ImplementsDefault::default());
   |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Box::<ImplementsDefault>::default()`

error: `Box::new(_)` of default value
   |
   |
LL |         let _ = Box::new(WeirdPathed::default());
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Box::<WeirdPathed>::default()`

error: `Box::new(_)` of default value
   |
LL |             Some(Box::new(Foo::default()))
LL |             Some(Box::new(Foo::default()))
   |                  ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Box::<Foo>::default()`
error: aborting due to 15 previous errors


full stdout:
full stdout:



FAILED TEST: tests/ui/arithmetic_side_effects.rs
command: CLIPPY_CONF_DIR="tests" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/clippy-driver" "--error-format=json" "--emit=metadata" "-Aunused" "-Ainternal_features" "-Zui-testing" "-Dwarnings" "-Ldependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps" "--extern=clippy_config=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_config-88cd92e38577594d.rlib" "--extern=clippy_lints=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_lints-5233f2f9ab0a885d.rlib" "--extern=clippy_utils=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_utils-c555dfce7b7b4482.rlib" "--extern=futures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libfutures-9cfde403f4813861.rlib" "--extern=if_chain=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libif_chain-ae846d6788d6a9f1.rlib" "--extern=itertools=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libitertools-7f737c8175775d48.rlib" "--extern=parking_lot=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libparking_lot-5a42172620baa7f7.rlib" "--extern=quote=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libquote-067e61b28e8c0ae8.rlib" "--extern=regex=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libregex-56de3874fe91412c.rlib" "--extern=serde=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libserde-67f57c9d74692487.rlib" "--extern=serde_derive=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps/libserde_derive-1ddd9d5371e89c55.so" "--extern=syn=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libsyn-0080dad30daeaebf.rlib" "--extern=tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libtokio-95373de42170edbf.rlib" "-Ldependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui_test/tests/ui" "tests/ui/arithmetic_side_effects.rs" "--edition" "2021" "--extern" "proc_macro_derive=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui_test/tests/ui/auxiliary/libproc_macro_derive.so" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui_test/tests/ui/auxiliary"
error: actual output differed from expected
Execute `cargo uibless` to update `tests/ui/arithmetic_side_effects.stderr` to the actual output
--- tests/ui/arithmetic_side_effects.stderr
+++ <stderr output>
+++ <stderr output>
 error: arithmetic operation that can potentially result in unexpected side-effects
-  --> $DIR/arithmetic_side_effects.rs:304:5
+  --> $DIR/arithmetic_side_effects.rs:169:13
    |
-LL |     _n += 1;
+LL |     let _ = String::new() + "";
+   |             ^^^^^^^^^^^^^^^^^^
    |
    = note: `-D clippy::arithmetic-side-effects` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::arithmetic_side_effects)]`
    = help: to override `-D warnings` add `#[allow(clippy::arithmetic_side_effects)]`
 
 error: arithmetic operation that can potentially result in unexpected side-effects
+  --> $DIR/arithmetic_side_effects.rs:177:27
+LL |     let inferred_string = string + "";
+   |                           ^^^^^^^^^^^
+
+
+error: arithmetic operation that can potentially result in unexpected side-effects
+  --> $DIR/arithmetic_side_effects.rs:181:13
+   |
+LL |     let _ = inferred_string + "";
+
+
+error: arithmetic operation that can potentially result in unexpected side-effects
+  --> $DIR/arithmetic_side_effects.rs:304:5
+   |
+LL |     _n += 1;
+
+
+error: arithmetic operation that can potentially result in unexpected side-effects
   --> $DIR/arithmetic_side_effects.rs:305:5
... 703 lines skipped ...
    |         ^^^^^^^^^^^^^^
 
-error: aborting due to 119 previous errors
-error: aborting due to 119 previous errors
+error: aborting due to 122 previous errors
 


full stderr:
error: arithmetic operation that can potentially result in unexpected side-effects
   |
LL |     let _ = String::new() + "";
   |             ^^^^^^^^^^^^^^^^^^
   |
   |
   = note: `-D clippy::arithmetic-side-effects` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::arithmetic_side_effects)]`

error: arithmetic operation that can potentially result in unexpected side-effects
   |
LL |     let inferred_string = string + "";
   |                           ^^^^^^^^^^^


error: arithmetic operation that can potentially result in unexpected side-effects
   |
   |
LL |     let _ = inferred_string + "";


error: arithmetic operation that can potentially result in unexpected side-effects
   |
   |
LL |     _n += 1;


error: arithmetic operation that can potentially result in unexpected side-effects
   |
   |
LL |     _n += &1;


error: arithmetic operation that can potentially result in unexpected side-effects
   |
   |
LL |     _n -= 1;


error: arithmetic operation that can potentially result in unexpected side-effects
   |
   |
LL |     _n -= &1;


error: arithmetic operation that can potentially result in unexpected side-effects
   |
   |
LL |     _n /= 0;


error: arithmetic operation that can potentially result in unexpected side-effects
   |
   |
LL |     _n /= &0;


error: arithmetic operation that can potentially result in unexpected side-effects
   |
   |
LL |     _n %= 0;


error: arithmetic operation that can potentially result in unexpected side-effects
   |
   |
LL |     _n %= &0;


error: arithmetic operation that can potentially result in unexpected side-effects
   |
   |
LL |     _n *= 2;


error: arithmetic operation that can potentially result in unexpected side-effects
   |
   |
LL |     _n *= &2;


error: arithmetic operation that can potentially result in unexpected side-effects
   |
   |
LL |     _n += -1;


error: arithmetic operation that can potentially result in unexpected side-effects
   |
   |
LL |     _n += &-1;


error: arithmetic operation that can potentially result in unexpected side-effects
   |
   |
LL |     _n -= -1;


error: arithmetic operation that can potentially result in unexpected side-effects
   |
   |
LL |     _n -= &-1;


error: arithmetic operation that can potentially result in unexpected side-effects
   |
   |
LL |     _n /= -0;


error: arithmetic operation that can potentially result in unexpected side-effects
   |
   |
LL |     _n /= &-0;


error: arithmetic operation that can potentially result in unexpected side-effects
   |
   |
LL |     _n %= -0;


error: arithmetic operation that can potentially result in unexpected side-effects
   |
   |
LL |     _n %= &-0;


error: arithmetic operation that can potentially result in unexpected side-effects
   |
   |
LL |     _n *= -2;


error: arithmetic operation that can potentially result in unexpected side-effects
   |
   |
LL |     _n *= &-2;


error: arithmetic operation that can potentially result in unexpected side-effects
   |
LL |     _custom += Custom;
   |     ^^^^^^^^^^^^^^^^^


error: arithmetic operation that can potentially result in unexpected side-effects
   |
   |
LL |     _custom += &Custom;


error: arithmetic operation that can potentially result in unexpected side-effects
   |
   |
LL |     _custom -= Custom;


error: arithmetic operation that can potentially result in unexpected side-effects
   |
   |
LL |     _custom -= &Custom;


error: arithmetic operation that can potentially result in unexpected side-effects
   |
   |
LL |     _custom /= Custom;


error: arithmetic operation that can potentially result in unexpected side-effects
   |
   |
LL |     _custom /= &Custom;


error: arithmetic operation that can potentially result in unexpected side-effects
   |
   |
LL |     _custom %= Custom;


error: arithmetic operation that can potentially result in unexpected side-effects
   |
   |
LL |     _custom %= &Custom;


error: arithmetic operation that can potentially result in unexpected side-effects
   |
   |
LL |     _custom *= Custom;


error: arithmetic operation that can potentially result in unexpected side-effects
   |
   |
LL |     _custom *= &Custom;


error: arithmetic operation that can potentially result in unexpected side-effects
   |
   |
LL |     _custom >>= Custom;


error: arithmetic operation that can potentially result in unexpected side-effects
---
-   |
-LL |     string.push_str(&format!("{:?}", 5678));
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = help: consider using `write!` to avoid the extra allocation
-error: `format!(..)` appended to existing `String`
   --> $DIR/format_push_string.rs:15:13
    |
... 33 lines skipped ...
... 33 lines skipped ...
    = help: consider using `write!` to avoid the extra allocation
-error: aborting due to 5 previous errors
+error: aborting due to 4 previous errors
 



error: ``format!(..)` appended to existing `String`` not found in diagnostics on line 7
  |
  |
8 |     //~^ ERROR: `format!(..)` appended to existing `String`
  |

full stderr:
error: `format!(..)` appended to existing `String`
error: `format!(..)` appended to existing `String`
##[error]  --> tests/ui/format_push_string.rs:5:5
   |
LL |     string += &format!("{:?}", 1234);
   |
   |
   = help: consider using `write!` to avoid the extra allocation
   = note: `-D clippy::format-push-string` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::format_push_string)]`
error: `format!(..)` appended to existing `String`
##[error]  --> tests/ui/format_push_string.rs:15:13
   |
   |
LL | /             hex += &(if upper {
LL | |
LL | |                 format!("{byte:02X}")
LL | |             } else {
LL | |                 format!("{byte:02x}")
   | |______________^
   |
   |
   = help: consider using `write!` to avoid the extra allocation
error: `format!(..)` appended to existing `String`
##[error]  --> tests/ui/format_push_string.rs:28:9
   |
   |
LL | /         s += &(if let Some(_a) = Some(1234) {
LL | |             format!("{}", 1234)
LL | |         } else {
LL | |             format!("{}", 1234)
LL | |         });
LL | |         });
   | |__________^
   |
   = help: consider using `write!` to avoid the extra allocation
error: `format!(..)` appended to existing `String`
##[error]  --> tests/ui/format_push_string.rs:35:9
   |
   |
LL | /         s += &(match Some(1234) {
LL | |
LL | |             Some(_) => format!("{}", 1234),
LL | |             None => format!("{}", 1234),
   | |__________^
   |
   |
   = help: consider using `write!` to avoid the extra allocation
error: aborting due to 4 previous errors


full stdout:
full stdout:



FAILED TEST: tests/ui/from_over_into.rs
command: CLIPPY_CONF_DIR="tests" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/clippy-driver" "--error-format=json" "--emit=metadata" "-Aunused" "-Ainternal_features" "-Zui-testing" "-Dwarnings" "-Ldependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps" "--extern=clippy_config=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_config-88cd92e38577594d.rlib" "--extern=clippy_lints=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_lints-5233f2f9ab0a885d.rlib" "--extern=clippy_utils=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_utils-c555dfce7b7b4482.rlib" "--extern=futures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libfutures-9cfde403f4813861.rlib" "--extern=if_chain=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libif_chain-ae846d6788d6a9f1.rlib" "--extern=itertools=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libitertools-7f737c8175775d48.rlib" "--extern=parking_lot=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libparking_lot-5a42172620baa7f7.rlib" "--extern=quote=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libquote-067e61b28e8c0ae8.rlib" "--extern=regex=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libregex-56de3874fe91412c.rlib" "--extern=serde=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libserde-67f57c9d74692487.rlib" "--extern=serde_derive=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps/libserde_derive-1ddd9d5371e89c55.so" "--extern=syn=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libsyn-0080dad30daeaebf.rlib" "--extern=tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libtokio-95373de42170edbf.rlib" "-Ldependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui_test/tests/ui" "tests/ui/from_over_into.rs" "--edition" "2021"
error: actual output differed from expected
Execute `cargo uibless` to update `tests/ui/from_over_into.stderr` to the actual output
--- tests/ui/from_over_into.stderr
+++ <stderr output>
+++ <stderr output>
 error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
... 4 lines skipped ...
    = note: `-D clippy::from-over-into` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::from_over_into)]`
    = help: to override `-D warnings` add `#[allow(clippy::from_over_into)]`
-help: replace the `Into` implementation with `From<std::string::String>`
+help: replace the `Into` implementation with `From<std::string::string::String>`
    |
 LL ~ impl From<String> for StringWrapper {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    |
-help: replace the `Into` implementation with `From<std::string::String>`
+help: replace the `Into` implementation with `From<std::string::string::String>`
    |
 LL ~ impl From<String> for SelfType {
 error: aborting due to 6 previous errors
 



full stderr:
error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
   |
LL | impl Into<StringWrapper> for String {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   |
   = note: `-D clippy::from-over-into` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::from_over_into)]`
help: replace the `Into` implementation with `From<std::string::string::String>`
   |
LL ~ impl From<String> for StringWrapper {
LL ~     fn from(val: String) -> Self {
LL ~         StringWrapper(val)


error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
   |
LL | impl Into<SelfType> for String {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   |
help: replace the `Into` implementation with `From<std::string::string::String>`
   |
LL ~ impl From<String> for SelfType {
LL ~     fn from(val: String) -> Self {
LL ~         SelfType(String::new())


error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
   |
   |
LL | impl Into<SelfKeywords> for X {
   |
   |
help: replace the `Into` implementation with `From<X>`
   |
LL ~ impl From<X> for SelfKeywords {
LL ~     fn from(val: X) -> Self {
LL ~         let _ = X;
LL ~         let _ = X::FOO;
LL ~         let _: X = val;


error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
   |
   |
LL | impl core::convert::Into<bool> for crate::ExplicitPaths {
   |
   |
   = help: `impl From<Local> for Foreign` is allowed by the orphan rules, for more information see
           https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence
help: replace the `Into` implementation with `From<ExplicitPaths>`
   |
LL ~ impl core::convert::From<crate::ExplicitPaths> for bool {
LL ~     fn from(mut val: crate::ExplicitPaths) -> Self {
LL ~         let in_closure = || val.0;
LL | 
LL ~         val.0 = false;
LL ~         val.0


error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
   |
LL | impl Into<String> for PathInExpansion {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   |
   = help: `impl From<Local> for Foreign` is allowed by the orphan rules, for more information see
           https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence
help: replace the `Into` implementation with `From<PathInExpansion>`
   |
LL ~ impl From<PathInExpansion> for String {
LL ~     fn from(val: PathInExpansion) -> Self {


error: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
   |
   |
LL |     impl<T> Into<FromOverInto<T>> for Vec<T> {
   |
   |
help: replace the `Into` implementation with `From<std::vec::Vec<T>>`
   |
LL ~     impl<T> From<Vec<T>> for FromOverInto<T> {
LL ~         fn from(val: Vec<T>) -> Self {
LL ~             FromOverInto(val)

error: aborting due to 6 previous errors



full stdout:



FAILED TEST: tests/ui/inefficient_to_string.rs
command: CLIPPY_CONF_DIR="tests" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/clippy-driver" "--error-format=json" "--emit=metadata" "-Aunused" "-Ainternal_features" "-Zui-testing" "-Dwarnings" "-Ldependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps" "--extern=clippy_config=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_config-88cd92e38577594d.rlib" "--extern=clippy_lints=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_lints-5233f2f9ab0a885d.rlib" "--extern=clippy_utils=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_utils-c555dfce7b7b4482.rlib" "--extern=futures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libfutures-9cfde403f4813861.rlib" "--extern=if_chain=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libif_chain-ae846d6788d6a9f1.rlib" "--extern=itertools=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libitertools-7f737c8175775d48.rlib" "--extern=parking_lot=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libparking_lot-5a42172620baa7f7.rlib" "--extern=quote=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libquote-067e61b28e8c0ae8.rlib" "--extern=regex=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libregex-56de3874fe91412c.rlib" "--extern=serde=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libserde-67f57c9d74692487.rlib" "--extern=serde_derive=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps/libserde_derive-1ddd9d5371e89c55.so" "--extern=syn=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libsyn-0080dad30daeaebf.rlib" "--extern=tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libtokio-95373de42170edbf.rlib" "-Ldependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui_test/tests/ui" "tests/ui/inefficient_to_string.rs" "--edition" "2021"
error: actual output differed from expected
Execute `cargo uibless` to update `tests/ui/inefficient_to_string.stderr` to the actual output
--- tests/ui/inefficient_to_string.stderr
+++ <stderr output>
+++ <stderr output>
 error: calling `to_string` on `&&str`
   --> $DIR/inefficient_to_string.rs:10:21
... 17 lines skipped ...
    = help: `&&str` implements `ToString` through a slower blanket impl, but `str` has a fast specialization of `ToString`
 
-error: calling `to_string` on `&&std::string::String`
+error: calling `to_string` on `&&std::string::string::String`
   --> $DIR/inefficient_to_string.rs:19:21
    |
 LL |     let _: String = rrstring.to_string();
    |                     ^^^^^^^^^^^^^^^^^^^^ help: try dereferencing the receiver: `(*rrstring).to_string()`
    |
-   = help: `&std::string::String` implements `ToString` through a slower blanket impl, but `std::string::String` has a fast specialization of `ToString`
+   = help: `&std::string::string::String` implements `ToString` through a slower blanket impl, but `std::string::string::String` has a fast specialization of `ToString`
 
-error: calling `to_string` on `&&&std::string::String`
+error: calling `to_string` on `&&&std::string::string::String`
   --> $DIR/inefficient_to_string.rs:20:21
    |
 LL |     let _: String = rrrstring.to_string();
    |                     ^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing the receiver: `(**rrrstring).to_string()`
    |
-   = help: `&&std::string::String` implements `ToString` through a slower blanket impl, but `std::string::String` has a fast specialization of `ToString`
+   = help: `&&std::string::string::String` implements `ToString` through a slower blanket impl, but `std::string::string::String` has a fast specialization of `ToString`
 
 error: calling `to_string` on `&&std::borrow::Cow<'_, str>`
 error: aborting due to 6 previous errors
 



full stderr:
error: calling `to_string` on `&&str`
   |
   |
LL |     let _: String = rrstr.to_string();
   |                     ^^^^^^^^^^^^^^^^^ help: try dereferencing the receiver: `(*rrstr).to_string()`
   |
   = help: `&str` implements `ToString` through a slower blanket impl, but `str` has a fast specialization of `ToString`
  --> tests/ui/inefficient_to_string.rs:1:9
   |
LL | #![deny(clippy::inefficient_to_string)]
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: calling `to_string` on `&&&str`
   |
   |
LL |     let _: String = rrrstr.to_string();
   |                     ^^^^^^^^^^^^^^^^^^ help: try dereferencing the receiver: `(**rrrstr).to_string()`
   |
   = help: `&&str` implements `ToString` through a slower blanket impl, but `str` has a fast specialization of `ToString`

error: calling `to_string` on `&&std::string::string::String`
   |
   |
LL |     let _: String = rrstring.to_string();
   |                     ^^^^^^^^^^^^^^^^^^^^ help: try dereferencing the receiver: `(*rrstring).to_string()`
   |
   = help: `&std::string::string::String` implements `ToString` through a slower blanket impl, but `std::string::string::String` has a fast specialization of `ToString`

error: calling `to_string` on `&&&std::string::string::String`
   |
   |
LL |     let _: String = rrrstring.to_string();
   |                     ^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing the receiver: `(**rrrstring).to_string()`
   |
   = help: `&&std::string::string::String` implements `ToString` through a slower blanket impl, but `std::string::string::String` has a fast specialization of `ToString`

error: calling `to_string` on `&&std::borrow::Cow<'_, str>`
   |
   |
LL |     let _: String = rrcow.to_string();
   |                     ^^^^^^^^^^^^^^^^^ help: try dereferencing the receiver: `(*rrcow).to_string()`
   |
   = help: `&std::borrow::Cow<'_, str>` implements `ToString` through a slower blanket impl, but `std::borrow::Cow<'_, str>` has a fast specialization of `ToString`

error: calling `to_string` on `&&&std::borrow::Cow<'_, str>`
   |
   |
LL |     let _: String = rrrcow.to_string();
   |                     ^^^^^^^^^^^^^^^^^^ help: try dereferencing the receiver: `(**rrrcow).to_string()`
   |
   = help: `&&std::borrow::Cow<'_, str>` implements `ToString` through a slower blanket impl, but `std::borrow::Cow<'_, str>` has a fast specialization of `ToString`
error: aborting due to 6 previous errors


full stdout:
full stdout:



FAILED TEST: tests/ui/mem_forget.rs
command: CLIPPY_CONF_DIR="tests" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/clippy-driver" "--error-format=json" "--emit=metadata" "-Aunused" "-Ainternal_features" "-Zui-testing" "-Dwarnings" "-Ldependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps" "--extern=clippy_config=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_config-88cd92e38577594d.rlib" "--extern=clippy_lints=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_lints-5233f2f9ab0a885d.rlib" "--extern=clippy_utils=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_utils-c555dfce7b7b4482.rlib" "--extern=futures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libfutures-9cfde403f4813861.rlib" "--extern=if_chain=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libif_chain-ae846d6788d6a9f1.rlib" "--extern=itertools=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libitertools-7f737c8175775d48.rlib" "--extern=parking_lot=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libparking_lot-5a42172620baa7f7.rlib" "--extern=quote=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libquote-067e61b28e8c0ae8.rlib" "--extern=regex=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libregex-56de3874fe91412c.rlib" "--extern=serde=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libserde-67f57c9d74692487.rlib" "--extern=serde_derive=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps/libserde_derive-1ddd9d5371e89c55.so" "--extern=syn=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libsyn-0080dad30daeaebf.rlib" "--extern=tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libtokio-95373de42170edbf.rlib" "-Ldependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui_test/tests/ui" "tests/ui/mem_forget.rs" "--edition" "2021"
error: actual output differed from expected
Execute `cargo uibless` to update `tests/ui/mem_forget.stderr` to the actual output
--- tests/ui/mem_forget.stderr
+++ <stderr output>
---
 error: aborting due to 4 previous errors
 


error: `argument has type `std::string::String`` not found in diagnostics on line 29
   |
   |
31 |     //~| NOTE: argument has type `std::string::String`
   |

full stderr:
error: usage of `mem::forget` on `Drop` type
error: usage of `mem::forget` on `Drop` type
##[error]  --> tests/ui/mem_forget.rs:14:5
   |
LL |     memstuff::forget(six);
   |
   = note: argument has type `std::sync::Arc<i32>`
   = note: `-D clippy::mem-forget` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::mem_forget)]`
   = help: to override `-D warnings` add `#[allow(clippy::mem_forget)]`

error: usage of `mem::forget` on `Drop` type
##[error]  --> tests/ui/mem_forget.rs:19:5
   |
LL |     std::mem::forget(seven);
   |     ^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: argument has type `std::rc::Rc<i32>`
error: usage of `mem::forget` on `Drop` type
##[error]  --> tests/ui/mem_forget.rs:24:5
   |
   |
LL |     forgetSomething(eight);
   |
   = note: argument has type `std::vec::Vec<i32>`

error: usage of `mem::forget` on type with `Drop` fields
---



FAILED TEST: tests/ui/option_as_ref_deref.rs
command: CLIPPY_CONF_DIR="tests" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/clippy-driver" "--error-format=json" "--emit=metadata" "-Aunused" "-Ainternal_features" "-Zui-testing" "-Dwarnings" "-Ldependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps" "--extern=clippy_config=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_config-88cd92e38577594d.rlib" "--extern=clippy_lints=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_lints-5233f2f9ab0a885d.rlib" "--extern=clippy_utils=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_utils-c555dfce7b7b4482.rlib" "--extern=futures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libfutures-9cfde403f4813861.rlib" "--extern=if_chain=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libif_chain-ae846d6788d6a9f1.rlib" "--extern=itertools=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libitertools-7f737c8175775d48.rlib" "--extern=parking_lot=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libparking_lot-5a42172620baa7f7.rlib" "--extern=quote=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libquote-067e61b28e8c0ae8.rlib" "--extern=regex=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libregex-56de3874fe91412c.rlib" "--extern=serde=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libserde-67f57c9d74692487.rlib" "--extern=serde_derive=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps/libserde_derive-1ddd9d5371e89c55.so" "--extern=syn=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libsyn-0080dad30daeaebf.rlib" "--extern=tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libtokio-95373de42170edbf.rlib" "-Ldependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui_test/tests/ui" "tests/ui/option_as_ref_deref.rs" "--edition" "2021"
error: actual output differed from expected
Execute `cargo uibless` to update `tests/ui/option_as_ref_deref.stderr` to the actual output
--- tests/ui/option_as_ref_deref.stderr
+++ <stderr output>
+++ <stderr output>
 error: called `.as_ref().map(Deref::deref)` on an `Option` value
... 21 lines skipped ...
... 21 lines skipped ...
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using as_deref_mut instead: `opt.as_deref_mut()`
 
-error: called `.as_ref().map(String::as_str)` on an `Option` value
-   |
-   |
-LL |     let _ = opt.as_ref().map(String::as_str);
-   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using as_deref instead: `opt.as_deref()`
-
-error: called `.as_ref().map(|x| x.as_str())` on an `Option` value
-   |
-   |
-LL |     let _ = opt.as_ref().map(|x| x.as_str());
-   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using as_deref instead: `opt.as_deref()`
-
-error: called `.as_mut().map(String::as_mut_str)` on an `Option` value
-   |
-   |
-LL |     let _ = opt.as_mut().map(String::as_mut_str);
-   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using as_deref_mut instead: `opt.as_deref_mut()`
-
-error: called `.as_mut().map(|x| x.as_mut_str())` on an `Option` value
-   |
-   |
-LL |     let _ = opt.as_mut().map(|x| x.as_mut_str());
-   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using as_deref_mut instead: `opt.as_deref_mut()`
-
 error: called `.as_ref().map(CString::as_c_str)` on an `Option` value
... 56 lines skipped ...
... 56 lines skipped ...
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using as_deref instead: `opt.as_deref()`
 
-error: called `.as_ref().map(String::as_str)` on an `Option` value
 
-error: aborting due to 18 previous errors
-



full stderr:
error: called `.as_ref().map(Deref::deref)` on an `Option` value
   |
   |
LL |     let _ = opt.clone().as_ref().map(Deref::deref).map(str::len);
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using as_deref instead: `opt.clone().as_deref()`
   = note: `-D clippy::option-as-ref-deref` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::option_as_ref_deref)]`


error: called `.as_ref().map(Deref::deref)` on an `Option` value
   |
LL |       let _ = opt.clone()
   |  _____________^
LL | |         .as_ref().map(
LL | |         .as_ref().map(
LL | |             Deref::deref
LL | |         )
   | |_________^ help: try using as_deref instead: `opt.clone().as_deref()`

error: called `.as_mut().map(DerefMut::deref_mut)` on an `Option` value
   |
   |
LL |     let _ = opt.as_mut().map(DerefMut::deref_mut);
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using as_deref_mut instead: `opt.as_deref_mut()`

error: called `.as_ref().map(CString::as_c_str)` on an `Option` value
   |
   |
LL |     let _ = Some(CString::new(vec![]).unwrap()).as_ref().map(CString::as_c_str);
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using as_deref instead: `Some(CString::new(vec![]).unwrap()).as_deref()`

error: called `.as_ref().map(OsString::as_os_str)` on an `Option` value
   |
   |
LL |     let _ = Some(OsString::new()).as_ref().map(OsString::as_os_str);
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using as_deref instead: `Some(OsString::new()).as_deref()`

error: called `.as_ref().map(PathBuf::as_path)` on an `Option` value
   |
LL |     let _ = Some(PathBuf::new()).as_ref().map(PathBuf::as_path);
LL |     let _ = Some(PathBuf::new()).as_ref().map(PathBuf::as_path);
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using as_deref instead: `Some(PathBuf::new()).as_deref()`

error: called `.as_ref().map(Vec::as_slice)` on an `Option` value
   |
   |
LL |     let _ = Some(Vec::<()>::new()).as_ref().map(Vec::as_slice);
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using as_deref instead: `Some(Vec::<()>::new()).as_deref()`

error: called `.as_mut().map(Vec::as_mut_slice)` on an `Option` value
   |
   |
LL |     let _ = Some(Vec::<()>::new()).as_mut().map(Vec::as_mut_slice);
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using as_deref_mut instead: `Some(Vec::<()>::new()).as_deref_mut()`

error: called `.as_ref().map(|x| x.deref())` on an `Option` value
   |
   |
LL |     let _ = opt.as_ref().map(|x| x.deref());
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using as_deref instead: `opt.as_deref()`

error: called `.as_mut().map(|x| x.deref_mut())` on an `Option` value
   |
   |
LL |     let _ = opt.clone().as_mut().map(|x| x.deref_mut()).map(|x| x.len());
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using as_deref_mut instead: `opt.clone().as_deref_mut()`

error: called `.as_ref().map(|x| &**x)` on an `Option` value
   |
   |
LL |     let _ = opt.as_ref().map(|x| &**x);
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using as_deref instead: `opt.as_deref()`

error: called `.as_mut().map(|x| &mut **x)` on an `Option` value
   |
   |
LL |     let _ = opt.as_mut().map(|x| &mut **x);
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using as_deref_mut instead: `opt.as_deref_mut()`

error: called `.as_ref().map(std::ops::Deref::deref)` on an `Option` value
   |
LL |     let _ = opt.as_ref().map(std::ops::Deref::deref);
LL |     let _ = opt.as_ref().map(std::ops::Deref::deref);
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using as_deref instead: `opt.as_deref()`
error: aborting due to 13 previous errors


full stdout:
full stdout:



FAILED TEST: tests/ui/rc_buffer.rs
command: CLIPPY_CONF_DIR="tests" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/clippy-driver" "--error-format=json" "--emit=metadata" "-Aunused" "-Ainternal_features" "-Zui-testing" "-Dwarnings" "-Ldependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps" "--extern=clippy_config=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_config-88cd92e38577594d.rlib" "--extern=clippy_lints=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_lints-5233f2f9ab0a885d.rlib" "--extern=clippy_utils=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_utils-c555dfce7b7b4482.rlib" "--extern=futures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libfutures-9cfde403f4813861.rlib" "--extern=if_chain=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libif_chain-ae846d6788d6a9f1.rlib" "--extern=itertools=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libitertools-7f737c8175775d48.rlib" "--extern=parking_lot=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libparking_lot-5a42172620baa7f7.rlib" "--extern=quote=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libquote-067e61b28e8c0ae8.rlib" "--extern=regex=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libregex-56de3874fe91412c.rlib" "--extern=serde=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libserde-67f57c9d74692487.rlib" "--extern=serde_derive=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps/libserde_derive-1ddd9d5371e89c55.so" "--extern=syn=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libsyn-0080dad30daeaebf.rlib" "--extern=tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libtokio-95373de42170edbf.rlib" "-Ldependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui_test/tests/ui" "tests/ui/rc_buffer.rs" "--edition" "2021"
error: actual output differed from expected
error: actual output differed from expected
Execute `cargo uibless` to update `tests/ui/rc_buffer.stderr` to the actual output
--- tests/ui/rc_buffer.stderr
+++ <stderr output>
 error: usage of `Rc<T>` when T is a buffer type
-  --> $DIR/rc_buffer.rs:11:11
+  --> $DIR/rc_buffer.rs:12:11
-LL |     bad1: Rc<String>,
+LL |     bad2: Rc<PathBuf>,
-   |           ^^^^^^^^^^ help: try: `Rc<str>`
+   |           ^^^^^^^^^^^ help: try: `Rc<std::path::Path>`
+   |           ^^^^^^^^^^^ help: try: `Rc<std::path::Path>`
    |
    = note: `-D clippy::rc-buffer` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::rc_buffer)]`
 
 error: usage of `Rc<T>` when T is a buffer type
-  --> $DIR/rc_buffer.rs:12:11
-LL |     bad2: Rc<PathBuf>,
-   |           ^^^^^^^^^^^ help: try: `Rc<std::path::Path>`
-
-
-error: usage of `Rc<T>` when T is a buffer type
   --> $DIR/rc_buffer.rs:13:11
... 8 lines skipped ...
 
 
 error: usage of `Rc<T>` when T is a buffer type
-  --> $DIR/rc_buffer.rs:20:17
-   |
-LL | fn func_bad1(_: Rc<String>) {}
-   |                 ^^^^^^^^^^ help: try: `Rc<str>`
-
-error: usage of `Rc<T>` when T is a buffer type
   --> $DIR/rc_buffer.rs:21:17
... 13 lines skipped ...
    |                 ^^^^^^^^^^^^ help: try: `Rc<std::ffi::OsStr>`
 
-error: aborting due to 8 previous errors
-error: aborting due to 8 previous errors
+error: aborting due to 6 previous errors
 


full stderr:
error: usage of `Rc<T>` when T is a buffer type
   |
LL |     bad2: Rc<PathBuf>,
   |           ^^^^^^^^^^^ help: try: `Rc<std::path::Path>`
   |
   |
   = note: `-D clippy::rc-buffer` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::rc_buffer)]`

error: usage of `Rc<T>` when T is a buffer type
   |
   |
LL |     bad3: Rc<Vec<u8>>,
   |           ^^^^^^^^^^^ help: try: `Rc<[u8]>`

error: usage of `Rc<T>` when T is a buffer type
   |
LL |     bad4: Rc<OsString>,
   |           ^^^^^^^^^^^^ help: try: `Rc<std::ffi::OsStr>`


error: usage of `Rc<T>` when T is a buffer type
   |
   |
LL | fn func_bad2(_: Rc<PathBuf>) {}
   |                 ^^^^^^^^^^^ help: try: `Rc<std::path::Path>`

error: usage of `Rc<T>` when T is a buffer type
   |
   |
LL | fn func_bad3(_: Rc<Vec<u8>>) {}
   |                 ^^^^^^^^^^^ help: try: `Rc<[u8]>`

error: usage of `Rc<T>` when T is a buffer type
   |
   |
LL | fn func_bad4(_: Rc<OsString>) {}
   |                 ^^^^^^^^^^^^ help: try: `Rc<std::ffi::OsStr>`
error: aborting due to 6 previous errors


full stdout:
full stdout:



FAILED TEST: tests/ui/rc_buffer_arc.rs
command: CLIPPY_CONF_DIR="tests" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/clippy-driver" "--error-format=json" "--emit=metadata" "-Aunused" "-Ainternal_features" "-Zui-testing" "-Dwarnings" "-Ldependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps" "--extern=clippy_config=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_config-88cd92e38577594d.rlib" "--extern=clippy_lints=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_lints-5233f2f9ab0a885d.rlib" "--extern=clippy_utils=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_utils-c555dfce7b7b4482.rlib" "--extern=futures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libfutures-9cfde403f4813861.rlib" "--extern=if_chain=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libif_chain-ae846d6788d6a9f1.rlib" "--extern=itertools=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libitertools-7f737c8175775d48.rlib" "--extern=parking_lot=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libparking_lot-5a42172620baa7f7.rlib" "--extern=quote=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libquote-067e61b28e8c0ae8.rlib" "--extern=regex=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libregex-56de3874fe91412c.rlib" "--extern=serde=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libserde-67f57c9d74692487.rlib" "--extern=serde_derive=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps/libserde_derive-1ddd9d5371e89c55.so" "--extern=syn=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libsyn-0080dad30daeaebf.rlib" "--extern=tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libtokio-95373de42170edbf.rlib" "-Ldependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui_test/tests/ui" "tests/ui/rc_buffer_arc.rs" "--edition" "2021"
error: actual output differed from expected
Execute `cargo uibless` to update `tests/ui/rc_buffer_arc.stderr` to the actual output
--- tests/ui/rc_buffer_arc.stderr
+++ <stderr output>
+++ <stderr output>
 error: usage of `Arc<T>` when T is a buffer type
-  --> $DIR/rc_buffer_arc.rs:10:11
+  --> $DIR/rc_buffer_arc.rs:11:11
-LL |     bad1: Arc<String>,
+LL |     bad2: Arc<PathBuf>,
-   |           ^^^^^^^^^^^ help: try: `Arc<str>`
+   |           ^^^^^^^^^^^^ help: try: `Arc<std::path::Path>`
+   |           ^^^^^^^^^^^^ help: try: `Arc<std::path::Path>`
    |
    = note: `-D clippy::rc-buffer` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::rc_buffer)]`
 
 error: usage of `Arc<T>` when T is a buffer type
-  --> $DIR/rc_buffer_arc.rs:11:11
-LL |     bad2: Arc<PathBuf>,
-   |           ^^^^^^^^^^^^ help: try: `Arc<std::path::Path>`
-
-
-error: usage of `Arc<T>` when T is a buffer type
   --> $DIR/rc_buffer_arc.rs:12:11
... 8 lines skipped ...
 
 
 error: usage of `Arc<T>` when T is a buffer type
-  --> $DIR/rc_buffer_arc.rs:19:17
-   |
-LL | fn func_bad1(_: Arc<String>) {}
-   |                 ^^^^^^^^^^^ help: try: `Arc<str>`
-
-error: usage of `Arc<T>` when T is a buffer type
   --> $DIR/rc_buffer_arc.rs:20:17
... 13 lines skipped ...
    |                 ^^^^^^^^^^^^^ help: try: `Arc<std::ffi::OsStr>`
 
-error: aborting due to 8 previous errors
-error: aborting due to 8 previous errors
+error: aborting due to 6 previous errors
 


full stderr:
error: usage of `Arc<T>` when T is a buffer type
   |
LL |     bad2: Arc<PathBuf>,
   |           ^^^^^^^^^^^^ help: try: `Arc<std::path::Path>`
   |
   |
   = note: `-D clippy::rc-buffer` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::rc_buffer)]`

error: usage of `Arc<T>` when T is a buffer type
   |
   |
LL |     bad3: Arc<Vec<u8>>,
   |           ^^^^^^^^^^^^ help: try: `Arc<[u8]>`

error: usage of `Arc<T>` when T is a buffer type
   |
LL |     bad4: Arc<OsString>,
   |           ^^^^^^^^^^^^^ help: try: `Arc<std::ffi::OsStr>`


error: usage of `Arc<T>` when T is a buffer type
   |
   |
LL | fn func_bad2(_: Arc<PathBuf>) {}
   |                 ^^^^^^^^^^^^ help: try: `Arc<std::path::Path>`

error: usage of `Arc<T>` when T is a buffer type
   |
   |
LL | fn func_bad3(_: Arc<Vec<u8>>) {}
   |                 ^^^^^^^^^^^^ help: try: `Arc<[u8]>`

error: usage of `Arc<T>` when T is a buffer type
   |
   |
LL | fn func_bad4(_: Arc<OsString>) {}
   |                 ^^^^^^^^^^^^^ help: try: `Arc<std::ffi::OsStr>`
error: aborting due to 6 previous errors


full stdout:
full stdout:



FAILED TEST: tests/ui/redundant_type_annotations.rs
command: CLIPPY_CONF_DIR="tests" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/clippy-driver" "--error-format=json" "--emit=metadata" "-Aunused" "-Ainternal_features" "-Zui-testing" "-Dwarnings" "-Ldependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps" "--extern=clippy_config=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_config-88cd92e38577594d.rlib" "--extern=clippy_lints=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_lints-5233f2f9ab0a885d.rlib" "--extern=clippy_utils=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_utils-c555dfce7b7b4482.rlib" "--extern=futures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libfutures-9cfde403f4813861.rlib" "--extern=if_chain=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libif_chain-ae846d6788d6a9f1.rlib" "--extern=itertools=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libitertools-7f737c8175775d48.rlib" "--extern=parking_lot=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libparking_lot-5a42172620baa7f7.rlib" "--extern=quote=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libquote-067e61b28e8c0ae8.rlib" "--extern=regex=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libregex-56de3874fe91412c.rlib" "--extern=serde=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libserde-67f57c9d74692487.rlib" "--extern=serde_derive=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps/libserde_derive-1ddd9d5371e89c55.so" "--extern=syn=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libsyn-0080dad30daeaebf.rlib" "--extern=tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libtokio-95373de42170edbf.rlib" "-Ldependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui_test/tests/ui" "tests/ui/redundant_type_annotations.rs" "--edition" "2021"
error: actual output differed from expected
Execute `cargo uibless` to update `tests/ui/redundant_type_annotations.stderr` to the actual output
--- tests/ui/redundant_type_annotations.stderr
+++ <stderr output>
+++ <stderr output>
 error: redundant type annotation
   --> $DIR/redundant_type_annotations.rs:81:9
... 18 lines skipped ...
 
 error: redundant type annotation
-  --> $DIR/redundant_type_annotations.rs:159:5
-   |
-LL |     let _return: String = return_a_string();
-
-error: redundant type annotation
   --> $DIR/redundant_type_annotations.rs:162:5
    |
---
 
 error: redundant type annotation
-  --> $DIR/redundant_type_annotations.rs:183:5
-   |
-LL |     let _return: String = Pie::associated_return_a_string();
-
-error: redundant type annotation
   --> $DIR/redundant_type_annotations.rs:190:5
    |
---
+error: aborting due to 14 previous errors
 


error: `redundant type annotation` not found in diagnostics on line 159
    |
    |
160 |     //~^ ERROR: redundant type annotation
    |


error: `redundant type annotation` not found in diagnostics on line 171
    |
    |
172 |     //~^ ERROR: redundant type annotation
    |


error: `redundant type annotation` not found in diagnostics on line 183
    |
    |
184 |     //~^ ERROR: redundant type annotation
    |

full stderr:
error: redundant type annotation
error: redundant type annotation
##[error]  --> tests/ui/redundant_type_annotations.rs:81:9
   |
LL |         let v: u32 = self.return_an_int();
   |
   = note: `-D clippy::redundant-type-annotations` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::redundant_type_annotations)]`


error: redundant type annotation
##[error]  --> tests/ui/redundant_type_annotations.rs:84:9
   |
LL |         let v: &u32 = self.return_a_ref();

error: redundant type annotation
##[error]  --> tests/ui/redundant_type_annotations.rs:86:9
   |
   |
LL |         let v: &Slice = self.return_a_ref_to_struct();

error: redundant type annotation
##[error]  --> tests/ui/redundant_type_annotations.rs:162:5
   |
   |
LL |     let _return: Pie = return_a_struct();

error: redundant type annotation
##[error]  --> tests/ui/redundant_type_annotations.rs:165:5
   |
   |
LL |     let _return: Pizza = return_an_enum();

error: redundant type annotation
##[error]  --> tests/ui/redundant_type_annotations.rs:168:5
   |
   |
LL |     let _return: u32 = return_an_int();

error: redundant type annotation
##[error]  --> tests/ui/redundant_type_annotations.rs:174:5
   |
   |
LL |     let new_pie: Pie = Pie::new();

error: redundant type annotation
##[error]  --> tests/ui/redundant_type_annotations.rs:177:5
   |
   |
LL |     let _return: u32 = new_pie.return_an_int();

error: redundant type annotation
##[error]  --> tests/ui/redundant_type_annotations.rs:180:5
   |
   |
LL |     let _return: u32 = Pie::associated_return_an_int();

error: redundant type annotation
##[error]  --> tests/ui/redundant_type_annotations.rs:190:5
   |
   |
LL |     let _var: u32 = u32::MAX;

error: redundant type annotation
##[error]  --> tests/ui/redundant_type_annotations.rs:193:5
   |
   |
LL |     let _var: u32 = 5_u32;

error: redundant type annotation
##[error]  --> tests/ui/redundant_type_annotations.rs:196:5
   |
   |
LL |     let _var: &str = "test";

error: redundant type annotation
##[error]  --> tests/ui/redundant_type_annotations.rs:199:5
   |
   |
LL |     let _var: &[u8] = b"test";

error: redundant type annotation
##[error]  --> tests/ui/redundant_type_annotations.rs:202:5
   |
   |
LL |     let _var: bool = false;

error: aborting due to 14 previous errors



full stdout:



FAILED TEST: tests/ui/single_char_add_str.rs
command: CLIPPY_CONF_DIR="tests" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/clippy-driver" "--error-format=json" "--emit=metadata" "-Aunused" "-Ainternal_features" "-Zui-testing" "-Dwarnings" "-Ldependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps" "--extern=clippy_config=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_config-88cd92e38577594d.rlib" "--extern=clippy_lints=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_lints-5233f2f9ab0a885d.rlib" "--extern=clippy_utils=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_utils-c555dfce7b7b4482.rlib" "--extern=futures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libfutures-9cfde403f4813861.rlib" "--extern=if_chain=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libif_chain-ae846d6788d6a9f1.rlib" "--extern=itertools=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libitertools-7f737c8175775d48.rlib" "--extern=parking_lot=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libparking_lot-5a42172620baa7f7.rlib" "--extern=quote=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libquote-067e61b28e8c0ae8.rlib" "--extern=regex=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libregex-56de3874fe91412c.rlib" "--extern=serde=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libserde-67f57c9d74692487.rlib" "--extern=serde_derive=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps/libserde_derive-1ddd9d5371e89c55.so" "--extern=syn=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libsyn-0080dad30daeaebf.rlib" "--extern=tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libtokio-95373de42170edbf.rlib" "-Ldependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui_test/tests/ui" "tests/ui/single_char_add_str.rs" "--edition" "2021"
error: actual output differed from expected
Execute `cargo uibless` to update `tests/ui/single_char_add_str.stderr` to the actual output
--- tests/ui/single_char_add_str.stderr
+++ <stderr output>
+++ <stderr output>
-error: calling `push_str()` using a single-character string literal
-   |
-   |
-LL |     string.push_str("R");
-   |     ^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `string.push('R')`
-   = note: `-D clippy::single-char-add-str` implied by `-D warnings`
-   = help: to override `-D warnings` add `#[allow(clippy::single_char_add_str)]`
-
-
-error: calling `push_str()` using a single-character string literal
-   |
-   |
-LL |     string.push_str("'");
-   |     ^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `string.push('\'')`
-
-error: calling `push_str()` using a single-character string literal
-   |
-   |
-LL |     string.push_str("\x52");
-   |     ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `string.push('\x52')`
-
-error: calling `push_str()` using a single-character string literal
-   |
-   |
-LL |     string.push_str("\u{0052}");
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `string.push('\u{0052}')`
-
-error: calling `push_str()` using a single-character string literal
-   |
-   |
-LL |     string.push_str(r##"a"##);
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `string.push('a')`
-
-error: calling `push_str()` using a single-character string literal
-   |
-   |
-LL |     get_string!().push_str("ö");
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `get_string!().push('ö')`
-
-error: calling `insert_str()` using a single-character string literal
-   |
-   |
-LL |     string.insert_str(0, "R");
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `insert` with a character literal: `string.insert(0, 'R')`
-
-error: calling `insert_str()` using a single-character string literal
-   |
-   |
-LL |     string.insert_str(1, "'");
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `insert` with a character literal: `string.insert(1, '\'')`
-
-error: calling `insert_str()` using a single-character string literal
-   |
-   |
-LL |     string.insert_str(0, "\x52");
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `insert` with a character literal: `string.insert(0, '\x52')`
-
-error: calling `insert_str()` using a single-character string literal
-   |
-   |
-LL |     string.insert_str(0, "\u{0052}");
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `insert` with a character literal: `string.insert(0, '\u{0052}')`
-
-error: calling `insert_str()` using a single-character string literal
-   |
-   |
-LL |     string.insert_str(x, r##"a"##);
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `insert` with a character literal: `string.insert(x, 'a')`
-
-error: calling `insert_str()` using a single-character string literal
-   |
-   |
-LL |     string.insert_str(Y, r##"a"##);
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `insert` with a character literal: `string.insert(Y, 'a')`
-
-error: calling `insert_str()` using a single-character string literal
-   |
-   |
-LL |     string.insert_str(Y, r##"""##);
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `insert` with a character literal: `string.insert(Y, '"')`
-
-error: calling `insert_str()` using a single-character string literal
-   |
-   |
-LL |     string.insert_str(Y, r##"'"##);
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `insert` with a character literal: `string.insert(Y, '\'')`
-
-error: calling `insert_str()` using a single-character string literal
-   |
-   |
-LL |     get_string!().insert_str(1, "?");
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `insert` with a character literal: `get_string!().insert(1, '?')`
-error: aborting due to 15 previous errors
-



full stderr:

full stdout:



FAILED TEST: tests/ui/unnecessary_owned_empty_strings.rs
command: CLIPPY_CONF_DIR="tests" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/clippy-driver" "--error-format=json" "--emit=metadata" "-Aunused" "-Ainternal_features" "-Zui-testing" "-Dwarnings" "-Ldependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps" "--extern=clippy_config=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_config-88cd92e38577594d.rlib" "--extern=clippy_lints=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_lints-5233f2f9ab0a885d.rlib" "--extern=clippy_utils=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_utils-c555dfce7b7b4482.rlib" "--extern=futures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libfutures-9cfde403f4813861.rlib" "--extern=if_chain=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libif_chain-ae846d6788d6a9f1.rlib" "--extern=itertools=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libitertools-7f737c8175775d48.rlib" "--extern=parking_lot=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libparking_lot-5a42172620baa7f7.rlib" "--extern=quote=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libquote-067e61b28e8c0ae8.rlib" "--extern=regex=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libregex-56de3874fe91412c.rlib" "--extern=serde=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libserde-67f57c9d74692487.rlib" "--extern=serde_derive=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps/libserde_derive-1ddd9d5371e89c55.so" "--extern=syn=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libsyn-0080dad30daeaebf.rlib" "--extern=tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libtokio-95373de42170edbf.rlib" "-Ldependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui_test/tests/ui" "tests/ui/unnecessary_owned_empty_strings.rs" "--edition" "2021"
error: actual output differed from expected
Execute `cargo uibless` to update `tests/ui/unnecessary_owned_empty_strings.stderr` to the actual output
--- tests/ui/unnecessary_owned_empty_strings.stderr
+++ <stderr output>
+++ <stderr output>
-error: usage of `&String::new()` for a function expecting a `&str` argument
-   |
-LL |     ref_str_argument(&String::new());
-   |                      ^^^^^^^^^^^^^^ help: try: `""`
-   |
-   |
-   = note: `-D clippy::unnecessary-owned-empty-strings` implied by `-D warnings`
-   = help: to override `-D warnings` add `#[allow(clippy::unnecessary_owned_empty_strings)]`
-
 error: usage of `&String::from("")` for a function expecting a `&str` argument
    |
    |
 LL |     ref_str_argument(&String::from(""));
    |                      ^^^^^^^^^^^^^^^^^ help: try: `""`
+   = note: `-D clippy::unnecessary-owned-empty-strings` implied by `-D warnings`
+   = help: to override `-D warnings` add `#[allow(clippy::unnecessary_owned_empty_strings)]`
 
-error: aborting due to 2 previous errors
-error: aborting due to 2 previous errors
+error: aborting due to 1 previous error
 


full stderr:
error: usage of `&String::from("")` for a function expecting a `&str` argument
   |
   |
LL |     ref_str_argument(&String::from(""));
   |                      ^^^^^^^^^^^^^^^^^ help: try: `""`
   = note: `-D clippy::unnecessary-owned-empty-strings` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::unnecessary_owned_empty_strings)]`

error: aborting due to 1 previous error
error: aborting due to 1 previous error


full stdout:



FAILED TEST: tests/ui/useless_conversion_try.rs
command: CLIPPY_CONF_DIR="tests" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/clippy-driver" "--error-format=json" "--emit=metadata" "-Aunused" "-Ainternal_features" "-Zui-testing" "-Dwarnings" "-Ldependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps" "--extern=clippy_config=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_config-88cd92e38577594d.rlib" "--extern=clippy_lints=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_lints-5233f2f9ab0a885d.rlib" "--extern=clippy_utils=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_utils-c555dfce7b7b4482.rlib" "--extern=futures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libfutures-9cfde403f4813861.rlib" "--extern=if_chain=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libif_chain-ae846d6788d6a9f1.rlib" "--extern=itertools=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libitertools-7f737c8175775d48.rlib" "--extern=parking_lot=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libparking_lot-5a42172620baa7f7.rlib" "--extern=quote=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libquote-067e61b28e8c0ae8.rlib" "--extern=regex=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libregex-56de3874fe91412c.rlib" "--extern=serde=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libserde-67f57c9d74692487.rlib" "--extern=serde_derive=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps/libserde_derive-1ddd9d5371e89c55.so" "--extern=syn=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libsyn-0080dad30daeaebf.rlib" "--extern=tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libtokio-95373de42170edbf.rlib" "-Ldependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui_test/tests/ui" "tests/ui/useless_conversion_try.rs" "--edition" "2021"
error: actual output differed from expected
Execute `cargo uibless` to update `tests/ui/useless_conversion_try.stderr` to the actual output
--- tests/ui/useless_conversion_try.stderr
+++ <stderr output>
+++ <stderr output>
 error: useless conversion to the same type: `T`
   --> $DIR/useless_conversion_try.rs:5:13
... 17 lines skipped ...
    = help: consider removing `.try_into()`
-error: useless conversion to the same type: `std::string::String`
+error: useless conversion to the same type: `std::string::string::String`
   --> $DIR/useless_conversion_try.rs:30:21
    |
    |
... 3 lines skipped ...
    = help: consider removing `.try_into()`
-error: useless conversion to the same type: `std::string::String`
+error: useless conversion to the same type: `std::string::string::String`
   --> $DIR/useless_conversion_try.rs:32:21
    |
---
+error: useless conversion to the same type: `std::string::string::String`
   --> $DIR/useless_conversion_try.rs:38:21
    |
... 3 lines skipped ...
    = help: consider removing `.try_into()`
-error: useless conversion to the same type: `std::string::String`
+error: useless conversion to the same type: `std::string::string::String`
   --> $DIR/useless_conversion_try.rs:40:21
    |
    |
... 3 lines skipped ...
    = help: consider removing `.try_into()`
-error: useless conversion to the same type: `std::string::String`
+error: useless conversion to the same type: `std::string::string::String`
   --> $DIR/useless_conversion_try.rs:42:27
    |
    |
... 3 lines skipped ...
    = help: consider removing `.try_into()`
-error: aborting due to 9 previous errors
+error: aborting due to 7 previous errors
 



error: `useless conversion to the same type: `std::string::String`` not found in diagnostics on line 30
   |
   |
31 |     //~^ ERROR: useless conversion to the same type: `std::string::String`
   |


error: `useless conversion to the same type: `std::string::String`` not found in diagnostics on line 32
   |
   |
33 |     //~^ ERROR: useless conversion to the same type: `std::string::String`
   |


error: `useless conversion to the same type: `std::string::String`` not found in diagnostics on line 34
   |
   |
35 |     //~^ ERROR: useless conversion to the same type: `std::string::String`
   |


error: `useless conversion to the same type: `std::string::String`` not found in diagnostics on line 36
   |
   |
37 |     //~^ ERROR: useless conversion to the same type: `std::string::String`
   |


error: `useless conversion to the same type: `std::string::String`` not found in diagnostics on line 38
   |
   |
39 |     //~^ ERROR: useless conversion to the same type: `std::string::String`
   |


error: `useless conversion to the same type: `std::string::String`` not found in diagnostics on line 40
   |
   |
41 |     //~^ ERROR: useless conversion to the same type: `std::string::String`
   |


error: `useless conversion to the same type: `std::string::String`` not found in diagnostics on line 42
   |
   |
43 |         //~^ ERROR: useless conversion to the same type: `std::string::String`
   |

full stderr:
error: useless conversion to the same type: `T`
error: useless conversion to the same type: `T`
##[error]  --> tests/ui/useless_conversion_try.rs:5:13
   |
LL |     let _ = T::try_from(val).unwrap();
   |
   |
   = help: consider removing `T::try_from()`
  --> tests/ui/useless_conversion_try.rs:1:9
   |
LL | #![deny(clippy::useless_conversion)]
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^

error: useless conversion to the same type: `T`
##[error]  --> tests/ui/useless_conversion_try.rs:7:5
   |
LL |     val.try_into().unwrap()
   |     ^^^^^^^^^^^^^^
   |
   = help: consider removing `.try_into()`
error: useless conversion to the same type: `std::string::string::String`
##[error]  --> tests/ui/useless_conversion_try.rs:30:21
   |
   |
LL |     let _: String = "foo".to_string().try_into().unwrap();
   |
   |
   = help: consider removing `.try_into()`
error: useless conversion to the same type: `std::string::string::String`
##[error]  --> tests/ui/useless_conversion_try.rs:32:21
   |
   |
LL |     let _: String = TryFrom::try_from("foo".to_string()).unwrap();
   |
   = help: consider removing `TryFrom::try_from()`

error: useless conversion to the same type: `std::string::string::String`
error: useless conversion to the same type: `std::string::string::String`
##[error]  --> tests/ui/useless_conversion_try.rs:38:21
   |
LL |     let _: String = format!("Hello {}", "world").try_into().unwrap();
   |
   |
   = help: consider removing `.try_into()`
error: useless conversion to the same type: `std::string::string::String`
##[error]  --> tests/ui/useless_conversion_try.rs:40:21
   |
   |
LL |     let _: String = String::new().try_into().unwrap();
   |
   |
   = help: consider removing `.try_into()`
error: useless conversion to the same type: `std::string::string::String`
##[error]  --> tests/ui/useless_conversion_try.rs:42:27
   |
   |
LL |     let _: String = match String::from("_").try_into() {
   |
   |
   = help: consider removing `.try_into()`
error: aborting due to 7 previous errors


full stdout:
full stdout:



FAILED TEST: tests/ui/useless_conversion.rs
command: CLIPPY_CONF_DIR="tests" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/clippy-driver" "--error-format=json" "--emit=metadata" "-Aunused" "-Ainternal_features" "-Zui-testing" "-Dwarnings" "-Ldependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps" "--extern=clippy_config=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_config-88cd92e38577594d.rlib" "--extern=clippy_lints=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_lints-5233f2f9ab0a885d.rlib" "--extern=clippy_utils=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_utils-c555dfce7b7b4482.rlib" "--extern=futures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libfutures-9cfde403f4813861.rlib" "--extern=if_chain=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libif_chain-ae846d6788d6a9f1.rlib" "--extern=itertools=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libitertools-7f737c8175775d48.rlib" "--extern=parking_lot=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libparking_lot-5a42172620baa7f7.rlib" "--extern=quote=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libquote-067e61b28e8c0ae8.rlib" "--extern=regex=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libregex-56de3874fe91412c.rlib" "--extern=serde=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libserde-67f57c9d74692487.rlib" "--extern=serde_derive=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps/libserde_derive-1ddd9d5371e89c55.so" "--extern=syn=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libsyn-0080dad30daeaebf.rlib" "--extern=tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libtokio-95373de42170edbf.rlib" "-Ldependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui_test/tests/ui" "tests/ui/useless_conversion.rs" "--edition" "2021"
error: actual output differed from expected
Execute `cargo uibless` to update `tests/ui/useless_conversion.stderr` to the actual output
--- tests/ui/useless_conversion.stderr
+++ <stderr output>
+++ <stderr output>
 error: useless conversion to the same type: `T`
   --> $DIR/useless_conversion.rs:5:13
... 50 lines skipped ...
    |                 ^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `NUMBERS`
-error: useless conversion to the same type: `std::string::String`
+error: useless conversion to the same type: `std::string::string::String`
   --> $DIR/useless_conversion.rs:132:21
    |
    |
 LL |     let _: String = "foo".to_string().into();
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `"foo".to_string()`
-error: useless conversion to the same type: `std::string::String`
+error: useless conversion to the same type: `std::string::string::String`
   --> $DIR/useless_conversion.rs:133:21
    |
    |
 LL |     let _: String = From::from("foo".to_string());
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `From::from()`: `"foo".to_string()`
-error: useless conversion to the same type: `std::string::String`
-  --> $DIR/useless_conversion.rs:134:13
-   |
-   |
-LL |     let _ = String::from("foo".to_string());
-   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `String::from()`: `"foo".to_string()`
-error: useless conversion to the same type: `std::string::String`
-  --> $DIR/useless_conversion.rs:135:13
-   |
-   |
-LL |     let _ = String::from(format!("A: {:04}", 123));
-   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `String::from()`: `format!("A: {:04}", 123)`
 error: useless conversion to the same type: `std::str::Lines<'_>`
   --> $DIR/useless_conversion.rs:136:13
... 8 lines skipped ...
... 8 lines skipped ...
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `vec![1, 2, 3].into_iter()`
-error: useless conversion to the same type: `std::string::String`
+error: useless conversion to the same type: `std::string::string::String`
   --> $DIR/useless_conversion.rs:138:21
    |
---
full stderr:
error: useless conversion to the same type: `T`
##[error]  --> tests/ui/useless_conversion.rs:5:13
   |
LL |     let _ = T::from(val);
   |             ^^^^^^^^^^^^ help: consider removing `T::from()`: `val`
note: the lint level is defined here
  --> tests/ui/useless_conversion.rs:1:9
   |
LL | #![deny(clippy::useless_conversion)]
LL | #![deny(clippy::useless_conversion)]
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^

error: useless conversion to the same type: `T`
##[error]  --> tests/ui/useless_conversion.rs:6:5
   |
LL |     val.into()
   |     ^^^^^^^^^^ help: consider removing `.into()`: `val`
error: useless conversion to the same type: `i32`
##[error]  --> tests/ui/useless_conversion.rs:18:22
   |
   |
LL |         let _: i32 = 0i32.into();
   |                      ^^^^^^^^^^^ help: consider removing `.into()`: `0i32`
error: useless conversion to the same type: `std::str::Lines<'_>`
##[error]  --> tests/ui/useless_conversion.rs:48:22
   |
   |
LL |     if Some("ok") == lines.into_iter().next() {}
   |                      ^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `lines`
error: useless conversion to the same type: `std::str::Lines<'_>`
##[error]  --> tests/ui/useless_conversion.rs:53:21
   |
LL |     let mut lines = text.lines().into_iter();
LL |     let mut lines = text.lines().into_iter();
   |                     ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `text.lines()`
error: useless conversion to the same type: `std::str::Lines<'_>`
##[error]  --> tests/ui/useless_conversion.rs:59:22
   |
   |
LL |     if Some("ok") == text.lines().into_iter().next() {}
   |                      ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `text.lines()`
error: useless conversion to the same type: `std::ops::Range<i32>`
##[error]  --> tests/ui/useless_conversion.rs:65:13
   |
LL |     let _ = NUMBERS.into_iter().next();
LL |     let _ = NUMBERS.into_iter().next();
   |             ^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `NUMBERS`
error: useless conversion to the same type: `std::ops::Range<i32>`
##[error]  --> tests/ui/useless_conversion.rs:70:17
   |
LL |     let mut n = NUMBERS.into_iter();
LL |     let mut n = NUMBERS.into_iter();
   |                 ^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `NUMBERS`
error: useless conversion to the same type: `std::string::string::String`
##[error]  --> tests/ui/useless_conversion.rs:132:21
   |
   |
LL |     let _: String = "foo".to_string().into();
   |                     ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `"foo".to_string()`
error: useless conversion to the same type: `std::string::string::String`
##[error]  --> tests/ui/useless_conversion.rs:133:21
   |
   |
LL |     let _: String = From::from("foo".to_string());
   |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `From::from()`: `"foo".to_string()`
error: useless conversion to the same type: `std::str::Lines<'_>`
##[error]  --> tests/ui/useless_conversion.rs:136:13
   |
   |
LL |     let _ = "".lines().into_iter();
   |             ^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `"".lines()`
error: useless conversion to the same type: `std::vec::IntoIter<i32>`
##[error]  --> tests/ui/useless_conversion.rs:137:13
   |
   |
LL |     let _ = vec![1, 2, 3].into_iter().into_iter();
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `vec![1, 2, 3].into_iter()`
error: useless conversion to the same type: `std::string::string::String`
##[error]  --> tests/ui/useless_conversion.rs:138:21
   |
   |
LL |     let _: String = format!("Hello {}", "world").into();
   |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `format!("Hello {}", "world")`
error: useless conversion to the same type: `i32`
##[error]  --> tests/ui/useless_conversion.rs:143:13
   |
   |
LL |     let _ = i32::from(a + b) * 3;
   |             ^^^^^^^^^^^^^^^^ help: consider removing `i32::from()`: `(a + b)`

error: useless conversion to the same type: `Foo<'a'>`
   |
   |
LL |     let _: Foo<'a'> = s2.into();
   |                       ^^^^^^^^^ help: consider removing `.into()`: `s2`

error: useless conversion to the same type: `Foo<'a'>`
   |
   |
LL |     let _ = Foo::<'a'>::from(s3);
   |             ^^^^^^^^^^^^^^^^^^^^ help: consider removing `Foo::<'a'>::from()`: `s3`

error: useless conversion to the same type: `std::vec::IntoIter<Foo<'a'>>`
   |
   |
LL |     let _ = vec![s4, s4, s4].into_iter().into_iter();
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `vec![s4, s4, s4].into_iter()`

error: explicit call to `.into_iter()` in function argument accepting `IntoIterator`
   |
   |
LL |     b(vec![1, 2].into_iter());
   |       ^^^^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `vec![1, 2]`
   |
note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()`
   |
   |
LL |     fn b<T: IntoIterator<Item = i32>>(_: T) {}


error: explicit call to `.into_iter()` in function argument accepting `IntoIterator`
   |
   |
LL |     c(vec![1, 2].into_iter());
   |       ^^^^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `vec![1, 2]`
   |
note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()`
   |
   |
LL |     fn c(_: impl IntoIterator<Item = i32>) {}


error: explicit call to `.into_iter()` in function argument accepting `IntoIterator`
   |
   |
LL |     d(vec![1, 2].into_iter());
   |       ^^^^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `vec![1, 2]`
   |
note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()`
   |
   |
LL |         T: IntoIterator<Item = i32>,


error: explicit call to `.into_iter()` in function argument accepting `IntoIterator`
   |
   |
LL |     b(vec![1, 2].into_iter().into_iter());
   |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`s: `vec![1, 2]`
   |
note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()`
   |
   |
LL |     fn b<T: IntoIterator<Item = i32>>(_: T) {}


error: explicit call to `.into_iter()` in function argument accepting `IntoIterator`
   |
   |
LL |     b(vec![1, 2].into_iter().into_iter().into_iter());
   |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`s: `vec![1, 2]`
   |
note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()`
   |
   |
LL |     fn b<T: IntoIterator<Item = i32>>(_: T) {}


error: explicit call to `.into_iter()` in function argument accepting `IntoIterator`
   |
   |
LL |         foo2::<i32, _>([1, 2, 3].into_iter());
   |                        ^^^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `[1, 2, 3]`
   |
note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()`
   |
   |
LL |         I: IntoIterator<Item = i32> + Helper<X>,


error: explicit call to `.into_iter()` in function argument accepting `IntoIterator`
   |
   |
LL |         foo3([1, 2, 3].into_iter());
   |              ^^^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `[1, 2, 3]`
   |
note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()`
   |
LL |         I: IntoIterator<Item = i32>,
   |            ^^^^^^^^^^^^^^^^^^^^^^^^


error: explicit call to `.into_iter()` in function argument accepting `IntoIterator`
   |
   |
LL |         S1.foo([1, 2].into_iter());
   |                ^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `[1, 2]`
   |
note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()`
   |
   |
LL |             pub fn foo<I: IntoIterator>(&self, _: I) {}


error: explicit call to `.into_iter()` in function argument accepting `IntoIterator`
   |
   |
LL |         v0.into_iter().interleave_shortest(v1.into_iter());
   |                                            ^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `v1`
   |
note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()`
   |
LL |                 J: IntoIterator,
   |                    ^^^^^^^^^^^^

---



FAILED TEST: tests/ui/crashes/ice-3969.rs
command: CLIPPY_CONF_DIR="tests" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/clippy-driver" "--error-format=json" "--emit=metadata" "-Aunused" "-Ainternal_features" "-Zui-testing" "-Dwarnings" "-Ldependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps" "--extern=clippy_config=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_config-88cd92e38577594d.rlib" "--extern=clippy_lints=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_lints-5233f2f9ab0a885d.rlib" "--extern=clippy_utils=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libclippy_utils-c555dfce7b7b4482.rlib" "--extern=futures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libfutures-9cfde403f4813861.rlib" "--extern=if_chain=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libif_chain-ae846d6788d6a9f1.rlib" "--extern=itertools=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libitertools-7f737c8175775d48.rlib" "--extern=parking_lot=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libparking_lot-5a42172620baa7f7.rlib" "--extern=quote=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libquote-067e61b28e8c0ae8.rlib" "--extern=regex=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libregex-56de3874fe91412c.rlib" "--extern=serde=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libserde-67f57c9d74692487.rlib" "--extern=serde_derive=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps/libserde_derive-1ddd9d5371e89c55.so" "--extern=syn=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libsyn-0080dad30daeaebf.rlib" "--extern=tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/libtokio-95373de42170edbf.rlib" "-Ldependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/deps" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui_test/tests/ui/crashes" "tests/ui/crashes/ice-3969.rs" "--edition" "2021"
error: actual output differed from expected
Execute `cargo uibless` to update `tests/ui/crashes/ice-3969.stderr` to the actual output
--- tests/ui/crashes/ice-3969.stderr
+++ <stderr output>
+++ <stderr output>
 error: trait bound str: std::marker::Sized does not depend on any type or lifetime parameters
   --> $DIR/ice-3969.rs:20:10
... 17 lines skipped ...
    |          ^^^^^
 
-error: trait bound std::string::String: std::ops::Neg does not depend on any type or lifetime parameters
+error: trait bound std::string::string::String: std::ops::Neg does not depend on any type or lifetime parameters
   --> $DIR/ice-3969.rs:42:13
... 9 lines skipped ...
 error: aborting due to 5 previous errors
 



error: `trait bound std::string::String: std::ops::Neg does not depend on any type` not found in diagnostics on line 42
   |
   |
43 |     //~^ ERROR: trait bound std::string::String: std::ops::Neg does not depend on any type
   |

full stderr:
error: trait bound str: std::marker::Sized does not depend on any type or lifetime parameters
---
   |
   = note: `-D trivial-bounds` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(trivial_bounds)]`

error: trait bound for<'a> Dst<(dyn A + 'a)>: std::marker::Sized does not depend on any type or lifetime parameters
   |
   |
LL |     for<'a> Dst<dyn A + 'a>: Sized,

error: trait bound str: std::marker::Sized does not depend on any type or lifetime parameters
##[error]  --> tests/ui/crashes/ice-3969.rs:34:10
   |
   |
LL |     str: Sized,
   |          ^^^^^

error: trait bound std::string::string::String: std::ops::Neg does not depend on any type or lifetime parameters
   |
   |
LL |     String: ::std::ops::Neg<Output = String>,


error: trait bound i32: std::iter::Iterator does not depend on any type or lifetime parameters
   |
LL |     i32: Iterator,
   |          ^^^^^^^^

---
test result: FAIL. 17 failed; 927 passed; 1 ignored;



command did not execute successfully: cd "/checkout" && env -u MAKEFLAGS -u MFLAGS AR_x86_64_unknown_linux_gnu="ar" CARGO_INCREMENTAL="0" CARGO_PROFILE_RELEASE_DEBUG="0" CARGO_PROFILE_RELEASE_DEBUG_ASSERTIONS="true" CARGO_PROFILE_RELEASE_OVERFLOW_CHECKS="true" CARGO_PROFILE_RELEASE_STRIP="false" CARGO_TARGET_DIR="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools" CC_x86_64_unknown_linux_gnu="sccache cc" CFG_COMPILER_BUILD_TRIPLE="x86_64-unknown-linux-gnu" CFG_COMPILER_HOST_TRIPLE="x86_64-unknown-linux-gnu" CFG_RELEASE="1.77.0-nightly" CFG_RELEASE_CHANNEL="nightly" CFG_RELEASE_NUM="1.77.0" CFG_VERSION="1.77.0-nightly (0ba061eb7 2024-01-18)" CFG_VER_DATE="2024-01-18" CFG_VER_HASH="0ba061eb7a70db7d0b61b28b1f2a28425e6fc605" CFLAGS_x86_64_unknown_linux_gnu="-ffunction-sections -fdata-sections -fPIC -m64" CXXFLAGS_x86_64_unknown_linux_gnu="-ffunction-sections -fdata-sections -fPIC -m64" CXX_x86_64_unknown_linux_gnu="sccache c++" DOC_RUST_LANG_ORG_CHANNEL="https://doc.rust-lang.org/nightly" HOST_LIBS="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release" LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" LIBC_CHECK_CFG="1" LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/ci-llvm/lib" LIBZ_SYS_STATIC="1" LZMA_API_STATIC="1" RANLIB_x86_64_unknown_linux_gnu="ar s" REAL_LIBRARY_PATH_VAR="LD_LIBRARY_PATH" RUSTBUILD_NATIVE_DIR="/checkout/obj/build/x86_64-unknown-linux-gnu/native" RUSTC="/checkout/obj/build/bootstrap/debug/rustc" RUSTC_BOOTSTRAP="1" RUSTC_BREAK_ON_ICE="1" RUSTC_ERROR_METADATA_DST="/checkout/obj/build/tmp/extended-error-metadata" RUSTC_HOST_FLAGS="-Zunstable-options --check-cfg=cfg(bootstrap)" RUSTC_INSTALL_BINDIR="bin" RUSTC_LIBDIR="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" RUSTC_LIB_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" RUSTC_LINT_FLAGS="-Wrust_2018_idioms -Wunused_lifetimes -Dwarnings" RUSTC_REAL="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" RUSTC_SNAPSHOT="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" RUSTC_SNAPSHOT_LIBDIR="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" RUSTC_STAGE="2" RUSTC_SYSROOT="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" RUSTC_TEST_SUITE="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" RUSTC_TLS_MODEL_INITIAL_EXEC="1" RUSTC_VERBOSE="0" RUSTC_WRAPPER="/checkout/obj/build/bootstrap/debug/rustc" RUSTDOC="/checkout/obj/build/bootstrap/debug/rustdoc" RUSTDOCFLAGS="--cfg=windows_raw_dylib -Csymbol-mangling-version=v0 -Zunstable-options --check-cfg=cfg(bootstrap) --check-cfg=cfg(parallel_compiler) --check-cfg=cfg(rust_analyzer) --check-cfg=cfg(no_btreemap_remove_entry) --check-cfg=cfg(crossbeam_loom) --check-cfg=cfg(span_locations) --check-cfg=cfg(rustix_use_libc) --check-cfg=cfg(emulate_second_only_system) --check-cfg=cfg(windows_raw_dylib) -Dwarnings -Wrustdoc::invalid_codeblock_attributes --crate-version 1.77.0-nightly\t(0ba061eb7\t2024-01-18)" RUSTDOC_LIBDIR="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" RUSTDOC_REAL="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustdoc" RUSTFLAGS="--cfg=windows_raw_dylib -Csymbol-mangling-version=v0 -Zunstable-options --check-cfg=cfg(bootstrap) --check-cfg=cfg(parallel_compiler) --check-cfg=cfg(rust_analyzer) --check-cfg=cfg(no_btreemap_remove_entry) --check-cfg=cfg(crossbeam_loom) --check-cfg=cfg(span_locations) --check-cfg=cfg(rustix_use_libc) --check-cfg=cfg(emulate_second_only_system) --check-cfg=cfg(windows_raw_dylib) -Zmacro-backtrace -Clink-args=-Wl,-z,origin -Clink-args=-Wl,-rpath,$ORIGIN/../lib -Csplit-debuginfo=off -Zunstable-options" RUST_TEST_THREADS="16" SYSROOT="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" TERM="xterm" __CARGO_DEFAULT_LIB_METADATA="nightlytool-rustc" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "test" "--target" "x86_64-unknown-linux-gnu" "--release" "-Zcheck-cfg" "-Zbinary-dep-depinfo" "-j" "16" "--locked" "--color" "always" "--manifest-path" "/checkout/src/tools/clippy/Cargo.toml" "--" "--quiet"

stdout ----

stderr ----

rust-log-analyzer avatar Jan 19 '24 04:01 rust-log-analyzer

Still more work to do to to get clippy/tests/etc working with having String be a type alias, that I don't have time to do at the moment, so marking this as a draft for now. If someone else would like to take this as a starting point in the meantime, feel free.

zachs18 avatar May 03 '24 01:05 zachs18