Add regression tests for 123303

This commit is contained in:
Michael Goulet 2024-03-31 21:03:59 -04:00
parent 88296bddf8
commit 56dbeeb5ac
2 changed files with 43 additions and 0 deletions

View 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>();
}

View 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>();
}