From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- tests/ui/traits/inductive-overflow/two-traits.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 tests/ui/traits/inductive-overflow/two-traits.rs (limited to 'tests/ui/traits/inductive-overflow/two-traits.rs') diff --git a/tests/ui/traits/inductive-overflow/two-traits.rs b/tests/ui/traits/inductive-overflow/two-traits.rs new file mode 100644 index 000000000..463b55d85 --- /dev/null +++ b/tests/ui/traits/inductive-overflow/two-traits.rs @@ -0,0 +1,22 @@ +// Regression test for #29859, initial version. This example allowed +// arbitrary trait bounds to be synthesized. + +// Trait that you want all types to implement. +use std::marker::{Sync as Trait}; + +pub trait Magic { + type X: Trait; +} +impl Magic for T { + type X = Self; + //~^ ERROR E0277 +} + +fn check() {} + +fn wizard() { check::<::X>(); } + +fn main() { + wizard::<*mut ()>(); //~ ERROR E0275 + // check::<*mut ()>(); +} -- cgit v1.2.3