diff --git a/tests/ui/traits/stack-error-order-dependence-2.rs b/tests/ui/traits/stack-error-order-dependence-2.rs new file mode 100644 index 00000000000..323685aa15b --- /dev/null +++ b/tests/ui/traits/stack-error-order-dependence-2.rs @@ -0,0 +1,24 @@ +//@ check-pass +// Regression test for . +// This time EXCEPT without `dyn` builtin bounds :^) + +pub trait Trait: Supertrait {} + +trait Impossible {} +impl Trait for F {} + +pub trait Supertrait {} + +impl Supertrait for T {} + +fn needs_supertrait() {} +fn needs_trait() {} + +struct A; +impl Trait for A where A: Supertrait {} +impl Supertrait for A {} + +fn main() { + needs_supertrait::(); + needs_trait::(); +} diff --git a/tests/ui/traits/stack-error-order-dependence.rs b/tests/ui/traits/stack-error-order-dependence.rs new file mode 100644 index 00000000000..037c292a542 --- /dev/null +++ b/tests/ui/traits/stack-error-order-dependence.rs @@ -0,0 +1,19 @@ +//@ check-pass +// Regression test for . + +pub trait Trait: Supertrait {} + +trait Impossible {} +impl Trait for F {} + +pub trait Supertrait {} + +impl Supertrait for T {} + +fn needs_supertrait() {} +fn needs_trait() {} + +fn main() { + needs_supertrait::(); + needs_trait::(); +}