From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- .../ui/type-alias-impl-trait/issue-53092-2.stderr | 55 ++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 src/test/ui/type-alias-impl-trait/issue-53092-2.stderr (limited to 'src/test/ui/type-alias-impl-trait/issue-53092-2.stderr') diff --git a/src/test/ui/type-alias-impl-trait/issue-53092-2.stderr b/src/test/ui/type-alias-impl-trait/issue-53092-2.stderr new file mode 100644 index 000000000..1b89d5571 --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/issue-53092-2.stderr @@ -0,0 +1,55 @@ +error[E0391]: cycle detected when computing type of `Bug::{opaque#0}` + --> $DIR/issue-53092-2.rs:4:18 + | +LL | type Bug = impl Fn(T) -> U + Copy; + | ^^^^^^^^^^^^^^^^^^^^^^ + | +note: ...which requires type-checking `CONST_BUG`... + --> $DIR/issue-53092-2.rs:6:1 + | +LL | const CONST_BUG: Bug = unsafe { std::mem::transmute(|_: u8| ()) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: ...which requires computing layout of `Bug`... + = note: ...which requires normalizing `Bug`... + = note: ...which again requires computing type of `Bug::{opaque#0}`, completing the cycle +note: cycle used when checking item types in top-level module + --> $DIR/issue-53092-2.rs:1:1 + | +LL | / #![feature(type_alias_impl_trait)] +LL | | #![allow(dead_code)] +LL | | +LL | | type Bug = impl Fn(T) -> U + Copy; +... | +LL | | CONST_BUG(0); +LL | | } + | |_^ + +error[E0512]: cannot transmute between types of different sizes, or dependently-sized types + --> $DIR/issue-53092-2.rs:6:41 + | +LL | const CONST_BUG: Bug = unsafe { std::mem::transmute(|_: u8| ()) }; + | ^^^^^^^^^^^^^^^^^^^ + | + = note: source type: `[closure@$DIR/issue-53092-2.rs:6:61: 6:68]` (0 bits) + = note: target type: `Bug` (size can vary because of [type error]) + +error[E0277]: the trait bound `U: From` is not satisfied + --> $DIR/issue-53092-2.rs:10:5 + | +LL | |x| x.into() + | ^^^^^^^^^^^^ the trait `From` is not implemented for `U` + | +note: required by a bound in `make_bug` + --> $DIR/issue-53092-2.rs:9:19 + | +LL | fn make_bug>() -> Bug { + | ^^^^^^^ required by this bound in `make_bug` +help: consider restricting type parameter `U` + | +LL | type Bug> = impl Fn(T) -> U + Copy; + | +++++++++++++++++++++++ + +error: aborting due to 3 previous errors + +Some errors have detailed explanations: E0277, E0391, E0512. +For more information about an error, try `rustc --explain E0277`. -- cgit v1.2.3