From 9918693037dce8aa4bb6f08741b6812923486c18 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 19 Jun 2024 11:26:03 +0200 Subject: Merging upstream version 1.76.0+dfsg1. Signed-off-by: Daniel Baumann --- tests/ui/traits/next-solver/upcast-right-substs.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 tests/ui/traits/next-solver/upcast-right-substs.rs (limited to 'tests/ui/traits/next-solver/upcast-right-substs.rs') diff --git a/tests/ui/traits/next-solver/upcast-right-substs.rs b/tests/ui/traits/next-solver/upcast-right-substs.rs new file mode 100644 index 000000000..5b4f6d4be --- /dev/null +++ b/tests/ui/traits/next-solver/upcast-right-substs.rs @@ -0,0 +1,13 @@ +// compile-flags: -Znext-solver +// check-pass +#![feature(trait_upcasting)] + +trait Foo: Bar + Bar {} + +trait Bar {} + +fn main() { + let x: &dyn Foo = todo!(); + let y: &dyn Bar = x; + let z: &dyn Bar = x; +} -- cgit v1.2.3