mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 17:24:06 +00:00
64ea8eb1a9
The `Debug` impl for `Ty` just calls the `Display` impl for `Ty`. This is surprising and annoying. In particular, it means `Debug` doesn't show as much information as `Debug` for `TyKind` does. And `Debug` is used in some user-facing error messages, which seems bad. This commit changes the `Debug` impl for `Ty` to call the `Debug` impl for `TyKind`. It also does a number of follow-up changes to preserve existing output, many of which involve inserting `with_no_trimmed_paths!` calls. It also adds `Display` impls for `UserType` and `Canonical`. Some tests have changes to expected output: - Those that use the `rustc_abi(debug)` attribute. - Those that use the `EMIT_MIR` annotation. In each case the output is slightly uglier than before. This isn't ideal, but it's pretty weird (particularly for the attribute) that the output is using `Debug` in the first place. They're fairly obscure attributes (I hadn't heard of them) so I'm not worried by this. For `async-is-unwindsafe.stderr`, there is one line that now lacks a full path. This is a consistency improvement, because all the other mentions of `Context` in this test lack a path.
39 lines
1.6 KiB
Plaintext
39 lines
1.6 KiB
Plaintext
error[E0277]: the type `&mut Context<'_>` may not be safely transferred across an unwind boundary
|
|
--> $DIR/async-is-unwindsafe.rs:12:19
|
|
|
|
|
LL | is_unwindsafe(async {
|
|
| ___________________^
|
|
LL | |
|
|
LL | | use std::ptr::null;
|
|
LL | | use std::task::{Context, RawWaker, RawWakerVTable, Waker};
|
|
... |
|
|
LL | | drop(cx_ref);
|
|
LL | | });
|
|
| | ^
|
|
| | |
|
|
| |_____`&mut Context<'_>` may not be safely transferred across an unwind boundary
|
|
| within this `[async block@$DIR/async-is-unwindsafe.rs:12:19: 29:6]`
|
|
|
|
|
= help: within `[async block@$DIR/async-is-unwindsafe.rs:12:19: 29:6]`, the trait `UnwindSafe` is not implemented for `&mut Context<'_>`
|
|
= note: `UnwindSafe` is implemented for `&Context<'_>`, but not for `&mut Context<'_>`
|
|
note: future does not implement `UnwindSafe` as this value is used across an await
|
|
--> $DIR/async-is-unwindsafe.rs:25:18
|
|
|
|
|
LL | let cx_ref = &mut cx;
|
|
| ------ has type `&mut Context<'_>` which does not implement `UnwindSafe`
|
|
LL |
|
|
LL | async {}.await; // this needs an inner await point
|
|
| ^^^^^ await occurs here, with `cx_ref` maybe used later
|
|
...
|
|
LL | });
|
|
| - `cx_ref` is later dropped here
|
|
note: required by a bound in `is_unwindsafe`
|
|
--> $DIR/async-is-unwindsafe.rs:3:26
|
|
|
|
|
LL | fn is_unwindsafe(_: impl std::panic::UnwindSafe) {}
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_unwindsafe`
|
|
|
|
error: aborting due to previous error
|
|
|
|
For more information about this error, try `rustc --explain E0277`.
|