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 right binder for rebinding PolyTraitRef
- Loading branch information
1 parent
ef148cd
commit 88193aa
Showing
2 changed files
with
20 additions
and
2 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,18 @@ | ||
// Make sure we are using the right binder vars when expanding | ||
// `for<'a> Foo<'a>` to `for<'a> Bar<'a>`. | ||
|
||
//@ check-pass | ||
|
||
#![feature(trait_alias)] | ||
|
||
trait Bar<'a> {} | ||
|
||
trait Foo<'a> = Bar<'a>; | ||
|
||
fn test2(_: &(impl for<'a> Foo<'a> + ?Sized)) {} | ||
|
||
fn test(x: &dyn for<'a> Foo<'a>) { | ||
test2(x); | ||
} | ||
|
||
fn main() {} |