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.
Rollup merge of rust-lang#136951 - compiler-errors:clause-binder, r=lqd Use the right binder for rebinding `PolyTraitRef` Fixes rust-lang#136940 I committed a slightly different test which still demonstrates the issue.
- Loading branch information
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() {} |