forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
88296bd
commit 56dbeeb
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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>(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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>(); | ||
} |