forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use the correct supertrait substitution in
object_ty_for_trait
Fixes rust-lang#57156.
- Loading branch information
Showing
2 changed files
with
47 additions
and
9 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
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,23 @@ | ||
// compile-pass | ||
|
||
trait Foo<Args> { | ||
type Output; | ||
} | ||
|
||
trait Bar<'a, T>: for<'s> Foo<&'s T, Output=bool> { | ||
fn cb(&self) -> Box<dyn Bar<'a, T, Output=bool>>; | ||
} | ||
|
||
impl<'s> Foo<&'s ()> for () { | ||
type Output = bool; | ||
} | ||
|
||
impl<'a> Bar<'a, ()> for () { | ||
fn cb(&self) -> Box<dyn Bar<'a, (), Output=bool>> { | ||
Box::new(*self) | ||
} | ||
} | ||
|
||
fn main() { | ||
let _t = ().cb(); | ||
} |