-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Normalize super trait bounds when confirming object candidates
- Loading branch information
1 parent
d08ab94
commit e674cf0
Showing
2 changed files
with
46 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,26 @@ | ||
// ignore-tidy-linelength | ||
|
||
// Check that we normalize super predicates for object candidates. | ||
|
||
// check-pass | ||
|
||
use std::ops::Index; | ||
|
||
fn next<'a, T>(s: &'a mut dyn SVec<Item = T, Output = T>) { | ||
// To prove | ||
// `dyn SVec<Item = T, Output = T>: SVec` | ||
// we need to show | ||
// `dyn SVec<Item = T, Output = T> as Index>::Output == <dyn SVec<Item = T, Output = T> as SVec>::Item` | ||
// which, with the current normalization strategy, has to be eagerly | ||
// normalized to: | ||
// `dyn SVec<Item = T, Output = T> as Index>::Output == T`. | ||
let _ = s.len(); | ||
} | ||
|
||
trait SVec: Index<usize, Output = <Self as SVec>::Item> { | ||
type Item; | ||
|
||
fn len(&self) -> usize; | ||
} | ||
|
||
fn main() {} |