Skip to content

Experiment: Introduce Try::Kind and TryAs - #163848

Draft
camsteffen wants to merge 8 commits into
rust-lang:mainfrom
camsteffen:try-kind
Draft

camsteffen wants to merge 8 commits into
rust-lang:mainfrom
camsteffen:try-kind

Conversation

@camsteffen

@camsteffen camsteffen commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

This is an experiment to re-design the Try trait. The elevator pitch is that "residual types" like Result<!, E> becomes just E. And Try::Kind is the new source of "what kind of residual is this?". Residual trait is replaced with TryAs, which uses the try type instead of the residual to transform between similar try types.

Custom try types can re-use std try kind values like TryResult to make a type that is inter-operable with Result with one instead of two TryFromBreak impls.

See also https://internals.rust-lang.org/t/pre-rfc-fat-try-another-attempt-to-re-design-the-try-trait/24618


The traits

pub trait Try: TryFromBreak<Self::Break, Self::Kind> {
    /// A marker type to signify the general meaning of the `?` operation on this type.
    /// For example, `<Result as Try>::Kind = TryResult`, and `TryResult` should be used for
    /// custom "result-like" types which may contain an error.
    /// When using `?` within a function, the return type of the function must implement
    /// `TryFromBreak<T, <T as Try>::Kind>` where `T` is the type of the target of `?`.
    type Kind;

    /// The type of the value produced by `?` when *not* short-circuiting.
    type Output;

    /// The type of the value produced by `?` when short-circuiting.
    type Break;

    fn from_output(output: Self::Output) -> Self;

    /// Used in `?` to determine if it should continue with a value or short-circuit with a value.
    fn branch(self) -> ControlFlow<Self::Break, Self::Output>;
}

/// Used to specify which residuals can be converted into which [`Try`] types.
pub trait TryFromBreak<B = <Self as Try>::Break, Kind = <Self as Try>::Kind> {
    fn from_break(b: B) -> Self;
}

/// The `TryAs` trait is used to derive a type that is equivalent but with
/// `Try::Output` changed to `T`.
pub trait TryAs<T>: Try {
    /// The Try type that is similar to Self, but with `Output` changed to `T`
    type Try: Try<Kind = Self::Kind, Output = T, Break = Self::Break>;
}

Advantages

Quadratic to linear FromResidual impl count for a family of Try types

Suppose you have 4 custom Result-like types (they produce a T or an E) and you want all of them to be inter-convertible with each other in try contexts. With try_trait_v2, you would need 12 FromResidual impls (n(n - 1) - one for each pair of types, both directions). With Kind and TryFromBreak, you would only need 4 TryFromBreak impls.

try_trait_v2:

  • impl<T, E> FromResidual<ResultOneResidual<E>> for ResultOne<T, E>
  • impl<T, E> FromResidual<ResultTwoResidual<E>> for ResultTwo<T, E>
  • impl<T, E> FromResidual<ResultOneResidual<E>> for ResultTwo<T, E>
  • impl<T, E> FromResidual<ResultTwoResidual<E>> for ResultOne<T, E>

This proposal:

  • impl<T, E> TryFromBreak<E, TryResult> for ResultOne<T, E>
  • impl<T, E> TryFromBreak<E, TryResult> for ResultTwo<T, E>

No residual "unwrapping"

try_trait_v2:

impl<T, E> FromResidual for Result<T, E> {
    fn from_residual(r: Result<!, E>) {
        match r {
            Err(e) => Err(e),
        }
    }
}

This propsal:

impl<T, E> TryFromBreak for Result<T, E> {
    fn from_break(e: E) {
        Err(e)
    }
}

Simple yeet semantics

The yeet keyword can simply use the TryFromBreak impl that is required by the Try trait. It does not need any dedicatedTryFromBreak impls nor a dedicated Try::Kind. You just yeet a Break value and it will be interpreted as having the Try::Kind of the current try scope. In try_trait_v2, yeet has a dedicated residual type and requires FromResidual impls to use it.

"kinds" is more teachable than "residual types"

A try kind is a family of inter-convertible try types that can all be used within a try context of that kind. There is no unifying concept like this with residual types.

Residual types are difficult concept to understand and teach. It's not obvious what information a residual type is intended to communicate exactly. You might think that a custom result-like type should use Result<!, E> as its residual type, but that would be wrong. Try "kinds" provide better separation of concerns - the Kind and the Break are separated. Try kinds like TryResult can be documented and explained as a standalone concept.

Function signatures with TryAs

Example with Arc::try_map

Before:

    pub fn try_map<R>(
        this: Self,
        f: impl FnOnce(&T) -> R,
    ) -> <R::Residual as Residual<Arc<R::Output, A>>>::TryType
    where
        R: Try,
        R::Residual: Residual<Arc<R::Output, A>>,

After:

    pub fn try_map<R>(
        this: Self,
        f: impl FnOnce(&T) -> R,
    ) -> <R as TryAs<Arc<<R as Try>::Output, A>>>::Try
    where
        R: TryAs<Arc<<R as Try>::Output, A>>,

r? @MusicalNinjaDad

@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Oct 6, 2026
@rustbot

rustbot commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator

Error: Failed to set assignee to MusicalNinjaDad: invalid assignee

Note: Only org members with at least the repository "read" role, users with write permissions, or people who have commented on the PR may be assigned.

Please file an issue on GitHub at triagebot if there's a problem with this bot, or reach out on #triagebot on Zulip.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job test-aarch64-gnu-llvm-22-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
Saved the actual stderr to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/borrowck/borrowck-move-out-of-overloaded-auto-deref/borrowck-move-out-of-overloaded-auto-deref.stderr`
diff of stderr:

12    |
13 LL |     let _x = <Vec<i32> as Clone>::clone(&Rc::new(vec![1, 2])).into_iter();
14    |              ++++++++++++++++++++++++++++                   +
+ help: you can `clone` the value and consume it, but this might not be your desired behavior
+    |
+ LL |     let _x = <Vec<i32> as Clone>::clone(&Rc::new(vec![1, 2])).into_iter();
+    |              ++++++++++++++++++++++++++++                   +
15 
16 error: aborting due to 1 previous error
17 

---

2 use std::rc::Rc;
3 
4 pub fn main() {
-     let _x = <Vec<i32> as Clone>::clone(&Rc::new(vec![1, 2])).into_iter();
+     let _x = Rc::new(vec![1, 2]).into_iter();
6     //~^ ERROR [E0507]
7 }
8 


The actual fixed differed from the expected fixed
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args borrowck/borrowck-move-out-of-overloaded-auto-deref.rs`

error: 2 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/borrowck/borrowck-move-out-of-overloaded-auto-deref.rs" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/borrowck/borrowck-move-out-of-overloaded-auto-deref" "-Znext-solver=coherence" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "--edition=2015"
stdout: none
--- stderr -------------------------------
error[E0507]: cannot move out of an `Rc`
##[error]  --> /checkout/tests/ui/borrowck/borrowck-move-out-of-overloaded-auto-deref.rs:5:14
   |
LL |     let _x = Rc::new(vec![1, 2]).into_iter();
   |              ^^^^^^^^^^^^^^^^^^^ ----------- value moved due to this method call
   |              |
   |              move occurs because value has type `Vec<i32>`, which does not implement the `Copy` trait
   |
note: `std::iter::IntoIterator::into_iter` takes ownership of the receiver `self`, which moves value
  --> /rustc/FAKE_PREFIX/library/core/src/iter/traits/collect.rs:312:17
help: you can `clone` the value and consume it, but this might not be your desired behavior
   |
LL |     let _x = <Vec<i32> as Clone>::clone(&Rc::new(vec![1, 2])).into_iter();
   |              ++++++++++++++++++++++++++++                   +
help: you can `clone` the value and consume it, but this might not be your desired behavior
   |
LL |     let _x = <Vec<i32> as Clone>::clone(&Rc::new(vec![1, 2])).into_iter();
   |              ++++++++++++++++++++++++++++                   +

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0507`.
---
Saved the actual stderr to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/delegation/self-coercion-errors/self-coercion-errors.stderr`
diff of stderr:

1832    |
1833 LL |     fn r#box(self: Box<Self>) -> i32 { 4 }
1834    |              ^^^^
- note: if `F` implemented `Clone`, you could clone the value
-   --> $DIR/self-coercion-errors.rs:23:1
-    |
- LL | struct F;
-    | ^^^^^^^^ consider implementing `Clone` for this type
- ...
- LL |     reuse Trait::* { self.0 }
-    |                      ------ you could clone this value
1843 help: you could `clone` the value and consume it, if the `F: Clone` trait bound could be satisfied
1844    |
1845 LL |     reuse Trait::* { <Box<F> as Clone>::clone(&self.0) }

1893    |
1894 LL |     fn pin_box(self: Pin<Box<Self>>) -> i32 { 7 }
1895    |                ^^^^
- note: if `F` implemented `Clone`, you could clone the value
-   --> $DIR/self-coercion-errors.rs:23:1
-    |
- LL | struct F;
-    | ^^^^^^^^ consider implementing `Clone` for this type
- ...
- LL |     reuse Trait::* { self.0 }
-    |                      ------ you could clone this value
1904 help: you could `clone` the value and consume it, if the `F: Clone` trait bound could be satisfied
1905    |
1906 LL |     reuse Trait::* { <Pin<Box<F>> as Clone>::clone(&self.0) }


The actual stderr differed from the expected stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args delegation/self-coercion-errors.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/delegation/self-coercion-errors.rs" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/delegation/self-coercion-errors" "-Znext-solver=coherence" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "--edition=2015"
stdout: none
--- stderr -------------------------------
error[E0277]: the trait bound `fn() -> F {foo}: Trait` is not satisfied
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:46:9
   |
LL |     reuse Trait::{by_value, by_mut_ref, by_ref} {
   |                   -------- required by a bound introduced by this call
...
LL |         foo
   |         ^^^ the trait `Trait` is not implemented for fn item `fn() -> F {foo}`
   |
help: use parentheses to call this function
   |
LL |         foo()
   |            ++

error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:46:9
   |
LL |     reuse Trait::{by_value, by_mut_ref, by_ref} {
   |                             ---------- arguments to this function are incorrect
...
LL |         foo
   |         ^^^ expected `&mut _`, found fn item
   |
   = note: expected mutable reference `&mut _`
                        found fn item `fn() -> F {foo}`
note: method defined here
  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:12:8
   |
LL |     fn by_mut_ref(&mut self) -> i32 { 2 }
   |        ^^^^^^^^^^ ---------
help: consider mutably borrowing here
   |
LL |         &mut foo
   |         ++++

error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:46:9
   |
LL |     reuse Trait::{by_value, by_mut_ref, by_ref} {
   |                                         ------ arguments to this function are incorrect
...
LL |         foo
   |         ^^^ expected `&_`, found fn item
   |
   = note: expected reference `&_`
                found fn item `fn() -> F {foo}`
note: method defined here
  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:13:8
   |
LL |     fn by_ref(&self) -> i32 { 3 }
   |        ^^^^^^ -----
help: consider borrowing here
   |
LL |         &foo
   |         +

error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:85:22
   |
LL |     reuse Trait::* { &mut self.0 }
   |                  -   ^^^^^^^^^^^ expected `Box<_>`, found `&mut F`
   |                  |
   |                  arguments to this function are incorrect
   |
   = note:         expected struct `Box<_>`
           found mutable reference `&mut F`
   = note: for more on the distinction between the stack and the heap, read https://doc.rust-lang.org/book/ch15-01-box.html, https://doc.rust-lang.org/rust-by-example/std/box.html, and https://doc.rust-lang.org/std/boxed/index.html
note: method defined here
  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:14:8
   |
LL |     fn r#box(self: Box<Self>) -> i32 { 4 }
   |        ^^^^^ ----
help: store this in the heap by calling `Box::new`
   |
LL |     reuse Trait::* { Box::new(&mut self.0) }
   |                      +++++++++           +

error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:85:22
   |
LL |     reuse Trait::* { &mut self.0 }
   |                  -   ^^^^^^^^^^^ expected `Arc<_>`, found `&mut F`
   |                  |
   |                  arguments to this function are incorrect
   |
   = note:         expected struct `Arc<_>`
           found mutable reference `&mut F`
note: method defined here
  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:15:8
   |
LL |     fn arc(self: Arc<Self>) -> i32 { 5 }
   |        ^^^ ----
help: call `Into::into` on this expression to convert `&mut F` into `Arc<_>`
   |
LL |     reuse Trait::* { (&mut self.0).into() }
   |                      +           ++++++++

error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:85:22
   |
LL |     reuse Trait::* { &mut self.0 }
   |                  -   ^^^^^^^^^^^ expected `Rc<_>`, found `&mut F`
   |                  |
   |                  arguments to this function are incorrect
   |
   = note:         expected struct `Rc<_>`
           found mutable reference `&mut F`
note: method defined here
  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:16:8
   |
LL |     fn rc(self: Rc<Self>) -> i32 { 6 }
   |        ^^ ----
help: call `Into::into` on this expression to convert `&mut F` into `Rc<_>`
   |
LL |     reuse Trait::* { (&mut self.0).into() }
   |                      +           ++++++++

error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:85:22
   |
LL |     reuse Trait::* { &mut self.0 }
   |                  -   ^^^^^^^^^^^ expected `Pin<Box<_>>`, found `&mut F`
   |                  |
   |                  arguments to this function are incorrect
   |
   = note:         expected struct `Pin<Box<_>>`
           found mutable reference `&mut F`
note: method defined here
  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:17:8
   |
LL |     fn pin_box(self: Pin<Box<Self>>) -> i32 { 7 }
   |        ^^^^^^^ ----
help: you need to pin and box this expression
   |
LL |     reuse Trait::* { Box::pin(&mut self.0) }
   |                      +++++++++           +

error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:85:22
   |
LL |     reuse Trait::* { &mut self.0 }
   |                  -   ^^^^^^^^^^^ expected `Pin<Rc<_>>`, found `&mut F`
   |                  |
   |                  arguments to this function are incorrect
   |
   = note:         expected struct `Pin<Rc<_>>`
           found mutable reference `&mut F`
note: method defined here
  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:18:8
   |
LL |     fn pin_rc(self: Pin<Rc<Self>>) -> i32 { 8 }
   |        ^^^^^^ ----

error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:85:22
   |
LL |     reuse Trait::* { &mut self.0 }
   |                  -   ^^^^^^^^^^^ expected `Pin<Arc<_>>`, found `&mut F`
   |                  |
   |                  arguments to this function are incorrect
   |
   = note:         expected struct `Pin<Arc<_>>`
           found mutable reference `&mut F`
note: method defined here
  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:19:8
   |
LL |     fn pin_arc(self: Pin<Arc<Self>>) -> i32 { 9 }
   |        ^^^^^^^ ----

error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:85:22
   |
LL |     reuse Trait::* { &mut self.0 }
   |                  -   ^^^^^^^^^^^ expected `Box<Box<_>>`, found `&mut F`
   |                  |
   |                  arguments to this function are incorrect
   |
   = note:         expected struct `Box<Box<_>>`
           found mutable reference `&mut F`
note: method defined here
  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:20:8
   |
LL |     fn box_box(self: Box<Box<Self>>) -> i32 { 10 }
   |        ^^^^^^^ ----

error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:101:22
   |
LL |     reuse Trait::* { &self.0 }
   |                  -   ^^^^^^^ expected `Box<_>`, found `&F`
   |                  |
   |                  arguments to this function are incorrect
   |
   = note: expected struct `Box<_>`
           found reference `&F`
   = note: for more on the distinction between the stack and the heap, read https://doc.rust-lang.org/book/ch15-01-box.html, https://doc.rust-lang.org/rust-by-example/std/box.html, and https://doc.rust-lang.org/std/boxed/index.html
note: method defined here
  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:14:8
   |
LL |     fn r#box(self: Box<Self>) -> i32 { 4 }
   |        ^^^^^ ----
help: store this in the heap by calling `Box::new`
   |
LL |     reuse Trait::* { Box::new(&self.0) }
   |                      +++++++++       +

error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:101:22
   |
LL |     reuse Trait::* { &self.0 }
   |                  -   ^^^^^^^ expected `Arc<_>`, found `&F`
   |                  |
   |                  arguments to this function are incorrect
   |
   = note: expected struct `Arc<_>`
           found reference `&F`
note: method defined here
  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:15:8
   |
LL |     fn arc(self: Arc<Self>) -> i32 { 5 }
   |        ^^^ ----
help: call `Into::into` on this expression to convert `&F` into `Arc<_>`
   |
LL |     reuse Trait::* { (&self.0).into() }
   |                      +       ++++++++

error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:101:22
   |
LL |     reuse Trait::* { &self.0 }
   |                  -   ^^^^^^^ expected `Rc<_>`, found `&F`
   |                  |
   |                  arguments to this function are incorrect
   |
   = note: expected struct `Rc<_>`
           found reference `&F`
note: method defined here
  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:16:8
   |
LL |     fn rc(self: Rc<Self>) -> i32 { 6 }
   |        ^^ ----
help: call `Into::into` on this expression to convert `&F` into `Rc<_>`
   |
LL |     reuse Trait::* { (&self.0).into() }
   |                      +       ++++++++

error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:101:22
   |
LL |     reuse Trait::* { &self.0 }
   |                  -   ^^^^^^^ expected `Pin<Box<_>>`, found `&F`
   |                  |
   |                  arguments to this function are incorrect
   |
   = note: expected struct `Pin<Box<_>>`
           found reference `&F`
note: method defined here
  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:17:8
   |
LL |     fn pin_box(self: Pin<Box<Self>>) -> i32 { 7 }
   |        ^^^^^^^ ----
help: you need to pin and box this expression
   |
LL |     reuse Trait::* { Box::pin(&self.0) }
   |                      +++++++++       +

error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:101:22
   |
LL |     reuse Trait::* { &self.0 }
   |                  -   ^^^^^^^ expected `Pin<Rc<_>>`, found `&F`
   |                  |
   |                  arguments to this function are incorrect
   |
   = note: expected struct `Pin<Rc<_>>`
           found reference `&F`
note: method defined here
  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:18:8
   |
LL |     fn pin_rc(self: Pin<Rc<Self>>) -> i32 { 8 }
   |        ^^^^^^ ----

error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:101:22
   |
LL |     reuse Trait::* { &self.0 }
   |                  -   ^^^^^^^ expected `Pin<Arc<_>>`, found `&F`
   |                  |
   |                  arguments to this function are incorrect
   |
   = note: expected struct `Pin<Arc<_>>`
           found reference `&F`
note: method defined here
  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:19:8
   |
LL |     fn pin_arc(self: Pin<Arc<Self>>) -> i32 { 9 }
   |        ^^^^^^^ ----

error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:101:22
   |
LL |     reuse Trait::* { &self.0 }
   |                  -   ^^^^^^^ expected `Box<Box<_>>`, found `&F`
   |                  |
   |                  arguments to this function are incorrect
   |
   = note: expected struct `Box<Box<_>>`
           found reference `&F`
note: method defined here
  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:20:8
   |
LL |     fn box_box(self: Box<Box<Self>>) -> i32 { 10 }
   |        ^^^^^^^ ----

error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:116:22
   |
LL |     reuse Trait::* { &&&&self.0 }
   |                  -   ^^^^^^^^^^ expected `Box<_>`, found `&&&&F`
   |                  |
   |                  arguments to this function are incorrect
   |
   = note: expected struct `Box<_>`
           found reference `&&&&F`
   = note: for more on the distinction between the stack and the heap, read https://doc.rust-lang.org/book/ch15-01-box.html, https://doc.rust-lang.org/rust-by-example/std/box.html, and https://doc.rust-lang.org/std/boxed/index.html
note: method defined here
  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:14:8
   |
LL |     fn r#box(self: Box<Self>) -> i32 { 4 }
   |        ^^^^^ ----
help: store this in the heap by calling `Box::new`
   |
LL |     reuse Trait::* { Box::new(&&&&self.0) }
   |                      +++++++++          +

error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:116:22
   |
LL |     reuse Trait::* { &&&&self.0 }
   |                  -   ^^^^^^^^^^ expected `Arc<_>`, found `&&&&F`
   |                  |
   |                  arguments to this function are incorrect
   |
   = note: expected struct `Arc<_>`
           found reference `&&&&F`
note: method defined here
  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:15:8
   |
LL |     fn arc(self: Arc<Self>) -> i32 { 5 }
   |        ^^^ ----
help: call `Into::into` on this expression to convert `&&&&F` into `Arc<_>`
   |
LL |     reuse Trait::* { (&&&&self.0).into() }
   |                      +          ++++++++

error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:116:22
   |
LL |     reuse Trait::* { &&&&self.0 }
   |                  -   ^^^^^^^^^^ expected `Rc<_>`, found `&&&&F`
   |                  |
   |                  arguments to this function are incorrect
   |
   = note: expected struct `Rc<_>`
           found reference `&&&&F`
note: method defined here
  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:16:8
   |
LL |     fn rc(self: Rc<Self>) -> i32 { 6 }
   |        ^^ ----
help: call `Into::into` on this expression to convert `&&&&F` into `Rc<_>`
   |
LL |     reuse Trait::* { (&&&&self.0).into() }
   |                      +          ++++++++

error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:116:22
   |
LL |     reuse Trait::* { &&&&self.0 }
   |                  -   ^^^^^^^^^^ expected `Pin<Box<_>>`, found `&&&&F`
   |                  |
   |                  arguments to this function are incorrect
   |
   = note: expected struct `Pin<Box<_>>`
           found reference `&&&&F`
note: method defined here
  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:17:8
   |
LL |     fn pin_box(self: Pin<Box<Self>>) -> i32 { 7 }
   |        ^^^^^^^ ----
help: you need to pin and box this expression
   |
LL |     reuse Trait::* { Box::pin(&&&&self.0) }
   |                      +++++++++          +

error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:116:22
   |
LL |     reuse Trait::* { &&&&self.0 }
   |                  -   ^^^^^^^^^^ expected `Pin<Rc<_>>`, found `&&&&F`
   |                  |
   |                  arguments to this function are incorrect
   |
   = note: expected struct `Pin<Rc<_>>`
           found reference `&&&&F`
note: method defined here
  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:18:8
   |
LL |     fn pin_rc(self: Pin<Rc<Self>>) -> i32 { 8 }
   |        ^^^^^^ ----

error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:116:22
   |
LL |     reuse Trait::* { &&&&self.0 }
   |                  -   ^^^^^^^^^^ expected `Pin<Arc<_>>`, found `&&&&F`
   |                  |
   |                  arguments to this function are incorrect
   |
   = note: expected struct `Pin<Arc<_>>`
           found reference `&&&&F`
note: method defined here
  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:19:8
   |
LL |     fn pin_arc(self: Pin<Arc<Self>>) -> i32 { 9 }
   |        ^^^^^^^ ----

error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:116:22
   |
LL |     reuse Trait::* { &&&&self.0 }
   |                  -   ^^^^^^^^^^ expected `Box<Box<_>>`, found `&&&&F`
   |                  |
   |                  arguments to this function are incorrect
   |
   = note: expected struct `Box<Box<_>>`
           found reference `&&&&F`
note: method defined here
  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:20:8
   |
LL |     fn box_box(self: Box<Box<Self>>) -> i32 { 10 }
   |        ^^^^^^^ ----

error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:131:22
   |
LL |     reuse Trait::* { self.0.as_ref() }
   |                  -   ^^^^^^^^^^^^^^^ expected `Box<_>`, found `&F`
   |                  |
   |                  arguments to this function are incorrect
   |
   = note: expected struct `Box<_>`
           found reference `&F`
note: method defined here
  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:14:8
   |
LL |     fn r#box(self: Box<Self>) -> i32 { 4 }
---

error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:222:22
   |
LL |     reuse Trait::* { self.0 }
   |                  -   ^^^^^^ expected `&mut _`, found `OtherStruct`
   |                  |
   |                  arguments to this function are incorrect
   |
   = note: expected mutable reference `&mut _`
                         found struct `OtherStruct`
note: method defined here
  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:12:8
   |
LL |     fn by_mut_ref(&mut self) -> i32 { 2 }
   |        ^^^^^^^^^^ ---------
help: consider mutably borrowing here
   |
LL |     reuse Trait::* { &mut self.0 }
   |                      ++++

error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:222:22
   |
LL |     reuse Trait::* { self.0 }
   |                  -   ^^^^^^ expected `&_`, found `OtherStruct`
   |                  |
   |                  arguments to this function are incorrect
   |
   = note: expected reference `&_`
                 found struct `OtherStruct`
note: method defined here
  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:13:8
   |
LL |     fn by_ref(&self) -> i32 { 3 }
   |        ^^^^^^ -----
help: consider borrowing here
   |
LL |     reuse Trait::* { &self.0 }
   |                      +

error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:222:22
   |
LL |     reuse Trait::* { self.0 }
   |                  -   ^^^^^^ expected `Box<_>`, found `OtherStruct`
   |                  |
   |                  arguments to this function are incorrect
   |
note: there is a field `0` on `Box<X9>` with type `std::ptr::Unique<X9>` but it is private; `0` from `X9` was accessed through auto-deref instead
  --> /rustc/FAKE_PREFIX/library/alloc/src/boxed.rs:236:11
   |
   = note: in this struct
  ::: /rustc/FAKE_PREFIX/library/alloc/src/boxed.rs:239:2
   |
---
              found struct `OtherStruct`
note: method defined here
  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:14:8
   |
LL |     fn r#box(self: Box<Self>) -> i32 { 4 }
   |        ^^^^^ ----
help: consider removing the tuple struct field `0`
   |
LL -     reuse Trait::* { self.0 }
LL +     reuse Trait::* { self }
   |

error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:222:22
   |
LL |     reuse Trait::* { self.0 }
   |                  -   ^^^^^^ expected `Arc<_>`, found `OtherStruct`
   |                  |
   |                  arguments to this function are incorrect
   |
   = note: expected struct `Arc<_>`
              found struct `OtherStruct`
note: method defined here
  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:15:8
   |
LL |     fn arc(self: Arc<Self>) -> i32 { 5 }
   |        ^^^ ----
help: consider removing the tuple struct field `0`
   |
LL -     reuse Trait::* { self.0 }
LL +     reuse Trait::* { self }
   |

error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:222:22
   |
LL |     reuse Trait::* { self.0 }
   |                  -   ^^^^^^ expected `Rc<_>`, found `OtherStruct`
   |                  |
   |                  arguments to this function are incorrect
   |
   = note: expected struct `Rc<_>`
              found struct `OtherStruct`
note: method defined here
  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:16:8
   |
LL |     fn rc(self: Rc<Self>) -> i32 { 6 }
   |        ^^ ----
help: consider removing the tuple struct field `0`
   |
LL -     reuse Trait::* { self.0 }
LL +     reuse Trait::* { self }
   |

error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:222:22
   |
LL |     reuse Trait::* { self.0 }
   |                  -   ^^^^^^ expected `Pin<Box<_>>`, found `OtherStruct`
   |                  |
   |                  arguments to this function are incorrect
   |
   = note: expected struct `Pin<Box<_>>`
              found struct `OtherStruct`
note: method defined here
  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:17:8
   |
LL |     fn pin_box(self: Pin<Box<Self>>) -> i32 { 7 }
   |        ^^^^^^^ ----
help: consider removing the tuple struct field `0`
   |
LL -     reuse Trait::* { self.0 }
LL +     reuse Trait::* { self }
   |

error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:222:22
   |
LL |     reuse Trait::* { self.0 }
   |                  -   ^^^^^^ expected `Pin<Rc<_>>`, found `OtherStruct`
   |                  |
   |                  arguments to this function are incorrect
   |
   = note: expected struct `Pin<Rc<_>>`
              found struct `OtherStruct`
note: method defined here
  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:18:8
   |
LL |     fn pin_rc(self: Pin<Rc<Self>>) -> i32 { 8 }
   |        ^^^^^^ ----
help: consider removing the tuple struct field `0`
   |
LL -     reuse Trait::* { self.0 }
LL +     reuse Trait::* { self }
   |

error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:222:22
   |
LL |     reuse Trait::* { self.0 }
   |                  -   ^^^^^^ expected `Pin<Arc<_>>`, found `OtherStruct`
   |                  |
   |                  arguments to this function are incorrect
   |
   = note: expected struct `Pin<Arc<_>>`
              found struct `OtherStruct`
note: method defined here
  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:19:8
   |
LL |     fn pin_arc(self: Pin<Arc<Self>>) -> i32 { 9 }
   |        ^^^^^^^ ----
help: consider removing the tuple struct field `0`
   |
LL -     reuse Trait::* { self.0 }
LL +     reuse Trait::* { self }
   |

error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:222:22
   |
LL |     reuse Trait::* { self.0 }
   |                  -   ^^^^^^ expected `Box<Box<_>>`, found `OtherStruct`
   |                  |
   |                  arguments to this function are incorrect
   |
note: there is a field `0` on `Box<Box<X9>>` with type `std::ptr::Unique<Box<X9>>` but it is private; `0` from `X9` was accessed through auto-deref instead
  --> /rustc/FAKE_PREFIX/library/alloc/src/boxed.rs:236:11
   |
   = note: in this struct
  ::: /rustc/FAKE_PREFIX/library/alloc/src/boxed.rs:239:2
   |
---
              found struct `OtherStruct`
note: method defined here
  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:20:8
   |
LL |     fn box_box(self: Box<Box<Self>>) -> i32 { 10 }
   |        ^^^^^^^ ----
help: consider removing the tuple struct field `0`
   |
LL -     reuse Trait::* { self.0 }
LL +     reuse Trait::* { self }
   |

error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:61:9
   |
---

error[E0507]: cannot move out of a mutable reference
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:74:9
   |
LL |     reuse Trait::{by_value, by_mut_ref, by_ref} {
   |                   -------- value moved due to this method call
...
LL |         &mut x
   |         ^^^^^^ move occurs because value has type `F`, which does not implement the `Copy` trait
   |
---

error[E0507]: cannot move out of a mutable reference
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:85:22
   |
LL |     reuse Trait::* { &mut self.0 }
   |                  -   ^^^^^^^^^^^ move occurs because value has type `F`, which does not implement the `Copy` trait
   |                  |
   |                  value moved due to this method call
   |
note: `Trait::by_value` takes ownership of the receiver `self`, which moves value
  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:11:17
---
   |
LL | struct F;
   | ^^^^^^^^ consider implementing `Clone` for this type
...
LL |     reuse Trait::* { &mut self.0 }
   |                      ----------- you could clone this value

error[E0596]: cannot borrow `self.0` as mutable, as `self` is not declared as mutable
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:85:22
   |
LL |     reuse Trait::* { &mut self.0 }
   |                      ^^^^^^^^^^^ cannot borrow as mutable
   |
help: consider changing this to be mutable
   |
LL |     reuse Trait::mut * { &mut self.0 }
   |                  +++

error[E0596]: cannot borrow `self.0` as mutable, as it is behind a `&` reference
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:85:22
   |
LL |     reuse Trait::* { &mut self.0 }
   |                      ^^^^^^^^^^^ `self` is a `&` reference, so it cannot be borrowed as mutable
   |
help: consider changing this to be a mutable reference
   |
LL -     reuse Trait::* { &mut self.0 }
LL +     reuse Trait::&mut self { &mut self.0 }
   |

error[E0507]: cannot move out of a shared reference
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:101:22
   |
LL |     reuse Trait::* { &self.0 }
   |                  -   ^^^^^^^ move occurs because value has type `F`, which does not implement the `Copy` trait
   |                  |
   |                  value moved due to this method call
   |
note: `Trait::by_value` takes ownership of the receiver `self`, which moves value
  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:11:17
---
   |
LL | struct F;
   | ^^^^^^^^ consider implementing `Clone` for this type
...
LL |     reuse Trait::* { &self.0 }
   |                      ------- you could clone this value

error[E0596]: cannot borrow data in a `&` reference as mutable
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:101:22
   |
LL |     reuse Trait::* { &self.0 }
   |                      ^^^^^^^ cannot borrow as mutable

error[E0507]: cannot move out of a shared reference
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:116:22
   |
LL |     reuse Trait::* { &&&&self.0 }
   |                  -   ^^^^^^^^^^ move occurs because value has type `F`, which does not implement the `Copy` trait
   |                  |
   |                  value moved due to this method call
   |
note: `Trait::by_value` takes ownership of the receiver `self`, which moves value
  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:11:17
---
   |
LL | struct F;
   | ^^^^^^^^ consider implementing `Clone` for this type
...
LL |     reuse Trait::* { &&&&self.0 }
   |                      ---------- you could clone this value

error[E0596]: cannot borrow data in a `&` reference as mutable
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:116:22
   |
LL |     reuse Trait::* { &&&&self.0 }
   |                      ^^^^^^^^^^ cannot borrow as mutable

error[E0507]: cannot move out of a shared reference
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:131:22
   |
LL |     reuse Trait::* { self.0.as_ref() }
   |                  -   ^^^^^^^^^^^^^^^ move occurs because value has type `F`, which does not implement the `Copy` trait
   |                  |
   |                  value moved due to this method call
   |
note: `Trait::by_value` takes ownership of the receiver `self`, which moves value
  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:11:17
---
   |
LL | struct F;
   | ^^^^^^^^ consider implementing `Clone` for this type
...
LL |     reuse Trait::* { self.0.as_ref() }
   |                      --------------- you could clone this value

error[E0596]: cannot borrow data in a `&` reference as mutable
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:131:22
   |
LL |     reuse Trait::* { self.0.as_ref() }
   |                      ^^^^^^^^^^^^^^^ cannot borrow as mutable

error[E0507]: cannot move out of a mutable reference
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:146:22
   |
LL |     reuse Trait::* { &mut &mut &mut self.0 }
   |                  -   ^^^^^^^^^^^^^^^^^^^^^ move occurs because value has type `F`, which does not implement the `Copy` trait
   |                  |
   |                  value moved due to this method call
   |
note: `Trait::by_value` takes ownership of the receiver `self`, which moves value
  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:11:17
---
   |
LL | struct F;
   | ^^^^^^^^ consider implementing `Clone` for this type
...
LL |     reuse Trait::* { &mut &mut &mut self.0 }
   |                      --------------------- you could clone this value

error[E0596]: cannot borrow `self.0` as mutable, as `self` is not declared as mutable
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:146:32
   |
LL |     reuse Trait::* { &mut &mut &mut self.0 }
   |                                ^^^^^^^^^^^ cannot borrow as mutable
   |
help: consider changing this to be mutable
   |
LL |     reuse Trait::mut * { &mut &mut &mut self.0 }
   |                  +++

error[E0596]: cannot borrow `self.0` as mutable, as it is behind a `&` reference
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:146:32
   |
LL |     reuse Trait::* { &mut &mut &mut self.0 }
   |                                ^^^^^^^^^^^ `self` is a `&` reference, so it cannot be borrowed as mutable
   |
help: consider changing this to be a mutable reference
   |
LL -     reuse Trait::* { &mut &mut &mut self.0 }
LL +     reuse Trait::&mut self { &mut &mut &mut self.0 }
   |

error[E0507]: cannot move out of a shared reference
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:162:22
   |
LL |     reuse Trait::* { &&mut self.0 }
   |                  -   ^^^^^^^^^^^^ move occurs because value has type `F`, which does not implement the `Copy` trait
   |                  |
   |                  value moved due to this method call
   |
note: `Trait::by_value` takes ownership of the receiver `self`, which moves value
  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:11:17
---
   |
LL | struct F;
   | ^^^^^^^^ consider implementing `Clone` for this type
...
LL |     reuse Trait::* { &&mut self.0 }
   |                      ------------ you could clone this value

error[E0596]: cannot borrow `self.0` as mutable, as `self` is not declared as mutable
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:162:23
   |
LL |     reuse Trait::* { &&mut self.0 }
   |                       ^^^^^^^^^^^ cannot borrow as mutable
   |
help: consider changing this to be mutable
   |
LL |     reuse Trait::mut * { &&mut self.0 }
   |                  +++

error[E0596]: cannot borrow data in a `&` reference as mutable
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:162:22
   |
LL |     reuse Trait::* { &&mut self.0 }
   |                      ^^^^^^^^^^^^ cannot borrow as mutable

error[E0596]: cannot borrow `self.0` as mutable, as it is behind a `&` reference
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:162:23
   |
LL |     reuse Trait::* { &&mut self.0 }
   |                       ^^^^^^^^^^^ `self` is a `&` reference, so it cannot be borrowed as mutable
   |
help: consider changing this to be a mutable reference
   |
LL -     reuse Trait::* { &&mut self.0 }
LL +     reuse Trait::&mut self { &&mut self.0 }
   |

error[E0507]: cannot move out of an `Arc`
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:191:22
   |
LL |     reuse Trait::* { self.0 }
   |                  -   ^^^^^^ move occurs because value has type `F`, which does not implement the `Copy` trait
   |                  |
   |                  value moved due to this method call
   |
note: `Trait::by_value` takes ownership of the receiver `self`, which moves value
  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:11:17
---
   |
LL | struct F;
   | ^^^^^^^^ consider implementing `Clone` for this type
...
LL |     reuse Trait::* { self.0 }
   |                      ------ you could clone this value

error[E0596]: cannot borrow data in an `Arc` as mutable
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:191:22
   |
LL |     reuse Trait::* { self.0 }
   |                      ^^^^^^ cannot borrow as mutable
   |
   = help: trait `DerefMut` is required to modify through a dereference, but it is not implemented for `Arc<Box<F>>`

error[E0507]: cannot move out of an `Arc`
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:191:22
   |
LL |     reuse Trait::* { self.0 }
   |                  -   ^^^^^^ move occurs because value has type `Box<F>`, which does not implement the `Copy` trait
   |                  |
   |                  value moved due to this method call
   |
note: `Trait::r#box` takes ownership of the receiver `self`, which moves value
  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:14:14
   |
LL |     fn r#box(self: Box<Self>) -> i32 { 4 }
   |              ^^^^
help: you could `clone` the value and consume it, if the `F: Clone` trait bound could be satisfied
   |
LL |     reuse Trait::* { <Box<F> as Clone>::clone(&self.0) }
   |                      ++++++++++++++++++++++++++      +
help: consider annotating `F` with `#[derive(Clone)]`
   |
LL + #[derive(Clone)]
LL | struct F;
   |

error[E0507]: cannot move out of dereference of `Pin<Box<F>>`
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:206:22
   |
LL |     reuse Trait::* { self.0 }
   |                  -   ^^^^^^ move occurs because value has type `F`, which does not implement the `Copy` trait
   |                  |
   |                  value moved due to this method call
   |
note: `Trait::by_value` takes ownership of the receiver `self`, which moves value
  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:11:17
---
   |
LL | struct F;
   | ^^^^^^^^ consider implementing `Clone` for this type
...
LL |     reuse Trait::* { self.0 }
   |                      ------ you could clone this value

error[E0596]: cannot borrow data in dereference of `Pin<Box<F>>` as mutable
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:206:22
   |
LL |     reuse Trait::* { self.0 }
   |                      ^^^^^^ cannot borrow as mutable
   |
   = help: trait `DerefMut` is required to modify through a dereference, but it is not implemented for `Pin<Box<F>>`

error[E0507]: cannot move out of dereference of `Pin<Box<X8>>`
##[error]  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:206:22
   |
LL |     reuse Trait::* { self.0 }
   |                  -   ^^^^^^ move occurs because value has type `Pin<Box<F>>`, which does not implement the `Copy` trait
   |                  |
   |                  value moved due to this method call
   |
note: `Trait::pin_box` takes ownership of the receiver `self`, which moves value
  --> /checkout/tests/ui/delegation/self-coercion-errors.rs:17:16
   |
LL |     fn pin_box(self: Pin<Box<Self>>) -> i32 { 7 }
   |                ^^^^
help: you could `clone` the value and consume it, if the `F: Clone` trait bound could be satisfied
   |
LL |     reuse Trait::* { <Pin<Box<F>> as Clone>::clone(&self.0) }
   |                      +++++++++++++++++++++++++++++++      +
help: consider annotating `F` with `#[derive(Clone)]`
   |
LL + #[derive(Clone)]
LL | struct F;
---
---- [ui] tests/ui/moves/needs-clone-through-deref.rs stdout ----
Saved the actual stderr to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/moves/needs-clone-through-deref/needs-clone-through-deref.stderr`
diff of stderr:

13 LL -         for _ in self.clone().into_iter() {}
14 LL +         for _ in <Vec<usize> as Clone>::clone(&self).into_iter() {}
15    |
+ help: you can `clone` the value and consume it, but this might not be your desired behavior
+    |
+ LL |         for _ in <Vec<usize> as Clone>::clone(&self.clone()).into_iter() {}
+    |                  ++++++++++++++++++++++++++++++            +
16 
17 error: aborting due to 1 previous error
18 

Note: some mismatched output was normalized before being compared
- LL |         for _ in <Vec<usize> as Clone>::clone(&self.clone()).into_iter() {} //~ ERROR cannot move out of dereference of `S`
+ help: you can `clone` the value and consume it, but this might not be your desired behavior
+    |
+ LL |         for _ in <Vec<usize> as Clone>::clone(&self.clone()).into_iter() {}
+    |                  ++++++++++++++++++++++++++++++            +


The actual stderr differed from the expected stderr

---
Saved the actual stderr to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/moves/suggest-clone-when-some-obligation-is-unmet/suggest-clone-when-some-obligation-is-unmet.stderr`
diff of stderr:

8    |
9 note: `std::collections::HashMap::<K, V, S, A>::into_values` takes ownership of the receiver `self`, which moves value
10   --> $SRC_DIR/std/src/collections/hash/map.rs:LL:COL
- note: if `Hash128_1` implemented `Clone`, you could clone the value
-   --> $DIR/suggest-clone-when-some-obligation-is-unmet.rs:8:1
-    |
- LL | pub struct Hash128_1;
-    | ^^^^^^^^^^^^^^^^^^^^ consider implementing `Clone` for this type
- ...
- LL |     let mut copy: Vec<U> = map.clone().into_values().collect();
-    |                            ----------- you could clone this value
19 help: you could `clone` the value and consume it, if the `Hash128_1: Clone` trait bound could be satisfied
20    |
21 LL -     let mut copy: Vec<U> = map.clone().into_values().collect();


The actual stderr differed from the expected stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args moves/suggest-clone-when-some-obligation-is-unmet.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/moves/suggest-clone-when-some-obligation-is-unmet.rs" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/moves/suggest-clone-when-some-obligation-is-unmet" "-Znext-solver=coherence" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "--edition=2015"
stdout: none
--- stderr -------------------------------
error[E0507]: cannot move out of a shared reference
##[error]  --> /checkout/tests/ui/moves/suggest-clone-when-some-obligation-is-unmet.rs:20:28
   |
LL |     let mut copy: Vec<U> = map.clone().into_values().collect(); //~ ERROR
   |                            ^^^^^^^^^^^ ------------- value moved due to this method call
   |                            |
   |                            move occurs because value has type `HashMap<T, U, Hash128_1>`, which does not implement the `Copy` trait
   |
note: `std::collections::HashMap::<K, V, S, A>::into_values` takes ownership of the receiver `self`, which moves value
  --> /rustc/FAKE_PREFIX/library/std/src/collections/hash/map.rs:642:23
help: you could `clone` the value and consume it, if the `Hash128_1: Clone` trait bound could be satisfied
   |
LL -     let mut copy: Vec<U> = map.clone().into_values().collect(); //~ ERROR
LL +     let mut copy: Vec<U> = <HashMap<T, U, Hash128_1> as Clone>::clone(&map).into_values().collect(); //~ ERROR
   |
help: consider annotating `Hash128_1` with `#[derive(Clone)]`
   |
LL + #[derive(Clone)]
LL | pub struct Hash128_1;
---
------------------------------------------

---- [ui] tests/ui/moves/suggest-clone-when-some-obligation-is-unmet.rs stdout end ----
---- [ui] tests/ui/nll/polonius/nll-problem-case-3-issue-123839.rs#nll stdout ----
Saved the actual stderr to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/nll/polonius/nll-problem-case-3-issue-123839.nll/nll-problem-case-3-issue-123839.nll.stderr`
diff of stderr:

10    |         returning this value requires that `*self` is borrowed for `'1`
11 LL |         self.status = 1; // and this line is the victim
12    |         ^^^^^^^^^^^^^^^ `self.status` is assigned to here but it was already borrowed
+    |
+ note: requirement that the value outlives `'1` introduced here
+   --> $SRC_DIR/core/src/ops/try_trait.rs:LL:COL
13 
14 error: aborting due to 1 previous error
---
The actual stderr differed from the expected stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args nll/polonius/nll-problem-case-3-issue-123839.rs`

error in revision `nll`: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/nll/polonius/nll-problem-case-3-issue-123839.rs" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--cfg" "nll" "--check-cfg" "cfg(test,FALSE,nll,polonius,legacy)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/nll/polonius/nll-problem-case-3-issue-123839.nll" "-Znext-solver=coherence" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "--edition=2015" "-Z" "polonius=off"
stdout: none
--- stderr -------------------------------
error[E0506]: cannot assign to `self.status` because it is borrowed
##[error]  --> /checkout/tests/ui/nll/polonius/nll-problem-case-3-issue-123839.rs:38:9
   |
LL |     fn foo(self: &mut Self) -> Result<(), &str> {
   |                  - let's call the lifetime of this reference `'1`
LL |         self.bar()?; // rust reports this line conflicts with the next line
   |         -----------
   |         |
   |         `self.status` is borrowed here
   |         returning this value requires that `*self` is borrowed for `'1`
LL |         self.status = 1; // and this line is the victim
   |         ^^^^^^^^^^^^^^^ `self.status` is assigned to here but it was already borrowed
   |
note: requirement that the value outlives `'1` introduced here
  --> /rustc/FAKE_PREFIX/library/core/src/ops/try_trait.rs:397:11

error: aborting due to 1 previous error
---
To only update this specific test, also pass `--test-args traits/const-traits/ice-119717-constant-lifetime.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/traits/const-traits/ice-119717-constant-lifetime.rs" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/traits/const-traits/ice-119717-constant-lifetime" "-Znext-solver=coherence" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "--edition=2015"
stdout: none
--- stderr -------------------------------
error[E0210]: type parameter `T` must be used as an argument to some local type (e.g., `MyStruct<T>`)
##[error]  --> /checkout/tests/ui/traits/const-traits/ice-119717-constant-lifetime.rs:6:12
   |
---

+ error[E0405]: cannot find trait `TryAs` in this scope
+   --> $DIR/ice-126148-failed-to-normalize.rs:17:12
+    |
+ LL | const impl TryAs<()> for Error {
+    |            ^^^^^ not found in this scope
+    |
+ help: consider importing this trait
+    |
+ LL + use std::ops::TryAs;
+    |
+ 
1 error[E0046]: not all trait items implemented, missing: `from_break`
2   --> $DIR/ice-126148-failed-to-normalize.rs:8:1
3    |

6    |
7    = help: implement the missing item: `fn from_break(_: Error) -> Self { todo!() }`
8 
- error[E0046]: not all trait items implemented, missing: `from_output`, `branch`
+ error[E0046]: not all trait items implemented, missing: `Kind`, `from_output`, `branch`
10   --> $DIR/ice-126148-failed-to-normalize.rs:11:1
11    |
12 LL | const impl Try for TryMe {

-    | ^^^^^^^^^^^^^^^^^^^^^^^^ missing `from_output`, `branch` in implementation
+    | ^^^^^^^^^^^^^^^^^^^^^^^^ missing `Kind`, `from_output`, `branch` in implementation
14    |
+    = help: implement the missing item: `type Kind = /* Type */;`
15    = help: implement the missing item: `fn from_output(_: <Self as Try>::Output) -> Self { todo!() }`
16    = help: implement the missing item: `fn branch(self) -> ControlFlow<<Self as Try>::Break, <Self as Try>::Output> { todo!() }`
17 

- error: aborting due to 2 previous errors
+ error: aborting due to 3 previous errors
19 
---
-   --> /checkout/tests/ui/traits/const-traits/ice-126148-failed-to-normalize.rs:17:12
+ error[E0405]: cannot find trait `TryAs` in this scope
+   --> $DIR/ice-126148-failed-to-normalize.rs:17:12
+    |
+ LL | const impl TryAs<()> for Error {
+    |            ^^^^^ not found in this scope
+    |
+ help: consider importing this trait
+    |
+ LL + use std::ops::TryAs;
+    |
+ 
+ error[E0046]: not all trait items implemented, missing: `Kind`, `from_output`, `branch`
+    | ^^^^^^^^^^^^^^^^^^^^^^^^ missing `Kind`, `from_output`, `branch` in implementation
+    = help: implement the missing item: `type Kind = /* Type */;`
+ error: aborting due to 3 previous errors
+ Some errors have detailed explanations: E0046, E0405.
+ For more information about an error, try `rustc --explain E0046`.


The actual stderr differed from the expected stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args traits/const-traits/ice-126148-failed-to-normalize.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/traits/const-traits/ice-126148-failed-to-normalize.rs" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/traits/const-traits/ice-126148-failed-to-normalize" "-Znext-solver=coherence" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "--edition=2015"
stdout: none
--- stderr -------------------------------
error[E0405]: cannot find trait `TryAs` in this scope
##[error]  --> /checkout/tests/ui/traits/const-traits/ice-126148-failed-to-normalize.rs:17:12
   |
---

error[E0046]: not all trait items implemented, missing: `from_break`
##[error]  --> /checkout/tests/ui/traits/const-traits/ice-126148-failed-to-normalize.rs:8:1
   |
LL | const impl TryFromBreak<Error> for TryMe {}
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `from_break` in implementation
   |
   = help: implement the missing item: `fn from_break(_: Error) -> Self { todo!() }`

error[E0046]: not all trait items implemented, missing: `Kind`, `from_output`, `branch`
##[error]  --> /checkout/tests/ui/traits/const-traits/ice-126148-failed-to-normalize.rs:11:1
   |
LL | const impl Try for TryMe {
   | ^^^^^^^^^^^^^^^^^^^^^^^^ missing `Kind`, `from_output`, `branch` in implementation
   |
   = help: implement the missing item: `type Kind = /* Type */;`
   = help: implement the missing item: `fn from_output(_: <Self as Try>::Output) -> Self { todo!() }`
   = help: implement the missing item: `fn branch(self) -> ControlFlow<<Self as Try>::Break, <Self as Try>::Output> { todo!() }`

error: aborting due to 3 previous errors

Some errors have detailed explanations: E0046, E0405.
For more information about an error, try `rustc --explain E0046`.
------------------------------------------

---- [ui] tests/ui/traits/const-traits/ice-126148-failed-to-normalize.rs stdout end ----
---- [ui] tests/ui/traits/const-traits/minicore-deref-fail.rs stdout ----

error: auxiliary build of /checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs failed to compile: 
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/traits/const-traits/minicore-deref-fail/auxiliary" "-Znext-solver=coherence" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "--edition=2015" "-Znext-solver" "-Cpanic=abort" "-L" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/traits/const-traits/minicore-deref-fail/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0522]: definition of an unknown lang item: `branch`
##[error]  --> /checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs:67:5
   |
---

warning: unused variable: `x`
##[warning]  --> /checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs:52:9
   |
LL |     let x = 42_i32 + 43_i32;
   |         ^ help: if this is intentional, prefix it with an underscore: `_x`

warning: unused variable: `x`
##[warning]  --> /checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs:56:9
   |
LL |     let x = 42_i32 + 43_i32;
   |         ^ help: if this is intentional, prefix it with an underscore: `_x`

warning: unused variable: `bytes`
##[warning]  --> /checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs:149:28
   |
LL |     const fn from_ne_bytes(bytes: [u8; size_of::<Self>()]) -> Self {
   |                            ^^^^^ help: if this is intentional, prefix it with an underscore: `_bytes`

warning: unused variable: `other`
##[warning]  --> /checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs:319:18
   |
LL |     fn eq(&self, other: &str) -> bool {
   |                  ^^^^^ help: if this is intentional, prefix it with an underscore: `_other`

warning: unused variable: `value`
##[warning]  --> /checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs:417:18
   |
LL |     const fn new(value: T) -> RefCell<T> {
---
---- [ui] tests/ui/traits/const-traits/minicore-drop-fail.rs stdout ----

error: auxiliary build of /checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs failed to compile: 
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/traits/const-traits/minicore-drop-fail/auxiliary" "-Znext-solver=coherence" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "--edition=2015" "-Znext-solver" "-Cpanic=abort" "-L" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/traits/const-traits/minicore-drop-fail/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0522]: definition of an unknown lang item: `branch`
##[error]  --> /checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs:67:5
   |
---

warning: unused variable: `x`
##[warning]  --> /checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs:52:9
   |
LL |     let x = 42_i32 + 43_i32;
   |         ^ help: if this is intentional, prefix it with an underscore: `_x`

warning: unused variable: `x`
##[warning]  --> /checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs:56:9
   |
LL |     let x = 42_i32 + 43_i32;
   |         ^ help: if this is intentional, prefix it with an underscore: `_x`

warning: unused variable: `bytes`
##[warning]  --> /checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs:149:28
   |
LL |     const fn from_ne_bytes(bytes: [u8; size_of::<Self>()]) -> Self {
   |                            ^^^^^ help: if this is intentional, prefix it with an underscore: `_bytes`

warning: unused variable: `other`
##[warning]  --> /checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs:319:18
   |
LL |     fn eq(&self, other: &str) -> bool {
   |                  ^^^^^ help: if this is intentional, prefix it with an underscore: `_other`

warning: unused variable: `value`
##[warning]  --> /checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs:417:18
   |
LL |     const fn new(value: T) -> RefCell<T> {
---
---- [ui] tests/ui/traits/const-traits/minicore-const-fn-early-bound.rs stdout ----

error: auxiliary build of /checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs failed to compile: 
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/traits/const-traits/minicore-const-fn-early-bound/auxiliary" "-Znext-solver=coherence" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "--edition=2015" "-Znext-solver" "-Cpanic=abort" "-L" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/traits/const-traits/minicore-const-fn-early-bound/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0522]: definition of an unknown lang item: `branch`
##[error]  --> /checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs:67:5
   |
---

warning: unused variable: `x`
##[warning]  --> /checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs:52:9
   |
LL |     let x = 42_i32 + 43_i32;
   |         ^ help: if this is intentional, prefix it with an underscore: `_x`

warning: unused variable: `x`
##[warning]  --> /checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs:56:9
   |
LL |     let x = 42_i32 + 43_i32;
   |         ^ help: if this is intentional, prefix it with an underscore: `_x`

warning: unused variable: `bytes`
##[warning]  --> /checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs:149:28
   |
LL |     const fn from_ne_bytes(bytes: [u8; size_of::<Self>()]) -> Self {
   |                            ^^^^^ help: if this is intentional, prefix it with an underscore: `_bytes`

warning: unused variable: `other`
##[warning]  --> /checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs:319:18
   |
LL |     fn eq(&self, other: &str) -> bool {
   |                  ^^^^^ help: if this is intentional, prefix it with an underscore: `_other`

warning: unused variable: `value`
##[warning]  --> /checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs:417:18
   |
LL |     const fn new(value: T) -> RefCell<T> {
---
---- [ui] tests/ui/traits/const-traits/minicore-drop-without-feature-gate.rs#no stdout ----

error in revision `no`: auxiliary build of /checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs failed to compile: 
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--cfg" "no" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/traits/const-traits/minicore-drop-without-feature-gate.no/auxiliary" "-Znext-solver=coherence" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "--edition=2015" "-Znext-solver" "-Cpanic=abort" "-L" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/traits/const-traits/minicore-drop-without-feature-gate.no/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0522]: definition of an unknown lang item: `branch`
##[error]  --> /checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs:67:5
   |
---

warning: unused variable: `x`
##[warning]  --> /checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs:52:9
   |
LL |     let x = 42_i32 + 43_i32;
   |         ^ help: if this is intentional, prefix it with an underscore: `_x`

warning: unused variable: `x`
##[warning]  --> /checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs:56:9
   |
LL |     let x = 42_i32 + 43_i32;
   |         ^ help: if this is intentional, prefix it with an underscore: `_x`

warning: unused variable: `bytes`
##[warning]  --> /checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs:149:28
   |
LL |     const fn from_ne_bytes(bytes: [u8; size_of::<Self>()]) -> Self {
   |                            ^^^^^ help: if this is intentional, prefix it with an underscore: `_bytes`

warning: unused variable: `other`
##[warning]  --> /checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs:319:18
   |
LL |     fn eq(&self, other: &str) -> bool {
   |                  ^^^^^ help: if this is intentional, prefix it with an underscore: `_other`

warning: unused variable: `value`
##[warning]  --> /checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs:417:18
   |
LL |     const fn new(value: T) -> RefCell<T> {
---

---- [ui] tests/ui/traits/const-traits/minicore-drop-without-feature-gate.rs#no stdout end ----
---- [ui] tests/ui/traits/const-traits/minicore-drop-without-feature-gate.rs#yes stdout ----

error in revision `yes`: auxiliary build of /checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs failed to compile: 
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--cfg" "yes" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/traits/const-traits/minicore-drop-without-feature-gate.yes/auxiliary" "-Znext-solver=coherence" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "--edition=2015" "-Znext-solver" "-Cpanic=abort" "-L" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/traits/const-traits/minicore-drop-without-feature-gate.yes/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0522]: definition of an unknown lang item: `branch`
##[error]  --> /checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs:67:5
   |
---

warning: unused variable: `x`
##[warning]  --> /checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs:52:9
   |
LL |     let x = 42_i32 + 43_i32;
   |         ^ help: if this is intentional, prefix it with an underscore: `_x`

warning: unused variable: `x`
##[warning]  --> /checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs:56:9
   |
LL |     let x = 42_i32 + 43_i32;
   |         ^ help: if this is intentional, prefix it with an underscore: `_x`

warning: unused variable: `bytes`
##[warning]  --> /checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs:149:28
   |
LL |     const fn from_ne_bytes(bytes: [u8; size_of::<Self>()]) -> Self {
   |                            ^^^^^ help: if this is intentional, prefix it with an underscore: `_bytes`

warning: unused variable: `other`
##[warning]  --> /checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs:319:18
   |
LL |     fn eq(&self, other: &str) -> bool {
   |                  ^^^^^ help: if this is intentional, prefix it with an underscore: `_other`

warning: unused variable: `value`
##[warning]  --> /checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs:417:18
   |
LL |     const fn new(value: T) -> RefCell<T> {
---
---- [ui] tests/ui/traits/const-traits/minicore-fn-fail.rs stdout ----

error: auxiliary build of /checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs failed to compile: 
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/traits/const-traits/minicore-fn-fail/auxiliary" "-Znext-solver=coherence" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "--edition=2015" "-Znext-solver" "-Cpanic=abort" "-L" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/traits/const-traits/minicore-fn-fail/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0522]: definition of an unknown lang item: `branch`
##[error]  --> /checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs:67:5
   |
---

warning: unused variable: `x`
##[warning]  --> /checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs:52:9
   |
LL |     let x = 42_i32 + 43_i32;
   |         ^ help: if this is intentional, prefix it with an underscore: `_x`

warning: unused variable: `x`
##[warning]  --> /checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs:56:9
   |
LL |     let x = 42_i32 + 43_i32;
   |         ^ help: if this is intentional, prefix it with an underscore: `_x`

warning: unused variable: `bytes`
##[warning]  --> /checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs:149:28
   |
LL |     const fn from_ne_bytes(bytes: [u8; size_of::<Self>()]) -> Self {
   |                            ^^^^^ help: if this is intentional, prefix it with an underscore: `_bytes`

warning: unused variable: `other`
##[warning]  --> /checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs:319:18
   |
LL |     fn eq(&self, other: &str) -> bool {
   |                  ^^^^^ help: if this is intentional, prefix it with an underscore: `_other`

warning: unused variable: `value`
##[warning]  --> /checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs:417:18
   |
LL |     const fn new(value: T) -> RefCell<T> {
---
---- [ui] tests/ui/traits/const-traits/minicore-works.rs stdout ----

error: auxiliary build of /checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs failed to compile: 
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/traits/const-traits/minicore-works/auxiliary" "-Znext-solver=coherence" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "--edition=2015" "-Znext-solver" "-Cpanic=abort" "-L" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/traits/const-traits/minicore-works/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0522]: definition of an unknown lang item: `branch`
##[error]  --> /checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs:67:5
   |
---

warning: unused variable: `x`
##[warning]  --> /checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs:52:9
   |
LL |     let x = 42_i32 + 43_i32;
   |         ^ help: if this is intentional, prefix it with an underscore: `_x`

warning: unused variable: `x`
##[warning]  --> /checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs:56:9
   |
LL |     let x = 42_i32 + 43_i32;
   |         ^ help: if this is intentional, prefix it with an underscore: `_x`

warning: unused variable: `bytes`
##[warning]  --> /checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs:149:28
   |
LL |     const fn from_ne_bytes(bytes: [u8; size_of::<Self>()]) -> Self {
   |                            ^^^^^ help: if this is intentional, prefix it with an underscore: `_bytes`

warning: unused variable: `other`
##[warning]  --> /checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs:319:18
   |
LL |     fn eq(&self, other: &str) -> bool {
   |                  ^^^^^ help: if this is intentional, prefix it with an underscore: `_other`

warning: unused variable: `value`
##[warning]  --> /checkout/tests/ui/traits/const-traits/auxiliary/minicore.rs:417:18
   |
LL |     const fn new(value: T) -> RefCell<T> {
---
---- [ui] tests/ui/traits/const-traits/trait-default-body-stability.rs stdout ----

error: test compilation failed although it shouldn't!
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/traits/const-traits/trait-default-body-stability.rs" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/traits/const-traits/trait-default-body-stability" "-Znext-solver=coherence" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "--edition=2015" "-Znext-solver"
stdout: none
--- stderr -------------------------------
error[E0437]: type `TryType` is not a member of trait `TryAs`
##[error]  --> /checkout/tests/ui/traits/const-traits/trait-default-body-stability.rs:34:5
   |
---
   |
LL | const impl Try for T {
   | ^^^^^^^^^^^^^^^^^^^^ missing `Kind` in implementation
   |
   = help: implement the missing item: `type Kind = /* Type */;`

error[E0046]: not all trait items implemented, missing: `Try`
##[error]  --> /checkout/tests/ui/traits/const-traits/trait-default-body-stability.rs:33:1
   |
LL | const impl TryAs<T> for T {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^ missing `Try` in implementation
   |
   = help: implement the missing item: `type Try = /* Type */;`

error: aborting due to 3 previous errors

Some errors have detailed explanations: E0046, E0437.
For more information about an error, try `rustc --explain E0046`.
------------------------------------------

---- [ui] tests/ui/traits/const-traits/trait-default-body-stability.rs stdout end ----
---- [ui] tests/ui/traits/object/canonicalize-fresh-infer-vars-issue-103626.rs stdout ----
Saved the actual stderr to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/traits/object/canonicalize-fresh-infer-vars-issue-103626/canonicalize-fresh-infer-vars-issue-103626.stderr`
diff of stderr:

11 LL | trait TryFromBreak<R = <Self as Try>::Break> {
12    |       ------------ this trait is not dyn compatible...
13 LL |     fn from_break(residual: R) -> Self;
-    |        ^^^^^^^^^^^^^ ...because associated function `from_break` has no `self` parameter
+    |        ^^^^^^^^^^ ...because associated function `from_break` has no `self` parameter
15 help: consider turning `from_break` into a method by giving it a `&self` argument, so that it is accessible through the trait object's vtable
16    |
17 LL |     fn from_break(&self, residual: R) -> Self;

-    |                      ++++++
+    |                   ++++++
19 help: alternatively, consider constraining `from_break` so it is explicitly marked as not applying to trait objects
20    |
21 LL |     fn from_break(residual: R) -> Self where Self: Sized;

-    |                                           +++++++++++++++++
+    |                                        +++++++++++++++++
23 
24 error: aborting due to 1 previous error
---
To only update this specific test, also pass `--test-args traits/object/canonicalize-fresh-infer-vars-issue-103626.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/traits/object/canonicalize-fresh-infer-vars-issue-103626.rs" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/traits/object/canonicalize-fresh-infer-vars-issue-103626" "-Znext-solver=coherence" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "--edition=2015"
stdout: none
--- stderr -------------------------------
error[E0038]: the trait `TryFromBreak` is not dyn compatible
##[error]  --> /checkout/tests/ui/traits/object/canonicalize-fresh-infer-vars-issue-103626.rs:10:17
   |
LL |     let b: &dyn TryFromBreak = &();
   |                 ^^^^^^^^^^^^ `TryFromBreak` is not dyn compatible
   |
note: for a trait to be dyn compatible it needs to allow building a vtable
      for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
  --> /checkout/tests/ui/traits/object/canonicalize-fresh-infer-vars-issue-103626.rs:2:8
   |
LL | trait TryFromBreak<R = <Self as Try>::Break> {
   |       ------------ this trait is not dyn compatible...
LL |     fn from_break(residual: R) -> Self;
   |        ^^^^^^^^^^ ...because associated function `from_break` has no `self` parameter
help: consider turning `from_break` into a method by giving it a `&self` argument, so that it is accessible through the trait object's vtable
   |
LL |     fn from_break(&self, residual: R) -> Self;
   |                   ++++++
help: alternatively, consider constraining `from_break` so it is explicitly marked as not applying to trait objects
   |
LL |     fn from_break(residual: R) -> Self where Self: Sized;
   |                                        +++++++++++++++++

error: aborting due to 1 previous error

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

---- [ui] tests/ui/traits/object/canonicalize-fresh-infer-vars-issue-103626.rs stdout end ----
---- [ui] tests/ui/unpretty/exhaustive.rs#hir stdout ----
Saved the actual stdout to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/unpretty/exhaustive.hir/exhaustive.hir.stdout`
diff of stdout:

242         { return; from_output(()) }
243         type_ascribe!({ from_output(()) }, Option<_>);
244         type_ascribe!({
-                 from_output(match branch(None) {
+                 from_output(match try_operator_branch(None) {
246                         Break {  0: residual } => #[allow(unreachable_code)]
-                             break from_break(residual),
+                             break into_try_heterogeneous(residual),
248                         Continue {  0: val } => #[allow(unreachable_code)]
249                             val,
250                     })

366     /// ExprKind::Try
367     fn expr_try() {
368         let expr;
-         match branch(expr) {
+         match try_operator_branch(expr) {
370             Break {  0: residual } => #[allow(unreachable_code)]
-                 return from_break(residual),
+                 return into_try_heterogeneous(residual),
372             Continue {  0: val } => #[allow(unreachable_code)]
373                 val,
374         };


The actual stdout differed from the expected stdout
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args unpretty/exhaustive.rs`

error in revision `hir`: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/unpretty/exhaustive.rs" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--cfg" "hir" "--check-cfg" "cfg(test,FALSE,expanded,hir)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/unpretty/exhaustive.hir" "-Znext-solver=coherence" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "--edition=2024" "-Zunpretty=hir"
--- stdout -------------------------------
//@ revisions: expanded hir
//@[expanded]compile-flags: -Zunpretty=expanded
//@[expanded]check-pass
//@[hir]compile-flags: -Zunpretty=hir
//@[hir]check-fail
//@ edition:2024

// Note: the HIR revision includes a `.stderr` file because there are some
// errors that only occur once we get past the AST.

#![allow(incomplete_features)]
#![attr = Feature([auto_traits#0, builtin_syntax#0, const_trait_impl#0,
coroutines#0, decl_macro#0, deref_patterns#0, explicit_tail_calls#0,
gen_blocks#0, more_qualified_paths#0, never_patterns#0, pattern_types#0,
pattern_type_macro#0, prelude_import#0, specialization#0, trace_macros#0,
trait_alias#0, try_blocks#0, try_blocks_heterogeneous#0, yeet_expr#0])]
extern crate std;
#[attr = PreludeImport]
use std::prelude::rust_2024::*;

mod prelude {
    use std::prelude::rust_2024::*;

---

    /// outer single-line doc comment
    /**
     * outer multi-line doc comment
     */
    #[doc = "outer doc attribute"]
    #[doc = "macro"]
    #[allow()]
    #[attr = Repr {reprs: [ReprC]}]
    struct Struct;
}

mod expressions {
    /// ExprKind::Array
    fn expr_array() {
        [];
        [true];
        [true];
        [true, true];
        ["long........................................................................"];
        ["long............................................................",
                true];
    }

    /// ExprKind::ConstBlock
    fn expr_const_block() {
---
                };
    }

    /// ExprKind::Call
    fn expr_call() {
        let f;
        f();
        f::<u8>();
        f::<1>();
        f::<'static, u8, 1>();
        f(true);
        f(true);
        ()();
    }

    /// ExprKind::MethodCall
    fn expr_method_call() {
        let x;
        x.f();
        x.f::<u8>();
        x.collect::<Vec<_>>();
    }

    /// ExprKind::Tup
    fn expr_tup() { (); (true,); (true, false); (true, false); }

    /// ExprKind::Binary
    fn expr_binary() {
        let (a, b, c, d, x, y);
        true || false;
        true || false && false;
        a < 1 && 2 < b && c > 3 && 4 > d;
        a & b & !c;
        a + b * c - d + -1 * -2 - -3;
        x = !y;
    }

    /// ExprKind::Unary
    fn expr_unary() { let expr; *expr; !expr; -expr; }

    /// ExprKind::Lit
    fn expr_lit() { 'x'; 1000i8; 1.00000000000000000000001; }

    /// ExprKind::Cast
    fn expr_cast() { let expr; expr as T; expr as T<u8>; }

    /// ExprKind::Type
    fn expr_type() { let expr; type_ascribe!(expr, T); }

    /// ExprKind::Let
    fn expr_let() {
        let b;
        if let Some(a) = b { }
        if let _ = true && false { }
        if let _ = (true && false) { }
    }

    /// ExprKind::If
    fn expr_if() {
        if true { }
        if !true { }
        if let true = true { } else { }
        if true { } else if false { }
        if true { } else if false { } else { }
        if true { return; } else if false { 0 } else { 0 }
    }

    /// ExprKind::While
    fn expr_while() {
        loop { if false { } else { break; } }
        'a: loop { if false { } else { break; } }
        loop { if let true = true { } else { break; } }
    }

    /// ExprKind::ForLoop
    fn expr_for_loop() {
        let x;
        {
            let _t =
                match into_iter(x) {
                    mut iter =>
                        loop {
                            match next(&mut iter) {
                                None {} => break,
                                Some {  0: _ } => { }
                            }
                        },
                };
            _t
        };
        {
            let _t =
                match into_iter(x) {
                    mut iter =>
                        'a: loop {
                            match next(&mut iter) {
                                None {} => break,
                                Some {  0: _ } => { }
                            }
                        },
                };
            _t
        }
    }

    /// ExprKind::Loop
    fn expr_loop() { loop { } 'a: loop { } }

    /// ExprKind::Match
    fn expr_match() {
        let value;
        match value { }
        match value { ok => 1, }
        match value { ok => 1, err => 0, }
    }

    /// ExprKind::Closure
    fn expr_closure() {
        let value;
        || { };
        |x| { };
        |x: u8| { };
        || ();
        move || value;
        || |mut _task_context: ResumeTy| { { let _t = value; _t } };
        move || |mut _task_context: ResumeTy| { { let _t = value; _t } };
        || value; //[hir]~ ERROR closures cannot be static
        move || value; //[hir]~ ERROR closures cannot be static
        || |mut _task_context: ResumeTy| { { let _t = value; _t } };
        move || |mut _task_context: ResumeTy| { { let _t = value; _t } };
        || -> u8 { value };
        1 + (|| { });
    }

    /// ExprKind::Block
    fn expr_block() {
        { }
---
        { }
    }

    /// ExprKind::Gen
    fn expr_gen() {
        |mut _task_context: ResumeTy| { };
        move |mut _task_context: ResumeTy| { };
        || { };
        move || { };
        |mut _task_context: ResumeTy| { };
        move |mut _task_context: ResumeTy| { };
    }

    /// ExprKind::Await
    fn expr_await() {
        let fut;
        {
            fut; //[hir]~ ERROR `await` is only allowed
            (/*ERROR*/)
        };
    }

    /// ExprKind::TryBlock
    fn expr_try_block() {
        { from_output(()) }
        { return; from_output(()) }
        type_ascribe!({ from_output(()) }, Option<_>);
        type_ascribe!({
                from_output(match try_operator_branch(None) {
                        Break {  0: residual } => #[allow(unreachable_code)]
                            break into_try_heterogeneous(residual),
                        Continue {  0: val } => #[allow(unreachable_code)]
                            val,
                    })
            }, Option<String>)
    }

    /// ExprKind::Assign
    fn expr_assign() { let expr; expr = true; }

    /// ExprKind::AssignOp
    fn expr_assign_op() { let expr; expr += true; }

    /// ExprKind::Field
    fn expr_field() { let expr; expr.field; expr.0; }

    /// ExprKind::Index
    fn expr_index() { let expr; expr[true]; }

    /// ExprKind::Range
    fn expr_range() {
        let (lo, hi);
        RangeFull {  };
        RangeTo { end: hi };
        RangeFrom { start: lo };
        Range { start: lo, end: hi };
        Range { start: lo, end: hi };
        RangeToInclusive { end: hi };
        range_inclusive_new(lo, hi);
        range_inclusive_new(-2, -1);
    }

    /// ExprKind::Underscore
    fn expr_underscore() {
        (/*ERROR*/); //[hir]~ ERROR in expressions, `_` can only
    }

    /// ExprKind::Path
    fn expr_path() {
        let x;
        crate::expressions::expr_path;
        crate::expressions::expr_path::<'static>;
        <T as Default>::default;
        <T as ::core::default::Default>::default;
        x; //[hir]~ ERROR parenthesized type parameters
        x::<T, T>; //[hir]~ ERROR parenthesized type parameters
        crate::expressions::expr_path;
        //[hir]~^ ERROR parenthesized type parameters
        //[hir]~| ERROR parenthesized type parameters
        core::marker::PhantomData;
        //[hir]~^ ERROR parenthesized type parameters
        //[hir]~| ERROR parenthesized type parameters
    }

    /// ExprKind::AddrOf
    fn expr_addr_of() {
        let expr;
        &expr;
        &mut expr;
        &raw const expr;
        &raw mut expr;
    }

    /// ExprKind::Break
    fn expr_break() { 'a: { break; break 'a; break true; break 'a true; } }

    /// ExprKind::Continue
    fn expr_continue() { 'a: { continue; continue 'a; } }

    /// ExprKind::Ret
    fn expr_ret() { return; return true; }


---




        //[hir]~ ERROR `yield` can only be used





---


        // ...

        //[hir]~ ERROR invalid ABI





---




        //[hir]~ ERROR `..` patterns are not allowed here





---




        //[hir]~ ERROR parenthesized type parameters


        //[hir]~ ERROR `impl Trait` is not allowed
        //[hir]~ ERROR `impl Trait` is not allowed
        //[hir]~ ERROR `impl Trait` is not allowed
        //[hir]~ ERROR `impl Trait` is not allowed
        //[hir]~ ERROR `impl Trait` is not allowed
        //[hir]~ ERROR `impl Trait` is not allowed









        const { offset_of!(T, field) };
    }
    /// ExprKind::MacCall
    fn expr_mac_call() { "..."; "..."; "..."; }
    /// ExprKind::Struct
    fn expr_struct() {
        struct Struct {
        }
        let (x, base);
        Struct {  };
        <Struct as ToOwned>::Owned {  };
        Struct { .. };
        Struct { ..base };
        Struct { x };
        Struct { x, ..base };
        Struct { x: true };
        Struct { x: true, .. };
        Struct { x: true, ..base };
        Struct { 0: true, ..base };
    }
    /// ExprKind::Repeat
    fn expr_repeat() { [(); 0]; }
    /// ExprKind::Paren
    fn expr_paren() { let expr; expr; }
    /// ExprKind::Try
    fn expr_try() {
        let expr;
        match try_operator_branch(expr) {
            Break {  0: residual } => #[allow(unreachable_code)]
                return into_try_heterogeneous(residual),
            Continue {  0: val } => #[allow(unreachable_code)]
                val,
        };
    }
    /// ExprKind::Yield
    fn expr_yield() { yield (); yield true; }
    /// ExprKind::Yeet
    fn expr_yeet() { return from_yeet(()); return from_yeet(0); }
    /// ExprKind::Become
    fn expr_become() { become true; }
    /// ExprKind::IncludedBytes
    fn expr_include_bytes() {
        b"data for include_bytes in ../expanded-exhaustive.rs\n";
    }
    /// ExprKind::FormatArgs
    fn expr_format_args() {
        let expr;
        format_arguments::from_str("");
        {
            super let args = (&expr,);
            super let args = [format_argument::new_display(args.0)];
            unsafe { format_arguments::new(b"\xc0\x00", &args) }
        };
    }
}
mod items {
    /// ItemKind::ExternCrate
    mod item_extern_crate {
        extern crate core;
        extern crate self as unpretty;
        extern crate core as _;
    }
    /// ItemKind::Use
    mod item_use {
        use crate::{expressions,items::item_use,};
        use core::*;
    }
    /// ItemKind::Static
    mod item_static {
        static A: () = { };
        static mut B: () = { };
    }
    /// ItemKind::Const
    mod item_const {
        const A: () = { };
        trait TraitItems {
            const
            B:
            ();
            const
            C:
---
    mod item_fn {
        const unsafe extern "C" fn f() { }
        async unsafe extern "C" fn g()
            ->
                /*impl Trait*/ |mut _task_context: ResumeTy|
            { { let _t = { }; _t } }
        fn h<'a, T>() where T: 'a { }
        trait TraitItems {
            unsafe extern "C" fn f();
        }
        impl TraitItems for _ {
            unsafe extern "C" fn f() { }
        }
    }
---
            Tuple(),
            Struct {
                },
        }
        enum Generic<'a, T> where T: 'a {
            Tuple(T),
            Struct {
                    t: T,
                },
        }
    }
---
    /// ItemKind::TraitAlias
    mod item_trait_alias {
        trait Trait<T> = Sized where for<'a> T: 'a;
    }
    /// ItemKind::Impl
    mod item_impl {
        impl () { }
        impl <T> () { }
        impl Default for () { }
        impl <T> const Default for () { }
    }
    /// ItemKind::MacCall
    mod item_mac_call { }
    /// ItemKind::MacroDef
    mod item_macro_def {
        macro_rules! mac { () => {...}; }
        macro stringify { () => {} }
    }
    /// ItemKind::Delegation
    /** FIXME: todo */
    mod item_delegation { }
    /// ItemKind::DelegationMac
    /** FIXME: todo */
    mod item_delegation_mac { }
}
mod patterns {
    /// PatKind::Missing
    fn pat_missing() { let _: for fn(u32, T, &'_ str); }
    /// PatKind::Wild
    fn pat_wild() { let _; }
    /// PatKind::Ident
    fn pat_ident() {
        let x;
        let ref x;
        let mut x;
        let ref mut x;
        let ref mut x@_;
    }
    /// PatKind::Struct
    fn pat_struct() {
        let T {};
        let T::<T> {};
        let T::<'static> {};
        let T {  x };
        let T {  x: _x };
        let T { .. };
        let T {  x, .. };
        let T {  x: _x, .. };
        let T {  0: _x, .. };
        let <T as ToOwned>::Owned {};
    }
    /// PatKind::TupleStruct
    fn pat_tuple_struct() {
        struct Tuple();
        let Tuple();
        let Tuple::<T>();
        let Tuple::<'static>();
        let Tuple(x);
        let Tuple(..);
        let Tuple(x, ..);
    }
    /// PatKind::Or
    fn pat_or() { let true | false; let true; let true | false; }
    /// PatKind::Path
    fn pat_path() {
        let core::marker::PhantomData;
        let core::marker::PhantomData::<T>;
        let core::marker::PhantomData::<'static>;
        let <T as Trait>::CONST;
    }
    /// PatKind::Tuple
    fn pat_tuple() { let (); let (true,); let (true, false); }
    /// PatKind::Deref
    fn pat_deref() { let deref!(pat); }
    /// PatKind::Ref
    fn pat_ref() { let &pat; let &mut pat; }
    /// PatKind::Expr
    fn pat_expr() { let 1000i8; let -""; }
    /// PatKind::Range
    fn pat_range() { let ..1; let 0...; let 0..1; let 0...1; let -2...-1; }
    /// PatKind::Slice
    fn pat_slice() { let []; let [true]; let [true]; let [true, false]; }
    /// PatKind::Rest
    fn pat_rest() { let _; }
    /// PatKind::Never
    fn pat_never() { let !; let Some(!); }
    /// PatKind::Paren
    fn pat_paren() { let pat; }
    /// PatKind::MacCall
    fn pat_mac_call() { let ""; let ""; let ""; }
}
mod statements {
    /// StmtKind::Let
    fn stmt_let() {
        let _;
---
        struct Struct {
        }
        struct Unit;
    }
    /// StmtKind::Expr
    fn stmt_expr() { () }
    /// StmtKind::Semi
    fn stmt_semi() { 1 + 1; }
    /// StmtKind::Empty
    fn stmt_empty() { }
    /// StmtKind::MacCall
    fn stmt_mac_call() { "..."; "..."; "..."; }
}
mod types {
    /// TyKind::Slice
    fn ty_slice() { let _: [T]; }
    /// TyKind::Array
    fn ty_array() { let _: [T; 0]; }
    /// TyKind::Ptr
    fn ty_ptr() { let _: *const T; let _: *mut T; }
    /// TyKind::Ref
    fn ty_ref() {
        let _: &T;
        let _: &mut T;
        let _: &'static T;
        let _: &'static mut [T];
        let _: &T<T<T<T<T>>>>;
        let _: &T<T<T<T<T>>>>;
    }
    /// TyKind::BareFn
    fn ty_bare_fn() {
        let _: fn();
        let _: fn() -> ();
        let _: fn(T);
        let _: fn(t: T);
        let _: fn();
        let _: for<'a> fn();
    }
    /// TyKind::Never
    fn ty_never() { let _: !; }
    /// TyKind::Tup
    fn ty_tup() { let _: (); let _: (T,); let _: (T, T); }
    /// TyKind::Path
    fn ty_path() {
        let _: T;
        let _: T<'static>;
        let _: T<T>;
        let _: T<T>;
        let _: T;
        let _: <T as ToOwned>::Owned;
    }
    /// TyKind::TraitObject
    fn ty_trait_object() {
        let _: dyn Send;
        let _: dyn Send + 'static;
        let _: dyn Send + 'static;
        let _: dyn for<'a> Send;
    }
    /// TyKind::ImplTrait
    const fn ty_impl_trait() {
        let _: (/*ERROR*/);
        let _: (/*ERROR*/);
        let _: (/*ERROR*/);
        let _: (/*ERROR*/);
        let _: (/*ERROR*/);
        let _: (/*ERROR*/);
    }
    /// TyKind::Paren
    fn ty_paren() { let _: T; }
    /// TyKind::Typeof
    /** unused for now */
    fn ty_typeof() { }
    /// TyKind::Infer
    fn ty_infer() { let _: _; }
    /// TyKind::ImplicitSelf
    /** there is no syntax for this */
    fn ty_implicit_self() { }
    /// TyKind::MacCall
    fn ty_mac_call() {
        macro_rules! ty { ($ty:ty) => { $ty } }
        let _: T;
        let _: T;
        let _: T;
    }
    /// TyKind::CVarArgs
    /** FIXME: todo */
    fn ty_c_var_args() { }
    /// TyKind::Pat
    fn ty_pat() { let _: u32 is 1..=RangeMax; }
}
mod visibilities {
    /// VisibilityKind::Public
    mod visibility_public {
        struct Pub;
---
--- stderr -------------------------------
error[E0697]: closures cannot be static
##[error]  --> /checkout/tests/ui/unpretty/exhaustive.rs:209:9
   |
LL |         static || value;            //[hir]~ ERROR closures cannot be static
   |         ^^^^^^^^^

error[E0697]: closures cannot be static
##[error]  --> /checkout/tests/ui/unpretty/exhaustive.rs:210:9
   |
LL |         static move || value;       //[hir]~ ERROR closures cannot be static
   |         ^^^^^^^^^^^^^^

error[E0728]: `await` is only allowed inside `async` functions and blocks
##[error]  --> /checkout/tests/ui/unpretty/exhaustive.rs:239:13
   |
LL |     fn expr_await() {
   |     --------------- this is not `async`
LL |         let fut;
LL |         fut.await;  //[hir]~ ERROR `await` is only allowed
   |             ^^^^^ only allowed inside `async` functions and blocks

error: in expressions, `_` can only be used on the left-hand side of an assignment
##[error]  --> /checkout/tests/ui/unpretty/exhaustive.rs:290:9
   |
LL |         _;      //[hir]~ ERROR in expressions, `_` can only
   |         ^ `_` not allowed here

error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
##[error]  --> /checkout/tests/ui/unpretty/exhaustive.rs:300:9
   |
LL |         x::();            //[hir]~ ERROR parenthesized type parameters
   |         ^^^^^ only `Fn` traits may use parentheses

error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
##[error]  --> /checkout/tests/ui/unpretty/exhaustive.rs:301:9
   |
LL |         x::(T, T) -> T;   //[hir]~ ERROR parenthesized type parameters
   |         ^^^^^^^^^^^^^^ only `Fn` traits may use parentheses
   |
help: use angle brackets instead
   |
LL -         x::(T, T) -> T;   //[hir]~ ERROR parenthesized type parameters
LL +         x::<T, T> -> T;   //[hir]~ ERROR parenthesized type parameters
   |

error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
##[error]  --> /checkout/tests/ui/unpretty/exhaustive.rs:302:9
   |
LL |         crate::() -> ()::expressions::() -> ()::expr_path;
   |         ^^^^^^^^^^^^^^^ only `Fn` traits may use parentheses

error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
##[error]  --> /checkout/tests/ui/unpretty/exhaustive.rs:302:26
   |
LL |         crate::() -> ()::expressions::() -> ()::expr_path;
   |                          ^^^^^^^^^^^^^^^^^^^^^ only `Fn` traits may use parentheses

error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
##[error]  --> /checkout/tests/ui/unpretty/exhaustive.rs:305:9
   |
LL |         core::()::marker::()::PhantomData;
   |         ^^^^^^^^ only `Fn` traits may use parentheses

error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
##[error]  --> /checkout/tests/ui/unpretty/exhaustive.rs:305:19
   |
LL |         core::()::marker::()::PhantomData;
   |                   ^^^^^^^^^^ only `Fn` traits may use parentheses

error: `yield` can only be used in `#[coroutine]` closures, or `gen` blocks
##[error]  --> /checkout/tests/ui/unpretty/exhaustive.rs:392:9
   |
LL |         yield;          //[hir]~ ERROR `yield` can only be used
   |         ^^^^^
   |
help: use `#[coroutine]` to make this closure a coroutine
   |
LL |     #[coroutine] fn expr_yield() {
   |     ++++++++++++

error[E0703]: invalid ABI: found `C++`
##[error]  --> /checkout/tests/ui/unpretty/exhaustive.rs:472:23
   |
LL |         unsafe extern "C++" {}  //[hir]~ ERROR invalid ABI
   |                       ^^^^^ invalid ABI
   |
   = note: invoke `rustc --print=calling-conventions` for a full list of supported calling conventions

error: `..` patterns are not allowed here
##[error]  --> /checkout/tests/ui/unpretty/exhaustive.rs:674:13
   |
LL |         let ..;     //[hir]~ ERROR `..` patterns are not allowed here
   |             ^^
   |
   = note: only allowed in tuple, tuple struct, and slice patterns

error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
##[error]  --> /checkout/tests/ui/unpretty/exhaustive.rs:789:16
   |
LL |         let _: T() -> !;    //[hir]~ ERROR parenthesized type parameters
   |                ^^^^^^^^ only `Fn` traits may use parentheses

error[E0562]: `impl Trait` is not allowed in the type of variable bindings
##[error]  --> /checkout/tests/ui/unpretty/exhaustive.rs:803:16
   |
LL |         let _: impl Send;               //[hir]~ ERROR `impl Trait` is not allowed
   |                ^^^^^^^^^
   |
   = note: `impl Trait` is only allowed in arguments and return types of functions and methods
   = note: see issue #63065 <https://github.com/rust-lang/rust/issues/63065> for more information
   = help: add `#![feature(impl_trait_in_bindings)]` to the crate attributes to enable
   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

error[E0562]: `impl Trait` is not allowed in the type of variable bindings
##[error]  --> /checkout/tests/ui/unpretty/exhaustive.rs:804:16
   |
LL |         let _: impl Send + 'static;     //[hir]~ ERROR `impl Trait` is not allowed
   |                ^^^^^^^^^^^^^^^^^^^
   |
   = note: `impl Trait` is only allowed in arguments and return types of functions and methods
   = note: see issue #63065 <https://github.com/rust-lang/rust/issues/63065> for more information
   = help: add `#![feature(impl_trait_in_bindings)]` to the crate attributes to enable
   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

error[E0562]: `impl Trait` is not allowed in the type of variable bindings
##[error]  --> /checkout/tests/ui/unpretty/exhaustive.rs:805:16
   |
LL |         let _: impl 'static + Send;     //[hir]~ ERROR `impl Trait` is not allowed
   |                ^^^^^^^^^^^^^^^^^^^
   |
   = note: `impl Trait` is only allowed in arguments and return types of functions and methods
   = note: see issue #63065 <https://github.com/rust-lang/rust/issues/63065> for more information
   = help: add `#![feature(impl_trait_in_bindings)]` to the crate attributes to enable
   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

error[E0562]: `impl Trait` is not allowed in the type of variable bindings
##[error]  --> /checkout/tests/ui/unpretty/exhaustive.rs:806:16
   |
LL |         let _: impl ?Sized;             //[hir]~ ERROR `impl Trait` is not allowed
   |                ^^^^^^^^^^^
   |
   = note: `impl Trait` is only allowed in arguments and return types of functions and methods
   = note: see issue #63065 <https://github.com/rust-lang/rust/issues/63065> for more information
   = help: add `#![feature(impl_trait_in_bindings)]` to the crate attributes to enable
   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

error[E0562]: `impl Trait` is not allowed in the type of variable bindings
##[error]  --> /checkout/tests/ui/unpretty/exhaustive.rs:807:16
   |
LL |         let _: impl [const] Clone;       //[hir]~ ERROR `impl Trait` is not allowed
   |                ^^^^^^^^^^^^^^^^^^
   |
   = note: `impl Trait` is only allowed in arguments and return types of functions and methods
   = note: see issue #63065 <https://github.com/rust-lang/rust/issues/63065> for more information
   = help: add `#![feature(impl_trait_in_bindings)]` to the crate attributes to enable
   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

error[E0562]: `impl Trait` is not allowed in the type of variable bindings
##[error]  --> /checkout/tests/ui/unpretty/exhaustive.rs:808:16
   |
LL |         let _: impl for<'a> Send;       //[hir]~ ERROR `impl Trait` is not allowed
   |                ^^^^^^^^^^^^^^^^^
   |
   = note: `impl Trait` is only allowed in arguments and return types of functions and methods
   = note: see issue #63065 <https://github.com/rust-lang/rust/issues/63065> for more information
   = help: add `#![feature(impl_trait_in_bindings)]` to the crate attributes to enable
   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date

error: aborting due to 20 previous errors

Some errors have detailed explanations: E0214, E0562, E0697, E0703, E0728.
For more information about an error, try `rustc --explain E0214`.

@MusicalNinjaDad

MusicalNinjaDad commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

r? @MusicalNinjaDad

@rustbot

rustbot commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator

Error: Failed to set assignee to claim: req=https://api.github.com/repos/rust-lang/rust/issues/163848/assignees (x-github-request-id: A576:383F8F:682BC4:70890E:6AC49E29): {"message":"Not Found","documentation_url":"https://docs.github.com/rest/issues/assignees#add-assignees-to-an-issue","status":"404"}

Note: Only org members with at least the repository "read" role, users with write permissions, or people who have commented on the PR may be assigned.

Please file an issue on GitHub at triagebot if there's a problem with this bot, or reach out on #triagebot on Zulip.

@rust-bors

rust-bors Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #164005) made this pull request unmergeable. Please resolve the merge conflicts by rebasing.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants