mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-30 14:01:51 +00:00
Add regression tests for 123303
This commit is contained in:
parent
88296bddf8
commit
56dbeeb5ac
24
tests/ui/traits/stack-error-order-dependence-2.rs
Normal file
24
tests/ui/traits/stack-error-order-dependence-2.rs
Normal file
@ -0,0 +1,24 @@
|
||||
//@ check-pass
|
||||
// Regression test for <https://github.com/rust-lang/rust/issues/123303>.
|
||||
// This time EXCEPT without `dyn` builtin bounds :^)
|
||||
|
||||
pub trait Trait: Supertrait {}
|
||||
|
||||
trait Impossible {}
|
||||
impl<F: ?Sized + Impossible> Trait for F {}
|
||||
|
||||
pub trait Supertrait {}
|
||||
|
||||
impl<T: ?Sized + Trait + Impossible> Supertrait for T {}
|
||||
|
||||
fn needs_supertrait<T: ?Sized + Supertrait>() {}
|
||||
fn needs_trait<T: ?Sized + Trait>() {}
|
||||
|
||||
struct A;
|
||||
impl Trait for A where A: Supertrait {}
|
||||
impl Supertrait for A {}
|
||||
|
||||
fn main() {
|
||||
needs_supertrait::<A>();
|
||||
needs_trait::<A>();
|
||||
}
|
19
tests/ui/traits/stack-error-order-dependence.rs
Normal file
19
tests/ui/traits/stack-error-order-dependence.rs
Normal file
@ -0,0 +1,19 @@
|
||||
//@ check-pass
|
||||
// Regression test for <https://github.com/rust-lang/rust/issues/123303>.
|
||||
|
||||
pub trait Trait: Supertrait {}
|
||||
|
||||
trait Impossible {}
|
||||
impl<F: ?Sized + Impossible> Trait for F {}
|
||||
|
||||
pub trait Supertrait {}
|
||||
|
||||
impl<T: ?Sized + Trait + Impossible> Supertrait for T {}
|
||||
|
||||
fn needs_supertrait<T: ?Sized + Supertrait>() {}
|
||||
fn needs_trait<T: ?Sized + Trait>() {}
|
||||
|
||||
fn main() {
|
||||
needs_supertrait::<dyn Trait>();
|
||||
needs_trait::<dyn Trait>();
|
||||
}
|
Loading…
Reference in New Issue
Block a user