]> git.lizzy.rs Git - rust.git/blob - tests/ui/associated-types/object-normalization.rs
Rollup merge of #107531 - GuillaumeGomez:inline-images-in-css, r=notriddle
[rust.git] / tests / ui / associated-types / object-normalization.rs
1 // ignore-tidy-linelength
2
3 // Check that we normalize super predicates for object candidates.
4
5 // check-pass
6
7 use std::ops::Index;
8
9 fn next<'a, T>(s: &'a mut dyn SVec<Item = T, Output = T>) {
10     // To prove
11     // `dyn SVec<Item = T, Output = T>: SVec`
12     // we need to show
13     // `dyn SVec<Item = T, Output = T> as Index>::Output == <dyn SVec<Item = T, Output = T> as SVec>::Item`
14     // which, with the current normalization strategy, has to be eagerly
15     // normalized to:
16     // `dyn SVec<Item = T, Output = T> as Index>::Output == T`.
17     let _ = s.len();
18 }
19
20 trait SVec: Index<usize, Output = <Self as SVec>::Item> {
21     type Item;
22
23     fn len(&self) -> usize;
24 }
25
26 fn main() {}